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!

Crystal Reports 10; MS SQL Server 2008 R2. Hide Header for cross-tab in footer. 1

Status
Not open for further replies.

hmax

Programmer
Jan 22, 2012
60
US
Crystal Reports 10
MS SQL Server 2008 R2.

Two Show/Hide Headers are in the main report, grouped by XX.
Header 1 shows for page 1 for each new subject in group, else hidden.
Header 2 shows for all additional pages for each subject in group, else hidden.

E.g.,
Header 1
Group XX, A subject, page 1 only, else hide.
Header 2
Group XX, B subject, page 2 onwards, else hide.

Pagination returns to page 1 after the final record in the detail for each subject.

After the last record for the entire group XX, I have a cross-tab in the Footer.
I want to hide Header 1 on page 1 of the crosstab display.
Header 1 is already hidden for pages 2 and onwards because of the hide logic in place.

I am using the Variable:

Shared NumberVar PageofLastField;

If OnLastRecord then PageofLastField := PageNumber;


Then, placing the following code in the header section that I wish to hide:

Shared NumberVar PageofLastField;

PageofLastField := PageofLastField;

if pageofLastfield = 1 then false
else
if pageofLastfield <> 0 and PageNumber > PageofLastField
THEN TRUE
ELSE FALSE

However, this isn't exactly what I need because, of course, the Header appears where the page numbering for the cross-tab pages reverts back to one.

What solution can I use to hide Header 1 on the first page of the cross-tab?

Thanks!

 
Create 2 formula fields:

@SwitchPageHeaderOn
WhilePrintingRecords;
booleanVar ShowPageHeader := Yes

place it in the group2 header(make font white on a white background to hide it)

@SwitchPageHeaderOff
WhilePrintingRecords;
booleanVar ShowPageHeader := No

place it in the group1 footer
in the header's section expert, suppress the header with the formula;

WhilePrintingRecords;
booleanVar ShowPageHeader;
if ShowPageHeader
then
No
else
Yes


In my Scenario,; I have no details only group1 header & 3 x group2 footers each with a pivot table
My group1 is SupplierName
Group 2 is the CostType(Freight, Additionals,Destination)- so a pivot of each

The first page of pivots Supplier has the Group1 header "SupplierName1
the subsequent pages of group 1 have 1 header : "SupplierName1 continued...."

I think this is what you want, if not, it's near enough to edit for your purposes
 
hmax
Did NickieP's help? If so, it is polite to acknowledge the poster's assistance (the Great Post purple star is a good way to do so), and also helps others to know if the proposed solution worked or not. Failure to at least acknowledge and thank those trying to help may result in them deciding not to assist you in the future.

If it didn't work or didn't provide the result you were looking for an explanation might mean someone else can help you.
 
NickieP:

Thanks for getting back to me. Just reading your response now. Normally I receive an email when a response post appears - unfortunately I must have missed it this time around.

Truly appreciate your feedback. I will have to test out the scenario, but as you suggest, it's near enough to do some edits if necessary.

pmax9999:

Thank you for your response, too, and you are absolutely right. Apologies for the delay on my part, and Nickie has received the purple star!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top