We help IT Professionals succeed at work.

Page number+crystal report bundled vs 2008+window application

MKItani
MKItani used Ask the Experts™
on
i have a report involves sub report
and each of reports have a page header and all is fine.
but the problem is how i can add a incremental page number to the the main report and to the sub report together because in case i have added to each report a page number i don't get a incremental page number
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Owner
Commented:
you can create a formula using a shared variable  to count the page numbers in the sub report ,  put the formula accumulator in the page footer.   ie  


shared numbervar mypagenumber:=mypagenumber+1  then place this formula in the page footer of the container report and sub report.  I haven't tried it but it should work.

Author

Commented:
yes this is what i thinking about it for the first moment but i have a problem as follow:
first i want to show the page number in the page header of the both of the reports so for that
i put the formula in the page header of the both repors, but the problem occurs after i have added the formula to the page header of the main report, because i have a formula in the section expert "Suppress" of the page header to suppress the pahe header and after i added the page number formula the page header,the page header  appears all the times regardless the formula of suppress, why?
WillOwner

Commented:
Mkitani

Please post your rpt

Author

Commented:
pz find the attachment file.
i have suppressed the page header of the main report before to call the subreport by using  2 formula fields (ShowPageHeader,HidePageHeader) via the variables Shared BooleanVar HidePageHeader:=true.

in the report i have added the page number to the page header of the main report so pz removed or added to show the difference.

regards and  TU a lot.
regards and t u a lot
VendorStatementAccountsReport.rpt
WillOwner

Commented:
ok  just want to make sure we are on the same page:

You don't want to print the first page number if you suppress Group Header 1?   I couldn't run a test since I dont have the data.  You could repost with data both for report and sr. Just to be doubly sure,  the page numbering scheme works?, but you just want to  suppress the container report page header numbering  if  the first group header is suppressed?

Author

Commented:
thanks wkrasner
look
let takes a simple examples,
one main report and one subreport as follows:
the boths have 2 different headers.
Main Report
page header
Group header
detail
Group footer
subReport

and when we call the subreport we want to suppress the page header of the main report.
so what are you suggest?
and as u know after that i want to add a incremental page number.

waiting for your response and can u please send me an exmple involves this cases.

regrads,
WillOwner

Commented:
do you want to then always supress the container (main) report 's page header?
WillOwner

Commented:
looks like you are suppressing the subreport when SHARED booleanvar yyy=true. Try adding the formula Shared BooleanVar HidePageHeader:=false; in your subreport,  I think that might work

Author

Commented:
no i have use the SHARED booleanvar yyy=true. for another issue.
but as told you in above, the report that i sent to you is very complicated and let us take a simple example.

do you want to then always supress the container (main) report 's page header?
of coure not,
before to call the subreport we suppress the page header of the main report and after we finish to print the subreport again we show the page header over and over....
i have suppressed the page header of the main report each time before to call subreport because i don't want to see the page header of the main report on each subreport.

wainting for your response and pz send me an example involves this cases.

regards,

Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
If you have the main report page header suppressed does adding the page number to the subreport group header gie you what you want?

mlmcc

Author

Commented:
look mlmcc if i follow wht you are said in the question
http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_27240308.html

and i have used one group footer instead of insert another section section and i have put the formula and the subreport together in the group footer all is work fine until i have added a formula shared numbervar mypagenumber:=mypagenumber+1 to the page header.
by testing if i have insert another section in group footer and i put the formula WhilePrintingRecords;
Global BooleanVar SuppressPageHeader;
SuppressPageHeader := True;
""

as you said then i have added i have added a formula shared numbervar mypagenumber:=mypagenumber+1 to the page header all work fine now.
why?????????
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
It is probably because of the way or order in which Crystal evaluates formulas.  I don't fully understand why things work one way and not another.

mlmcc