TppLabel.Create
Hy Newsgroup...
I have a littel Problem creating different Objects at Runtime...
When i create 200 ppLabels - the first Page is fine
The second Page shows just on the bottom some labels ( THAT`S MY QUESTION
1)
the rest of the Pages are fine..
QUESTION 2:
Is it possilble to create 200 bands with fix different height ?
i want to print my panels with conduit like www.wavi.at/myPanels.jpg
and the panels should not be cropped by a page-break
Any suggestions? (or a small piece of code ;-) )
ThanX
Erich Wanker
Using:
Reportbuilder 9.01
WinXP
Delphi 7
procedure TForm1.SpeedButton1Click(Sender: TObject);
var my_label :Tpplabel;
x :Integer;
begin
for x:= 0 to 200 do
begin
my_Label:=TppLabel.Create(ppreport1);
my_label.Name:='dynLab'+inttostr(x);
my_Label.Band:= ppreport1.Detail;
my_Label.spTop:=20*x;
my_label.spLeft:=100;
my_Label.Caption:='Dynamisches TppLabel with number: '+inttostr(x);
end;
ppreport1.Print;
end;
In Reportbuilder: Detail is set toDynamicHeight
This discussion has been closed.
Comments
1. Where are you creating the 200 labels? Which band? Is there enough
space on the page to display these labels? Perhaps a little more
information on how you would like your report to look will help.
2. What ultimately are you trying to accomplish? Generally a report is
connected to a dataset which creates a new detail band for each record in
that dataset. You can alter the height of each detail band before it prints
if you would like.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I think you didn?t see the delphi code in the first mail...
200 Labels for testing in ppreport1.Detail / via Speedbutton.onClick /Form1
the Detail has a dynamic Height.. the code works - but makes at Page 2 a
comical thing..
please see: http://www.wavi.at/digital-metaphors/ (page1.jpg 2 and 3)
I made a new picture...
http://www.wavi.at:80/myPanels.jpg
i want to reproduce my screen in reportbuilder..
the "normal" way (i think) doesnt work (connecting to a Pipeline and
printing the stuff)
I try to explane: ;-)
**************
I have one Overview_DB:
While not Overview_DB EOF do
begin
read the value of Field "type" and Field "level" and create a panel with
it?s components ..
next record
end;
If a Panel will created:
******************
if Field "type" is "Working time" - when create a panel and fill the created
"Tedit field" with values of Table Time Where record_nr = Overview_nr
( Field "type" can be: Time, worker, toDo, material, Time, Date ... and so
on ...
Field "level" can be: 1, 2 or 3)
I don?t know how to realise this with Band?s or Subreports .. so i thought,
i creat every object at runtime for the Report ... and place it like i
want..
i hope , you can understand what i mean (and my poor english ..)
best regards
Erich
there's probably a better way to approach this--I just don't know enough
about what you are trying to do.
If you know the number of levels of indents, and the various display types
each indent should have, I would consider using one band with a number of
TppRegions on it--and setting the visiblity of each region based on the type
that is to be displayed.
For example, I have a report a bit different, but similar needs. I set the
visiblity of various regions based on the type of data that needs to be
displayed (notation, 2 columns, 4 columns, header, etc). A field in the
datapipeline (a TppJITPipeline setup to make this very fast) and RAP code
determine which region is visible:
Here's a screen shot of my report:
www.TBInc.com/misc/ReportVariousRegions.png
Ed Dressel
Team DM
Sorry, I didn't see the code you posted.
Looking at your code, it seems that you are adding more labels to the detail
band that will fit on a single page. This is most likely what is causing
the problem. A band cannot have a static height larger than a page. One
option would be to create a single stretchable Memo object and add the text
to it. This would allow the memo to overflow to the next page if it runs
out of space. Another would be to only add the amount of labels that will
fit on a single page then manually break to a new page using the PageBreak
component and continue.
For your second question, it looks as though you are trying to create a tree
structure inside the report. ReportBuilder does not natively inlcude a tree
component however we have had customers successfully create reports with
tree structures. There is also a third party component available that may
help named TreeView.
http://www.digital-metaphors.com/download/report_component_library.html
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com