Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass value from sub to main report's Page Footer

Status
Not open for further replies.

bodev

Technical User
Mar 5, 2012
15
US
Hi All,
Scenario:
using crystal report 2008
I have a sub report that pushes its contents to the next page if records are more than 3. I have placed that sub report in the main report's Group Header 1c.
I have a part of the report that I want to be able to display on the first page of the report even if the records are more than 3 and the sub report is pushing contents to the next page. I have accomplished this by placing that part of the report in the Main Report's Page Footer.

Issue:
Now, i want to pass value from sub report to main report for which I m using shared variable in the sub report, but when i use the same shared variable in the main report's Page Footer, i m not getting the value. (Note: I want to use the shared variable value in Main Report's Page Footer because that is where I have the part of the report which I want to display on the first page of the report).

Let's say i move the part of the report (which i want to display on the first page) to the Main report's Group Footer and use the shared variable here, i get the value, but the Main Report's Group Footer is pushed to the next page if records are more than 3 and I want this part of the report to stay on the first page and not go to the next page[ponder]

please let me know if you have any suggestions

Thank you.
 
If the subreport spans pages, you can't pass anything out to the page footer that's in the middle of the report. The value won't be passed out of the subreport until it finishes processing.

Instead of using the page footer, you could try this:

1. Right-click on the subreport and select "Format...". Turn off "Keep Together". This will prevent the new page from happening before the subreport starts if it spans multiple pages.

2. In the subreport, group by something that only appears once in the subreport. In the header for that group place the info that you want to always appear on the first page.

3. Set the "New Page After" formula for that group header so that it gives you the page break when you need it.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Not entirely sure I understand what you want. But using Page headers and footers is problematic.
You can try a fakepageheadergroup as your top group

Create formula

@Fakepageheader

whilereadingrecords;
' '

Group on this formula and make it your Group1, in Group options check Repeat on each page.

This works fine when a page header is required especially in Subreports which do not obey normal page rules. Never tried to see what happens when you use its footer.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top