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

Dynamic Tables/Fields and RB

edited November 2005 in End User

Comments

  • edited November 2005
    I missed putting in my problem...

    I have an exe that creates dynamic tables and fields when it runs. The
    number of tables, and the number of fields in them changes each time the
    program runs. At the end of the run, the tables are deleted.

    In the end user format of RB, I have added to my code to put in the dynamic
    tables and field names into the RB_fields, RB_Table, and RB_Join tables. It
    then deletes these entries when the tables are destroyed.

    My issue is the report I am creating for the system that will show the data
    from each run. One time, there might be 3 tables and 15 fields, for example.
    The next time, there might be 30 tables and 200 fields.

    Has anyone an idea on how best to tackle this report so that it runs in the
    end user format and picks up all of the data, the fields and puts them in a
    way that can be represented on the report? Thanks in advance.
  • edited November 2005



    1. Create a TdaModule for the report

    var
    lDataModule: TdaDataModule;
    begin

    lDataModule := daGetDataModule(ppReport1);

    if lDataModule = nil then
    lDataModule := TdaDataModule.CreateForReport(ppReport1);


    2. Create one or more query dataviews

    lDataView := TdaBDEQueryDataView.Create(aDataModule);
    lDataView.Name := 'Customers';
    lDataView.Parent := aDataModule; // add to datamodule
    lDataView.Init;

    lSQLBuilder := TdaSQLBuilder.Create(lDataView.SQL);
    {use sql builder methods to specify query table and fields}

    lSQLBuilder.Free; // destroy SQLBuilder when done


    3. Create the report layout

    See the CodeBased thread of the Tech Tips newsgroups. If you have many
    query's then create a main report with no header and footer. Then create a
    section style subreport and connect to each query.







    Best regards,

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