Using detail band data in subreport AutoSearch
Greeings all,
I am using Delphi 7, RB 7.04 Enterprise, with an end-user database
setup.
I am creating a comma-separated list of accounts and usercodes by
iterating thru the dataset in the detail band of my main report. I would
now like to use these 2 lists as AutoSearch InLists for 2 subreports in my
main report summary section. I am freeing my AutoSearch conditions in the
BeforeAutoSearchDialogCreate event so that the end user will not see them,
and then re-creating them in the OnAutoSearchDialogClose. My problem is
that the lists do not contain any data on the first printing of the report.
If I reopen the search dialog and then close, I get the data that I want,
because the report has had the chance to create the lists.
My question is, how do I assign the AutoSearch fields to the subreports so
that they get populated with the data that is generated in the detail band
on the first pass?
Please note that due to data sorting issues, along with other schema related
issues, I cannot link the primary dataset to the subreport datasets.
Thanks much, my head and my desk appreciate it.
Bob Nicksic
I am using Delphi 7, RB 7.04 Enterprise, with an end-user database
setup.
I am creating a comma-separated list of accounts and usercodes by
iterating thru the dataset in the detail band of my main report. I would
now like to use these 2 lists as AutoSearch InLists for 2 subreports in my
main report summary section. I am freeing my AutoSearch conditions in the
BeforeAutoSearchDialogCreate event so that the end user will not see them,
and then re-creating them in the OnAutoSearchDialogClose. My problem is
that the lists do not contain any data on the first printing of the report.
If I reopen the search dialog and then close, I get the data that I want,
because the report has had the chance to create the lists.
My question is, how do I assign the AutoSearch fields to the subreports so
that they get populated with the data that is generated in the detail band
on the first pass?
Please note that due to data sorting issues, along with other schema related
issues, I cannot link the primary dataset to the subreport datasets.
Thanks much, my head and my desk appreciate it.
Bob Nicksic
This discussion has been closed.
Comments
The autosearch has to be performed before the report generates. I think you
need to populate the InList by either performing a query before the report
starts or iterating over the data and building the list manually.
Once the report starts to generate, the report engine opens all of the
datasets used by the main report and subreports.
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Is there a way to iterate thru a dataset before generating the report? I
need to be able to do this entirely within an end user database setup.
Thanks,
Bob Nicksic
You could try using the RAP Global OnCreate event. RAP by default does not
support the DataPipeline methods such as First, Next, etc. So you would need
to extend RAP (see article below)
--------------------------------------------------
Article: Extending RAP
---------------------------------------------------
There are two very simple and powerful techniques to extend the capabilities
of RAP infinitely. These are summarized below and covered in more detail in
the RAP.hlp online help. Demos and tutorials are installed to
RBuilder\Demos\RAP. The tutorial text is located in RAP.hlp.
1. RAP Pass-Through Functions
These are functions that appear in the Language tab of RAP's Code Toolbox.
These functions are written in Delphi and can be called from RAP. RAP's
pass-through function architecture enable's developers to add new built-in
functions to RAP's code toolbox.
2. Extend RAP's RTTI
RAP's Run-time Type information defines what classes and properties can be
accessed via RAP. By default the published properties of any class that is
registered with Delphi's RegisterClass procedure is recognized by RAP. In
addition many of the public properties and methods of ReportBuilder classes
are exposed.
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
While digging thru the newsgroups I discovered that I can use subselect
statements with an InList AutoSearch Field. I was able to use a user
supplied AutoSearch value in my subselect, adding to my dataviews upon close
of the AutoSearchDialog. Works perfectly.
Thanks again for all your help.
Bob Nicksic