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

Dynamic pipelines

edited December 2008 in General
?Hello,

We have built a component wich creates a dynamic datapipeline connected
with the SubReports. It usually works, but we have a problem in one of our
reports. I've checked the code and it seems ok. The report should have a
subreport on page 2... but it doesn't appear. But if you go to page 3 and
then go back to page 2, it works. I've checked the SQL and in both
situations the result is the same (when it works, and when it doesn't
work, there are nine results from the query). It seems to me that the
ReportBuilder is caching the sql results... I tried changing the SQL in
the BeforePrint and BeforeGenerate in the band's events, opening and
closing the pipeline... still nothing.



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited December 2008
    Hi,

    For future reference, please use your real name when posting to these
    newsgroups.

    This is most likely a timing issue. Which band event(s) are you using to
    alter the SQL code? My guess is that the SQL is being changed too late to
    have an effect during the first run though the report however if you back
    track, the data is present.

    Try moving your code to an event that fires earlier to ensure the SQL is
    changed before the subreport prints.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2008
    Hello!

    I tried altering the SQL in the BeforePrint and BeforeGenerate events.
    Neither worked.

    I'll look into it.

    Thanks,

    Andr? Taffarello





    --- posted by geoForum on http://delphi.newswhat.com
  • edited December 2008
    Hello!

    It's me again. I'm stuck... I can't find any events in the band besides
    BeforePrint and BeforeGenerate. I tried the subreport's
    BeforeOpeningPipelines event, but it didn't work either. It seems that
    only the main report has this event triggered (according to the docs).

    Any suggestions?

    Thanks in advance,

    Andr? T.




    --- posted by geoForum on http://delphi.newswhat.com
  • edited December 2008
    Hello!

    Now I'm trying a different approach. I created a master/detail
    relationship in run-time. It seems ok, and the calls to
    MasterRecordPositionChanged are coming as expected. But... nothing appears
    in my report. As soon as I set:

    report.SubReportsPipeline[0].MasterDataPipeline := report.DataPipeline;

    Nothing appears anymore. If I comment this line, the report comes like
    there is no filter in the child report.

    I tried adding the links like this:

    report.SubReportsPipeline[0].AddLink(report.DataPipeline,'NROFATURA','NROFATURA');
    report.SubReportsPipeline[0].AddLink(report.DataPipeline,'QUEBRA','QUEBRA');

    And it didn't work. Then I tried:

    lFieldLink := TppMasterFieldLink.Create(nil);

    lFieldLink.Parent := report.SubReportsPipeline[0];

    {assign the detail field name}
    lFieldLink.DetailFieldName := 'NROFATURA';

    {assign the master field name}
    lFieldLink.MasterFieldName := 'NROFATURA';

    And it didn't work either. If I create field link like this last example,
    how can I set the master data pipeline? And how can I set the detail
    pipeline to use this link I created?

    Suggestions?



    --- posted by geoForum on http://delphi.newswhat.com
  • edited December 2008
    Hi Andre,

    Take a look at the following rbWiki article on creating field links in code.

    http://www.digital-metaphors.com/rbWiki/Data_Access/Fundamentals/Define_MasterFieldLinks_in_Code

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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