Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

PrinttoDevices & Subreport

edited June 2004 in General
Hello All:

For dot-matrix printing, I use your PrintToDevices method, then pull out
the text & positions of each report component. To do this I use the Top &
left properties of the TppDBText components.

ALL OF these reports are one page reports - so everything is fairly
simple.

Top & Left represent the EXACT position of the TppDBText in the detail
band and in the report ( as long as there are no subreports ).

I have added a subreport into one of the reports. The subreport data is
in the report, but the Left & Top properties reflect its position in the
subreport band itself.

I have the following questions:

1) How can I determine where the subreport components absolute left &
absolute top positions are within the report ???

2) Can the subreport be made to occupy a fixed area within the detail
band ( say truncate any extra lines that dont fit into the report ???

3) Will the existence of the subreport cause the left & top properties
of the components below the subreport to reflect a relative position ??? Or,
will the function of the components position value be unaffected by the
subreport ???




I am trying to access each report component by looping through the form
(that owns the ppreport ) and identifying any TppDBText component.

How do I access the subreport components ??? My guess is that the
subreport components are owned by the subreport and that the subreport is
owned by the form . Is this correct ???

Given my code below, would I need to loop on the subreport component to
extract each TppDBText component within the subreport ???

Any help would be appreciated. Thank you.


Neil Huhta




ppReport2.PassSetting:= psTwoPass;
//memo1.lines.add('pass setting set psTwoPass');
lDevice := TppDevice.Create(fmReport);
lDevice.PageSetting := psLastPage; // See ppTypes

lDevice.Publisher := ppReport2.Publisher;
ppReport2.CachePages := True;
ppReport2.PrintToDevices;

For I:=0 To (fmReport.ComponentCount-1) do
begin
If fmReport.Components[I] is TppDBText Then
BuildReportNXDBText(I)
end;

Comments

  • edited June 2004
    Hi Neil,

    1. See my answer to your earlier post for the method to do this.

    2. You can change the Subreport to a Fixed Style Subreport. Then as long
    as you have the Subreport.TraverseAllData set to False, your data will
    truncate where the subreport cuts off. You will need to size the subreport
    component manually if you use a fixed subreport.

    3. Using a fixed subreport, you get more or less a WYSIWYG effect, so the
    left and top positions of other components will not be affected.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2004
    Nico:

    Thank you for replying. I still don't understand how to get the absolute
    position of the components within the subreport - will looping through the
    components of the subreport yield this ???

    If so - then I assume that the left & top positions will be relative to
    the top position of the band itself.


    Thank you.


    Neil Huhta
  • edited June 2004
    Hi Neil,


    This is correct. The "absolute" position of each report component is not
    calculated until the report is generated. The main reason for this is that
    most reports contain dynamically placed components. If you are creating a
    statically sized report, it should be easier to calculate the page position
    of a given object before the report generates based on the band position.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.