JIT DataPipeline Assignment for Multiple SubReports
I essentially want to dynamically print N reports together on a single
page, where N is a user defined parameter.
At designtime, I create a template, and store it into a database. Then
I load the template into a dynamically created subreport parented by a
main report with a Dynamically created parent report. All reports use
the same JIT Pipeline, but each report has the index value into a Tlist
that is referenced by the GetFieldValue() method.
I have not been able to figure out how to assign the datapipeline
created at run-time to all TppDBText objects. If I assign it to the
report, it does not ripple through to the DBText objects. All
Datapipeline properties are Nil, but the DataPipeline name shows the
pipeline connected at Design-time. Is there an easy way to do this?
Is there a better way to construct a single page report from multiple
templates? Should I be chaining RAFs together instead?
page, where N is a user defined parameter.
At designtime, I create a template, and store it into a database. Then
I load the template into a dynamically created subreport parented by a
main report with a Dynamically created parent report. All reports use
the same JIT Pipeline, but each report has the index value into a Tlist
that is referenced by the GetFieldValue() method.
I have not been able to figure out how to assign the datapipeline
created at run-time to all TppDBText objects. If I assign it to the
report, it does not ripple through to the DBText objects. All
Datapipeline properties are Nil, but the DataPipeline name shows the
pipeline connected at Design-time. Is there an easy way to do this?
Is there a better way to construct a single page report from multiple
templates? Should I be chaining RAFs together instead?
This discussion has been closed.
Comments
- the report.DataPipeline property is used for datapipeline traversal
- the data-aware components have properties for DataPipeline, DataField, and
ParentDataPipeline. When ParentDataPipeline is set to True, then updating
Report.DataPipeline will ripple thru to Component.DataPipeline (provided the
started off with the same value before the change). See ppClass.pas, the
method TppCustomReport.UpdateParentDataPipeline.
- you can also programmatically loop thru the Report.Bands[].Objects[]
structure and assign DataPipeline and DataField properties. Again, see
ppClass.pas, the method TppCustomReport.UpdateParentDataPipeline
- This approach sounds valid.Your question seems to be more about
dynamically assigning JITPipelines to reports than how to create the report
layout. Or perhaps I do not understand the question/configuration
completely.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
- please do not post attachments to the newsgroups. It is against newsgroup
guildelines
- what I notice about the call stack is that there is a class called
TPrintJobThread. Is this a custom class that you are using to printing the
report in a thread? What type of solution are you tring to build with
threads?
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
My apologies for posting an attachment, but it was the easiest way to
show you what was going on, since I could not easily convert it to text,
I decided just to keep the image as small as possible.
I have implemented a thread pool as part of my middle tier. Each thread
collects the data necessary to render the report server side and send an
RAF consisting of 1..4 reports, to the client for printing.
This issues I am currently experiencing are:
1) get AV when attempting to save the report dynamically built to a
Template.
2) I cannot get the second subreport showing in the detail section below
the first one. The area is completely blank.
3) The JIT Pipeline appears to be called more often than necessary for
field values.
- for future reference, attachments can be sent to
support@digital-metaphors.com
- I recommend first implementing and testing the reports in a standard
(non-threaded) environment
- You might want to first get the report working, by designing it with the
report designer and then as a second step, write code to dynamically create
the same layout
- to print one subreport below another, make sure the second supreport is
set to ShiftRelativeTo the first
- there is no limit to how many times JITPipeline.GetFieldValue can be
called. Your implementation of that method needs to be very simple and
fast - typically you would pull a value from an array or an object property,
etc. The GetFieldValue method is called whenever a class in RB needs to
check a field value. (Its no different than when you use a DataSet and
reference a DataField value from multiple areas of your application).
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
You know what would be really cool?
If you could create a report in the designer, and be able to save the
report as generated Delphi code. It would be a great learning tool, but
it would also make producing a report programmatically so much easier :>)
BTW, my report is now working fine in a thread. I just experimented,
turning off Outlining and all the other unnecessary features and then
controlling the position of the subreports using Top,Left.
I still get an AV if I try to save the report to a template. It's
bizarre that you can create a report that cannot be saved successfully.
Is there a document besides the on-line help that explains the RB object
model, with lots of code examples?
I suspect I will be finished this implementation project in the next
week. Is there any news about enabling Report Parameter editing the the
End User Designer?
That would be very cool ineed. For now you save the report to .rtm file in
ASCII format and then open it in the Delphi editor or Notepad. That might be
helpful...though not exactly what you describe.
There are lots of parts of the Delphi VCL that are not thread safe. And I
think I recall that the VCL streaming system (which RB uses) is not
thread-safe.
There is some information in the Tech Tip articles and the Developers Guide
about creating code based reports. And I can try to help with any additional
questions...
RB 10.03 is now available and it includes support for editing the
Report.Parameters via the object inspector
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thanks Nard. I will get the download information from my client and
download 10.3 ASAP.
As for the VCL Streaming, I always wondering myself if that code was
threadsafe, but was never able to determine exactly what parts of the
VCL were threadsafe...