Home End User

how to load the criteria

edited September 2002 in End User
how to bring out the criteria section before I load the report template from
the database ( interbase) ? i need to have a senario that each report shown
in the list view and when the user select one of the report , i would enable
the user to make futher criteria condition. Is there any way to make
criteria section into my own customise form and i could pass the sql
statement to the report template before i view the report ?

Comments

  • edited September 2002
    Yes, you can load the template and then extract the SQL object. Here is a
    demo which extracts the SQL object and then creates search criteria on it on
    the fly: This demo is in RB 7 format for Delphi 6.

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


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited September 2002

    is that anyway to extract more than one sql object on a report as i might
    have subreport plus another defined query , that together have one
    master-detail and independent query in a single report . how could i set the
    criteria for the master-detail and another independent query for a report ?
    i try on the example on ExtractSQLObject , it seems only extract one object
    ....

    TIA


  • edited September 2002
    The TdaDatamodule has a Dataviews array property. Use this to loop through
    all of the dataviews in this report. You can search by name as shown below
    in order to get the SQL object for a particular dataview by name. I put a
    showmessage call to show the name:

    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    var
    lDataModule: TdaDataModule;
    liIndex: Integer;
    lDataView: TdaQueryDataview;
    lDataPipeline: TppDBPipeline;
    lSQL: TdaSQL;
    begin

    {get the datamodule}
    lDataModule := daGetDataModule(ppReport1);

    if (lDataModule <> nil) then
    begin

    for liIndex := 0 to lDataModule.DataViewCount - 1 do
    begin
    lDataView := TdaQueryDataView(lDataModule.DataViews[liIndex]);

    if (lDataView <> nil) and (lDataView is TdaQueryDataView) then
    begin
    {only custom dataviews can have multiple data pipelines}
    lDataPipeline := TppDBPipeline(lDataView.DataPipelines[0]);

    ShowMessage(lDataPipeline.Name);

    lSQL := lDataview.SQL;
    end;

    end;

    end;

    end;


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.