cancel
Showing results for 
Search instead for 
Did you mean: 

Display message when a field falls to next page...

Former Member
0 Kudos
115

Post Author: hunpirate

CA Forum: Formula

Hi,

One of hour reports is several pages long. The first part of the report sometimes fits on the first page, but because its dynamic content, it sometimes falls into a second page.

Is there a way to tell witch page a field value was rendered on so I can optionally display a warning textbox telling users that the first page was 2 pages long?

Thanks

Accepted Solutions (0)

Answers (9)

Answers (9)

Former Member
0 Kudos

Post Author: V361

CA Forum: Formula

CR should support Visual Basic, in its formulas, maybe that will help.

Former Member
0 Kudos

Post Author: hunpirate

CA Forum: Formula

Hi,

In theory I could figure it out how many pages should the whole document have at the end, but I thought maybe there is a slicker (simpler) way to track which page a particular object (let's say a hidden textbox, I call a marker) of the report was rendered on.

I'm not new to programming, in fact I wrote the web program that assembles this report, but I have my shortcomings on Crystal. Most of the time, I use the built-in VB syntax just to avoid the learning curve of the Crystal one.In short, I just donu2019t know what the Crystal capabilities are in this case.

Former Member
0 Kudos

Post Author: V361

CA Forum: Formula

It does sound interesting, could you have a shared variable, keep track of the page count, then based on that shared variable's page count trigger the message.

Former Member
0 Kudos

Post Author: hunpirate

CA Forum: Formula

Hi,

I do appreciate all your efforts to help me. Unfortunately there are more then one fields value that can cause the first page to blow over to the next page, some of those values are built through sub-reports inserted into the report in runtime.

I could send you the set of reports that assembles the whole output if you interested.

Former Member
0 Kudos

Post Author: V361

CA Forum: Formula

OH, then use length ( ), you can drop that into the report, and tell at what length, the string falls over to the second page. if length ( ) > 100 "Page Two" else " "

Former Member
0 Kudos

Post Author: hunpirate

CA Forum: Formula

Hi,

I always have only one record. The data lookup returns only one flat record with all the fields that I use on the first page. Some of the text amount of the field values make the page extend sometimes to the next page.

Former Member
0 Kudos

Post Author: V361

CA Forum: Formula

You should be able to use record number, only X number of records will fit on page one, once you figure what that number is, you could add this formula, it will not print anything unless your record number is greater than 15 and your page number is greater than 1

if recordnumber > 15 and pagenumber > 1 then "Continued on Page 2" else ""

Former Member
0 Kudos

Post Author: hunpirate

CA Forum: Formula

Hi,

Thanks for helping me out.

Unfortunatelly these solutions will not work for me. Maybe I wasn't clear explaining.

The report I have is more a form letter than a repeating detail section. The first page of the report usually fits on one page, somtimes falls over the next page and then other random number of pages follow (inserted programaticaly as subreports). I never know how many pages will be created all together.

I'd like to create a page footer text field with warning that would only show on page 1 if a marker object (label or text) created on the bottom of the firts page falls to the 2 page.

Is that possible?

Former Member
0 Kudos

Post Author: V361

CA Forum: Formula

Add a shared varible to track the page number, then based on that number you can display your message box. or here is another option, stolen from another post, you can force, x number of lines per page as below.

Assuming that you have your report setup in such a way as to go to the next page when the record count is greater than 15, here is a way to 'draw' lines so that there are always 15 on a page.

1. Create a sub-report with lines drawn such that if the subreport were displayed then the lines would match with those of the main report.

2. In the subreport, suppress all sections except the detail.

3. Create a formula with:

whileprintingrecords;

shared numbervar rc;

if rc <= 15 then

replicatestring('_______________' & chrw(13) & chrw(13),(15 - rc));

where rc is your recordcount based upon which you go to next page. The string within the 'replicatestring' will be the lines you want to draw to make up the 15 rows.

4. Place the subreport in a separate details section and suppress it based on conditions such that it is only displayed if there are less than 15 records displayed per page.