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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to chk if its a start of new page, if it is show header else not. 1

Status
Not open for further replies.

ajneedshelp

Programmer
Jan 21, 2008
11
0
0
US
Hi

I have a main report and a sub report in it.

i cannot use Page break after/before for the sub report.

But i need to check whether the sub report starts from a new page or not. if yes i need to display sub report header else i need to supress it.

Help me Plz.

AJ
 
Create the page header in a page header_b section of the main report. Then create the following formulas and place them where designated.

//{@false} to be placed in the main report section containing the sub:
whileprintingrecords;
booleanvar flag := false;

//{@true} to be placed in the report header of the main report:
whileprintingrecords;
booleanvar flag := true;

Then go into the section expert->page header->suppress->x+2 and enter:
whileprintingrecords;
booleanvar flag;
flag = true; //note no colon

-LB
 
Ian - i am using CR ver 9. over there i can find an option as "Repeat Group header on each page" it does not specify that include this header only on new page.

Can I somehow write a formula to have this done.

I need to display different header on different page. so i am implementing it thru sub report and placing header info in sub report headers which is fine.

But the sub reports need to diplay the header only if they start from a new page and i cannot force them to start on new page by using page break after/before option.

Hope i am able to explain my problem better.

-AJ
 
You could use a combination of our suggestions. If you create my two formulas {@true} and {@false}, but change them both to use shared variables, as in:

//{@false}:
whileprintingrecords;
shared booleanvar flag := false;

...you could place {@false} in the main report section above the one containing the subreport, and place {@true} in the main report page header. Then also place {@false} (created within the sub) in the detail section of the sub. Then in the sub section expert->fake group header->suppress enter:

whileprintingrecords;
shared booleanvar flag;
flag = true

The flag will only be true if the sub is in the section immediately following the page header of the main report.

-LB
 
Its not working.....

where do i need to include these formulas exactly?

I added them in report and just dragged and dropped them on the report in the sections mentioned but its not working....

Do i need to do somrthing else?

-AJ
 
In what section is your subreport located? Where exactly did you place each formula? Please show the content of each formula also. I really already told you where everything should go.

-LB
 
LB,
i agree to what you are saying... I tried it the problem that i am facing now is when the sub report starts from new page it does not priont the header.

this is what i have done -->

Main report Page header --> @true with shared variable.
Main report Detail section c --> @ false with shared variable.
Main report detail section D has sub report.
Sub report - report header --> permanently suppressed
Sub report - fake Group header with "display on each page chkbox" chkd. --> Suppress on the condition you have mentioned.
Sub report - detail section A --> @false with shared variable.

Kindly let me know if i am missin something!!!!!

-AJ
 
I think I misunderstood. You want the subreport page header (fake group header) to show on all subreport pages, except that for the first page, you want to the headers to show ONLY if the sub is first on the page, but otherwise (if lower on the page) don't show the headings? If this is what you meant, then move the formulas around so that:

{@false} is in the main report page header
{@true} is in the main report detail_c
{@false} is in the detail section of the sub.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top