Completely build report manually?
I'm trying to find out if there is a way to COMPLETELY build the report manually from the ground up. For instance, I want to do this in Delphi code (not script):
while something do
begin
newpage 1
//fill out page manually
if toobig then newpage1
end;
In other words, I want to control the page creation instead of band creation. I then need to have a handle to the page to assign all the fields manually. There are too many fields to do this with a dataset and I don't know how many pages the report is going to be until I'm creating it... I've looked at OnManualBuild but it fires after the page has been created... Any ideas? Thank in advance!
Ryan
while something do
begin
newpage 1
//fill out page manually
if toobig then newpage1
end;
In other words, I want to control the page creation instead of band creation. I then need to have a handle to the page to assign all the fields manually. There are too many fields to do this with a dataset and I don't know how many pages the report is going to be until I'm creating it... I've looked at OnManualBuild but it fires after the page has been created... Any ideas? Thank in advance!
Ryan
Comments
the report engine then process the design page and creates the output pages as needed.
a design page is not limited to the height of the physical outputpage, you can set it to larger by setting the page options property large height in design mode.
The on manual build event allows you to control how the output of the design is formed.
Read the programmers manual chapter on creating a report from code, remembering that this is how to create a design page.
Basicly we have a design page with a number of memoviews located on the page at specified positions that contain certain values, theses can be datafields or variables or static text.
based on some criteria(the need to fill the same memoviews with other values).
You could add design page(s) as needed and duplicate the layout of design page1 by selecting all the objects,
then copy and paste them into designpage2 and design page3 etc.
you can make decisions at the delphi level when the report is loaded as to which design pages will be visible, and use the page obpevent to iterate through the pages objects and set their contents.
anoher way
Place a masterdata band around all the objects on the page the bands height will be
the height of the page - 1or 2 pixels. this databand does not connect to a datasource but has a rowcount propertt which alue will be set equal to the number of pages required, this value can be passed in from delphi in the normal fashion.
now you can write code for the obp event of the memo objects to change their contents.
ie if <page> = 2 then
begin
memo1.text := what ever:
end;
another method is to use categorized variables with no expression in the memo
this triggers the ongetvalue event of the tfrxreport component where you can put whatever data you want into the variable just retrive the value of the line# Variable it will be = to the page number
the possibilities are many, much will depend upon where your datavalues come from, and how you determine the no of pages reqd.
i need more info to be more specific.