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

Can anyone tell me....

edited February 2003 in General
Can anyone tell me why when I run the following code in the
ValidateComponent method of the report designer


TppSubReport(Component).DataPipeline:=TDReportDescriptor(Desc).Pipeline

I get an exception that says 'Cannot Assign a TADODataset to a TStringList'.
This behaviour is intermittent, but happens often enough to be a real pain,
I can replicate just about everytime i run if i run the operation enough.

BTW The operation I am performing is that I am adding a a sub report to a
report and then setting up the data sources dynamically and then linking the
data sources to the subreports.

--
Regards

Conrad Rowlands
Callards Technology Ltd

Comments

  • edited February 2003
    What is Component.ClassName and Desc.Classname (or ClassType) in this line
    of code during execution? It really sounds like a bad typecast is occurring
    because there shouldn't be a TADODataset as a pipeline property value.

    What is TDReportDescriptor? A TppReport descendent? What does it do in
    regards to persistance and datapipelines? Most likely, what is happening is
    that we stream down a string property for the data pipeline name. RB builds
    a list of these when it streams up from the template on its way to building
    the object. This is to support Delphi 6 and 7's object tree view. We don't
    make the form show all of the objects in the object tree view for the
    internal DADE objects. Part of this resulted in the fact that we had to
    change how our data pipeline references are connected. When the report is
    streamed up, it builds a list of all the available pipelines in the forms
    and datamodules and compare the datapipeline name it has streamed down for
    the report to the datapipeline object's names. When it finds a match it
    connects the datapipeline reference property. It sounds as if your
    descendent is doing something to change how this works?

    If you want to add a subreport to a report then here is an example:
    http://www.digital-metaphors.com/tips/DynamicSubReportCreation.zip

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.