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

Is it possible to tell you are on the last line of a page?

Status
Not open for further replies.

uczmeg

MIS
Mar 7, 2001
61
GB
Hi,

Using Crystal 8.5

I have a problem with invoice item line data that I need help solving.

Some item lines in the data are flagged as headers and need to be shown differently to other item lines.

No problems there (I just check for code = HEADER and suppress the standard line and show a different line instead). The problems begin as a header cannot appear as the last line before the page break as the next item line is associated with it.

Is there any way to detect I'm on the last line and then say if it is a header break before printing it?

Page breaking on every header line is not an option.

Limiting the item lines to a fix amount so I know if I'm at the end of a page doesn't work either as item lines have variable length descriptions that can be many lines.

Cheers
Marc
 
If you don't know which line is the last, as with counting them, then there isn't a way.

Having variable length descriptions shouldn't prevent you from estimating this though, you can use the LEN() funciton against the field, or if it's over 254 chars, use a SQL Expression to learn the length and do page breaking based on a conservative estimate.

But Crystal does not have a thisisthelastlineofthispage function.

-k
 

The approximation could be difficult as it isn't a fixed width field.

I just noticed you can specify the number of lines a field can grow to. So is there a way to interrogate how many lines a field is?
 
Not that I'm aware of, but as I stated, you should be able to do a reasonable estimate using the LEN() function

-k
 
The approximation could be difficult as it isn't a fixed width field."

Sorry that should have said fixed width font.

I'll run some tests, but I'm guessing the approximation might not be good enough. A lot of the text is long and these invoices have lots of lines.

Still it looks like it may be the only way so might have to do....
 
I've done it before.

Keep in mind that with CR8.5 a formula can only work against 254 char fields or below, so you might need a SQL Expression.

-k
 
What is the header a header of? If it is a group header, then right-click on it and choose Change Group. This lets you choose Keep Group Together and also Repeat Group Header On Each Page.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
The header is just an item line. Just has a different product code that we treat differently when displayed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top