• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2903
  • Last Modified:

Page number on Crystal subreport?

I have a Crystal Reports 8.5 report with a subreport.  The subreport may be more than 1 page long.  I want to number the subreport pages only (1 of 2, 2 of 2), but there is no Page Header/Page Footer option on the subreport.  Any ideas?
0
MariaHalt
Asked:
MariaHalt
  • 13
  • 9
  • 5
1 Solution
 
LinInDenverCommented:
As far as I know, this is not possible, since the sub report can be inserted into a main report at any point. The sub report doesn't really know what page it is on, which is why you'll notice there is no page header or page footer.

Have you considered placing the page number on the main report? Depending on where you place the sub report inside the main report, you can do section formatting to reset page number after certain sections, and some other options. You can conditionally suppress the page numbers on main if certain conditions are met... Maybe play around with that a little.

Possibly you can use a shared variable containing the page number and pass it to the sub report... this could work using the reset page number after section.

hope this helps.
0
 
MariaHaltAuthor Commented:
Let me explain further...The main report is a one page letter.  I don't want to number that.  The subreport is an attachment that can be more than one page long.  I wanted to number the subreport only.  
0
 
LinInDenverCommented:
Hi Maria,

Then you can try some of the approaches I mentioned above. Most likely, you can try having two sections in your report, with the letter being in section 1.
reset page number after the end of the letter section.
Place PageNumber in your main page footer.
suppress PageNumber OnFirstRecord.
I believe the outcome would be no page number displayed on the first page, and then Pages 1,2,3 etc. on following pages.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
MariaHaltAuthor Commented:
LinInDenver:  I've followed your suggestion and I got it working ALMOST exactly like I want, I just need to suppress the page number on the main report (since it's  a letter)...how can it identify when I'm on the main report?

Letter (1 page, do not want to show page number) + Attachment 1 (1 page, will display page 1 of 1) + Attachment 2 (variable pages, will display page 1 of n) and repeat for next letter, etc...

I appreciate your help!
0
 
LinInDenverCommented:
Hey Maria,

The below worked for me, on a Page N of M field sitting in the Page footer of my Main Report:

Right Click on Page Number choose Format Field
Common Tab
Click X-2 for Suppress (leave the box unchecked).

if RecordNumber = 1
then yes else no
0
 
MariaHaltAuthor Commented:
I have a group...how can I say on New Group Number, suppress page number?
0
 
LinInDenverCommented:
Well there is GroupNumber, which tells you which group you are on. Maybe you can use that somehow?

If GroupNumber = 1 then yes else no <---would suppress on the first grouping returned, and display it for all other groups in the report.
0
 
MariaHaltAuthor Commented:
Each group is a new letter...

1st Group:  Letter (do not want page number) + Attachment 1 (page 1 of 1) + Attachment 2 (page 1 of n)
2nd Group:  Letter (do not want page number)  + Attachment 1 (page 1 of 1) + Attachment 2  (page 1 of n)
3rd Group:  Letter (do not want page number)  + Attachment 1 (page 1 of 1) + Attachment 2  (page 1 of n)
etc..
0
 
LinInDenverCommented:
Hey Maria - are you able to publish the report? It will be easier for me to try a couple of things.

From File, choose Save Data with Report, Save it again. That will give me some data so I can see what's happening.
0
 
MariaHaltAuthor Commented:
I can't it's sensitive stuff and I don't have time to makeup stuff to put in it.  Thanks anyway, you pointed me in the right direction.  I'll figure it eventually.
0
 
LinInDenverCommented:
okay. it sounds like you are very close.

if you change your mind, an easy way to fake out sensitive things like names, SSNs, etc. is to replace the fields/formulas with different text  'John Doe' as a formula instead of {table.name}.

Lin
0
 
LinInDenverCommented:
I just got one thing to work... this will work as long as the attachments are always at least 2 pages.

reset page number after section containing letter.
drop PageNofM on page footer.
right click to format field, and in the suppress X2, try this formula.
if PageNofM = 'Page 1 of 1'
then yes else no

This will not work if the attachments can ever only contain 1 page...
0
 
MariaHaltAuthor Commented:
The attachments are conditionally suppressed as well.

Group A:  Letter (1 page only) + First Conditional Attachment (if visible, it's one page) + Second Conditional Attachment (if visible, pages can vary)

Group B:  Letter (1 page only) + First Conditional Attachment (if visible, it's one page) + Second Conditional Attachment (if visible, pages can vary)

Group C:  Letter (1 page only) + First Conditional Attachment (if visible, it's one page) + Second Conditional Attachment (if visible, pages can vary)

etc...

How can I conditionally suppress the page number on the letter page?  The letter is the main report.
0
 
LinInDenverCommented:
Humm... is there anything on the letters that are consistent?
I.e.: If there is a field on your letters that contains the word LETTER, or HELLO, you could maybe work that into your conditional suppress..

If {table.field} like '*HELLO*' then yes else no.

does that make sense?
0
 
MariaHaltAuthor Commented:
Yes, but the subreports are in the group footer, wouldn't they see it?
0
 
LinInDenverCommented:
Hi Maria - I'm not sure. I think you just need to experiment and see what happens. You'll have to get crafty, but I bet you can find a way to conditionally suppress it.

unfortunately, i think I've run out of ideas, but I think you are really close to solving this issue!
0
 
MariaHaltAuthor Commented:
mlmcc!!!  Thank you so much for your comment...I checked it out...unfortunately it won't work for me.  My second subreport has a grouping and the details can vary from one record to hundreds.  I spoke to the department head and they have accepted they're not going to have any page numbers :(

Seems like someone else should have come across this problem at some point.  All I want to do is suppress the page number on the letter page (first page per group).

Group A:  Letter (1 page only, no page number necessary) + First Conditional Subreport in Group Footer A  (if visible, it's one page) + Second Conditional Subreport in Group Footer B (if visible, pages can vary)

Group B:  Letter (1 page only, no page number necessary) + First Conditional Subreport in Group Footer A (if visible, it's one page) + Second Conditional Subreport in Group Footer B (if visible, pages can vary)

Group C:  Letter (1 page only, no page number necessary) + First Conditional Subreport in Group Footer A  (if visible, it's one page) + Second Conditional Subreport in Group Footer B (if visible, pages can vary)
0
 
mlmccCommented:
Can you upload just the report (no saved data) or does it include sensitive fields?

There should be a way to use the section expert to reset page numbers and suppress the page numbers

mlmcc
0
 
MariaHaltAuthor Commented:
OK...I cleared out a bunch of stuff.  I'm resetting the page number in Details l, Group Footer #1a and Group Footer #1b.  Thank you!
mh-uga-new-accept-letter-test.rpt
0
 
mlmccCommented:
Try this.

It is difficult to tell what you need without data.

mlmcc
mh-uga-new-accept-letter-testRev.rpt
0
 
MariaHaltAuthor Commented:
mlmcc:  Sorry to keep pestering you, but I can't open it (I have CR8.5).  Can you describe what you did?  Again, sorry.
0
 
mlmccCommented:
I don't remember what I did.

Try this idea

In Group Header 1B add a formula
WhilePrintingRecords;
Global BooleanVar SuppressPageNumber;
SuppressPageNumber := True;
""

In the report header
WhilePrintingRecords;
Global BooleanVar SuppressPageNumber := True;
""

COnditionally suppress PFc with
WhilePrintingRecords;
Global BooleanVar SuppressPageNumber;
SuppressPageNumber

In GF1A adda formula
WhilePrintingRecords;
Global BooleanVar SuppressPageNumber;
SuppressPageNumber := False;
""

mlmcc

0
 
MariaHaltAuthor Commented:
When you say

In the report header
WhilePrintingRecords;
Global BooleanVar SuppressPageNumber := True;

1.  do you mean on the main report?
2.  is it a formula or a condition?

Thanks for your help :)
0
 
mlmccCommented:
It is a formula that you put in the report header.

mlmcc
0
 
MariaHaltAuthor Commented:
mlmcc:  YOU ROCK!!!  It's perfect.  And it makes soooo much sense.  THANK YOU INFINITELY!!!
0
 
MariaHaltAuthor Commented:
mlmcc ROCKS!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 13
  • 9
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now