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

Save custom pipeline with template in code

edited February 2007 in General
Hello all,

We are trying to create a custom wizard interface in our product that will
allow us to lauch the designer with the created pipeline and allow the user
to save the template as a blob field in the database.

This works fine as long as the pipeline remains created on the form. If the
application is closed and reopened, the template will be blank when it is
launched from the Report Explorer.

Is there a way to save a custom pipeline built in code with the template? I
think the approach the will take is an SQL query that is built from user
selections. We want to open a template in the designer with this pipeline
and allow the user to save it as a blob. The user should then be able to
print the template from the Explorer without rebuilding the query every
time.

Thank you for you time,

Andy Roberts

Comments

  • edited February 2007

    - Check out the custom dataview examples, RBuilder\Demos\EndUser\Custom
    DataViews. Run the example, access the Data tab and select File | New...
    The dialog contains a Templates tab that contains custom dataviews. Custom
    DataViews can contain multiple datapipelines and you can link either the
    datapipeline or datasets.

    - Also check out the DADE thread of the Tech Tips newsgroups for an overview
    of the DADE architecture. The architecture is open to create custom dataview
    classes and the custom dataview classes can have assoicated custom data
    designers.

    - With the external pipeline approach you are using now, the only way to get
    it to work, is to create the data components (with the same Owner as the
    Report) prior to loading the report template.



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited February 2007
    Thank you for your reply,

    Our goal is to present the user with a controlled "view" of the data within
    our database and to open the designer with the data they have selected. Is
    our approach of building a custom pipline the correct approach? Are one of
    the options you have suggested below the correct approach?

    Andy Roberts


  • edited February 2007

    Run the RBuilder\Demos\EndUser\Custom DataViews example. Custom DataViews
    accomplish exactly what you are describing. The are pre-defined templates
    containing one or more pipelines.

    The next step up from Custom DataViews, is to give the end-users access to
    the Query tools but limit what they can do, but using the DataDictionary
    component to limit the tables and fields that are available, to predefine
    join/linking relationships, and provide user friendly table and field
    aliases.

    You can also use your database back end to defined Views that appear to the
    users as tables.

    Lots of options...



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited February 2007
    Thank you very much for you r reply.

    I have been looking at the example, but it appears as if these are
    predefined data "templates", or again the user has acces to the report
    builder data builder.


    We want to create a custom sql statement at runtime and launch the report
    designer with this statement supplying the data for the report. The user
    should then be able to create a report and save it as a template as a blob
    field in our Advantage database. When the user returns and launches the
    report from report explorer, we should not need to recreate the sql
    statement again, I think that this should be saved with the template.

    I think that this is possible using the TdaSQLBuilder class, but I have been
    unable to find a good code example.

    When I try the code below, I get an access violation on the first line.

    aSql := TdaSQLBuilder.Create( ppReport1.DataPipeline.SQL );
    aSql.Clear;
    aSql.SelectFields.Add( 'aTable', 'DatePosted' );
    aSql.SelectFields.Add( 'aTable', 'Category' );
    aSql.SelectFields.Add( 'aTable', 'SubCategory' );


    If I try this:

    aSql := TdaSQLBuilder.Create( ppReport1 );

    I get a message stating the aReport has no pipeline.

    Is what we are attempling possible?

    Thank you


  • edited February 2007

    Here is an example of creating a TdaDataModule and two linked QueryDataViews
    in code...

    www.digital-metaphors.com/tips/CreateDataModCustOrderLinkedDataViews.zip

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.