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

Report Header Problem

Status
Not open for further replies.

ersarg

Programmer
Feb 7, 2006
8
0
0
US
PB 10.0 Have a report that prints everything about a specific project (there are multiple projects), a portion of the header I only want print on the first page. I tried grouping by project and putting that part of the header in the group header, it still prints every page. I tried putting code behind the "Visible" to make it visible only if PAGE() = 1, that works but the space those lines occupied is still there and there is no way that I see to put code behind the group height.
 
Are you worried about the printing, or displaying it on the screen?
 
If you're just wanting it to print out correctly, then why can't you use two separate DataWindows, and print the header information on a page, then each set of details?
 
Hi,
in script, you can modify the height of bands this way:

<DW Control Name>.Object.DataWindow.Header.Height='0'
<DW Control Name>.Object.DataWindow.Header.group1.Height='0'
<DW Control Name>.Object.DataWindow.Detail.Height='0'
<DW Control Name>.Object.DataWindow.Trailer.group1.Height='0'
or
<DW Control Name>.Object.DataWindow.Footer.Height='0'

I can't remember if there is a space between "group" and its number, but this should allow you to keep only the bands you want before you submit your print().


:)
David
 
That method will shut down the header for all pages. Want it to print once one the first page and the group header to only print on the page that they first occur on. I found this reference in the books online
It would appear to do exactly what I want, but when I try I get Error access external object property suppress....

The line of code is:
dw_1.Object.DataWindow.header.group1.suppress = true
Ii says syntax error at position 34 (the U of group) I also tried:
dw_1.Object.DataWindow.header.projectname.suppress = true
Projectname is the column the group is based on.
 
Hi again,
I guess the suppress option is new in 10.5 because I have not seen it in PB 10.0's help.

I have a solution for you to try though... it is not perfect but you may find it works for you:

with a boolean instance variable ib_FirstOnly

in your ue_print event:

Long ll_job

ll_Job = Printopen()

ib_FirstOnly= True
// set group header to show on first page
dw_1.Object.datawindow.header.group1.height = '300'
Printdatawindow(ll_Job, dw_1)

ib_FirstOnly= False
// set group header to 0 to hide for the other pages.
dw_1.Object.datawindow.header.height = '0'
Printdatawindow(ll_Job, dw_1)

Printclose(ll_Job)

...
This is a little more complex than a print() command but if you put this code in the printpage event of dw_1 then voila


If ib_FirstOnly Then
If pagenumber = 1 then
Return 0
Else
Return 1
End if
Else
If pagenumber > 1 then
Return 0
Else
Return 1
End if
End if


NOTE that depending on your detail height, this may print the same record on the bottom of page 1 and the top of page 2.

Try it and let us know!


:)
David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top