Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Widow/Orphan in G
Message
From
05/10/2001 15:55:31
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
05/10/2001 14:54:24
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00562497
Message ID:
00564979
Views:
15
>I know I just wrote a minute ago, but I wanted to clarify my question. I modi repo xxx, and then look at xxx.frx in the form of a table, to see what fields have changed. Do you know of any good references on using the report writer, not thru wizards, but actually working on the table?
>
>You wrote: In the "new page when less than" you put that variable."
>
>I don't understand when I would put this variable. Would I find record Objtype=9, Objcode=3 or 5 in that xxx.frx? Into what field would I put the variable name? The field WIDTH contains the number "Start group on new page when less than nnn.nn"

The place to define variables in the report writer is not so obvious - it's in the menu while editing a report. Define a variable nHeightNeeded, give it a zero for initial value, and calculate nothing, reset on never or end of report (haven't used this for a while so I don't remember the exact options).

In the report, doubleclick the bar separating the group header band from the band above it. You get a little dialogue where you can specify the band height, and two "run expression" textboxes, "OnEntry" and "OnExit". In the "OnEntry" put myfunc().

Write a function as a separate .prg file and in it give the calculated value to nHeightNeeded.

Just realized this won't work. There's no way to get a variable into the "start when less". Workaround: group on a variable, and have that group always start on a new page. The group expression doesn't necessarily have to be something in any of the tables, it can be any expression. Use another variable to keep a counter. In your function, calculate the space needed for the next group and add it to what you already have on the page (which will be tricky to know - you'd have to know the size of page header etc). If your calculation shows you'd go overflow to next page, increase the counter - set this "artificial" group to always begin on a new page.

I've tried some of this, and the grouping on a report variable alculated from an OnEntry function does work as expected. I assume you'll have some trouble claculating the actual heights, though. To help you, there's height in inches for each band (you can see it if you doubleclick on band's separator bar). Also, while a report object is selected, you can see its dimensions on the status bar.

Good luck.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform