CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Feb 2011
    Posts
    57

    Print only the subreport but not the main

    Hello,
    I have a PO form that prints items and PO information. At the end of the report I have a subreport attached that prints bar-code information. But within the main report. So, I get the main header and the po barcode information. How do I turn off the main report so that only the barcode information prints at the end of the main report. Not the main PO header and stuff.

    The subreport is located in the Report footer which is fine. This gives me the barcodes after the main po form is done printing.

    I can't suppress a section based on page number because the will affect the main as the PO information can expand several pages.

    Any information would be greatly appreciated.

    Thank you,
    Patrick.


    PS. I found this code below but it messes up the page number which then messes up the display: (This gets me close.)

    Right-click on the Footer Section, choose Format Section. click the button beside the Suppress (No Drill-Down) under Common Tab and place this code...

    if pagenumber=TotalPageCount then true
    else false


    From:
    http://www.dbforums.com/crystal-repo...last-page.html



    It is almost like when the report footer runs I need to turn off printing the Header, details.
    Last edited by PNorm; March 29th, 2011 at 01:34 PM.

  2. #2
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    I almost have it. I put in
    OnLastRecord in the suppression formula and when the page is Subreport it works Except for the page footer does not print on the last page that the last record is. Or when the last record appears on only the page, then none of the heading print. I need the last record to generate all headers and page footer but then the subreport on the report footer should clear out the page headers and pagefooters.

  3. #3
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    Is there a way to reference in a formula the total page count of the report. I think I have a solution worked out but need to know the the total page count.

    I am thinking of adding +1 to every page. Then when the main report passes to the subreport the number of the total page count will change to the next increment value. This will alway be lower than the running total on the variable I have accumulating. So then I can suppress based on var1 > total page count.

    Let me know what you think.

  4. #4
    Join Date
    Jul 2005
    Posts
    1,083

    Re: Print only the subreport but not the main

    Use 'Shared variables' to pass values between main report and subreports

    JG

  5. #5
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    Thank you for the information. I am not sure if I understand. I am only wanting to reference the total page count from when the document is rendered.

    Or if there is a better way to suppress printing the header and details when the subreport prints. Right now I get the subreport contained with in the main header and details after all the main is printed.

    Thank you,
    PN.

  6. #6
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    Can you make a container to pass a whole line of information to the main that consists of several fields?

  7. #7
    Join Date
    May 2003
    Location
    Islamabad, Pakistan
    Posts
    284

    Re: Print only the subreport but not the main

    As I understand your requirements, you want to print the bar code at the last page below the records or on the next page after all the records are shown.

    If you want to print on the next page after showing all the records then you can use the shared variable to set that all the records have been shown in the footer of the sub report which shows all the record and then set to show your bar code sub report on the next page and in the page header check all the records have been shown or not ?

    You can get the total number of pages using the build in formulas page count or page one to ..... This will slow your report but there is a formula which you can use.

    Good luck.
    If this post is helpful, then, Rate this Post.

  8. #8
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    Interesting....
    What we want to do is:
    I have a current existing report that shows all purchase order information that was ordered. Then I have created a separate report that pulls the po information and creates barcode information for scanning in receiving. It is the same po information and a simple header.
    The way it is now:
    The PO information prints then the PO barcodes print with the main header information.

    What we want is:
    Main report prints. Then the PO barcodes after with no headers.

    I guess I am not understanding clearly what formula goes where. What formula should I put in the header and footer to suppress the headers from the main when the sub report prints?

    Thank you.
    Last edited by PNorm; April 7th, 2011 at 10:22 AM.

  9. #9
    Join Date
    May 2003
    Location
    Islamabad, Pakistan
    Posts
    284

    Re: Print only the subreport but not the main

    In the main reports reports header section initialize a variable.
    booleanvar show_header := true;

    now on each page header put in the suppress section formula

    not booleanvar show_header;

    first time you set to show the header and on each page the header will be shown.

    Now go to your subreport which shows all the records. In its footer change the variable value

    booleanvar show_header := false;

    Now your header on next page will not be shown.

    Just check the sequence between the reports and the variable.

    if still having issue then send me the report with the saved data.
    If this post is helpful, then, Rate this Post.

  10. #10
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    Thanks. I will try it and get back to you.

  11. #11
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    That works pretty well. Thank you.

    I do have a couple of situations:
    Page footer is printing on subreport.

    Also the appearance of a blank page between Main and sub.

    Any advice would be greatly appreciated.

  12. #12
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    Got the blank page fixed.

  13. #13
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    Ok, I fixed the page issues. But the last page footer is disappearing on the main report. I had to put Show_header:=False in the Report_footer A before my subreport is printed.

    This is the last issue.

  14. #14
    Join Date
    May 2003
    Location
    Islamabad, Pakistan
    Posts
    284

    Re: Print only the subreport but not the main

    I am not clear about this issue. If you don't want to print the footer with the subreport which you only want to print then do as you did with the header.

    If the scenario is other than this then pleas explain it in details.
    If this post is helpful, then, Rate this Post.

  15. #15
    Join Date
    Feb 2011
    Posts
    57

    Re: Print only the subreport but not the main

    Ok, Change in situation:
    RH
    PHa
    PHb
    GHA
    GHB
    DetailsA
    DetailsB
    DetailsC
    GFA
    GFB (Contains SubReport)
    PFA
    PFB
    PFC

    The subreport was changed to the Group Footer B to allow for easier page printing and the sub will now print after the Main prints for 1 po and after each po main report. However this broke the suppression of the headers that I had set up.
    Is there an easier way to suppress Headers from the main based on when the Group Footer prints. Or is there a better way to set up a Main and sub report relationship?


    Any advice is appreciated.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured