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

How to change Pipeline at runtime

edited November 2002 in Datapipelines
Hello,

I have created somes reports (>50)

I write an unique function to load and print reports :
Print_Report(sp_REPORT_FILE_NAME, sp_QUERY : String)

I have just one problem : I need to change the Pipeline at runtime.

In my print unit, I have one TQuery, one tDataSource, one tDBPipeline and
one TPPReport.


1?) TQuery is modified at runtime. (with sp_QUERY paramater).

2?) I load a report file (RTM). (with sp_REPORT_FILE_NAME paramater).

3?) I want to exchange the master table of my report with my tDBPipeline.

My first question : Is it possible ?

if "yes", how to do that ?

Thanks

Comments

  • edited November 2002
    The problem is going to be that once you change the dataset, you need to
    make sure that AutocreateFields is set to true on the datapipeline so that
    it creates the correct TppField objects for each field in the dataset. The
    reason for doing this is to connect the data aware control in the report to
    the datapipeline. If you change the field names, the components won't hook
    themselves up automatically to the new field names. You'll have to do this
    in code in a Report Object Loop as shown in the tech tips newsgroup in the
    Code Based thread.

    You need to be sure that the ParentDataPipeline property is set to true on
    the report components so that when you assign the datapipeline to the report
    the report controls are assigned to the same pipeline. Once the pipeline is
    reconnected, their needs to be a match for the datafield. This means that
    the datafield that the dataaware components was connected to when you
    created the report template, needs to match the datafield coming through the
    pipeline when you load and print it with your new code.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited November 2002
    ???? I don't think you understand my first question.

    It is so hard ?

    I just want to do something like this : Pipeline ( DataView[0] of my
    Report1) = MyCommonPipeline

    I do not want to assign the MasterView or something else.

    I just want to change the pipeline origine of my first DataView. That's all.

    My MyCommonPipeline VCL is attached to a CommonDataSource itself linking to
    CommonQuery.

    My CommonQuery contains the exactly same SQL verb as the DataView[0] SQL
    clause. And I add a just WHERE clause to this CommonQuery.

    In fact, I 'm looking for a good solution to use a SQL WHERE clause without
    using your criterias...

    Converting a WHERE clause into ReportBuilder's criterias is very too hard !

    I'm looking for old similary questions in this forum. In 10. 2001, someone
    ask the same question.
    Each time, your talk about Criteria. In this old post, You answered : "It
    will be added to futur version". In october 2001, it was verion 5.
    Now, in version 7, it's the same problem.

    I hope version 7.1 will support a dynamic SQL change without the obligation
    to use criteria.

    In France, there is lot of Delphi developpers that are talking about
    ReportBuilder.
    We are very interested by this product. The only (and aslo too big) problem
    is that ReportBuilder does not support dynamic SQL change at runtime.

    Please, make some effort ;-)))





  • edited November 2002
    You can edit the SQL text in DADE or via code. RB doesn't have the
    capability to link or use the query tools full functionality once you edit
    the SQL text. This is the way you need to use RB if you don't want to code
    using our interface. Extract the TdaSQL object from the dataview and set
    the EditSQLasText and SQLText properties.

    http://www.digital-metaphors.com/tips/ExtractSQLObject.zip


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.