Dynamically Loaded Header
I have a dynamically loaded header TMyHeader derived from TppSubReport, just
like in the demo application '5. Dynamic Subreport Loading'. The only
difference is that on this header I use DADE connected to a TppDBText to
retrieve the text from a table with just one record in it.
When I add this header to a report and try to preview it, I get the error :
'Data source name not found and no default driver specified'.
Anyone an idea what am I missing ?
Thanks,
Samuel
like in the demo application '5. Dynamic Subreport Loading'. The only
difference is that on this header I use DADE connected to a TppDBText to
retrieve the text from a table with just one record in it.
When I add this header to a report and try to preview it, I get the error :
'Data source name not found and no default driver specified'.
Anyone an idea what am I missing ?
Thanks,
Samuel
This discussion has been closed.
Comments
TdaQueryDataView(Report.DataPipeline.DataView).Active := False;
TdaQueryDataView(Report.DataPipeline.DataView).Active := True;
BUT, every time I open the report in the designer and preview it, the
DataPipeline of the header is added to the main report, so after 5 edits I
have 6 DataPipelines on the report, 5 of which are all duplicates of the one
on the header sub report.
Any suggestions of how to get rid of them afterwards, maybe in the
EndOfMainReport ?
Thanks,
Samuel.
dataviews into the main report when you load a template.
What you can do is delete the dataviews from the templates that you are
going to load as subreports. Leverage the fact that hte controls in the
subreport will connect to the dataview that the subreport is assigned to
when you load the template to the main report.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
header template into. That beats half of the purpose of having a reusable
header. Surely, there must be a better way.
Samuel.
dataview needed by the header subreport to the main report. Delete the
dataview from the header template. After loading the template, assign the
data pipeline from the 'header' dataview to the subreport. If
ParentDataPipeline is set to True on all of the DBText components, that's
all you'll need to do. Otherwise, loop through the subreport and reattach
the DBText components to the data pipeline.
The data module is slightly different from the code module or report module
objects (which are nested one-to-one based on the subreport structure.) The
data module was designed to function as a 'global' container for all
dataviews. This seems to make the most sense, given the linked dataviews
that many developers need. The side effect in this instance is that
dataviews 'collect' in the data module as you load templates over and
over...
Cheers,
Tom Ollar
Digital Metaphors Corporation
http://www.digital-metaphors.com
info@digital-metaphors.com