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

beginners question

edited August 2008 in Datapipelines
Not sure if i am posting this in the correct group.

I am trying out report builder, and i really like it but i am stuck
with 1 thing and hopefully it's possible or easy to do. ive read
through the guide but can't figure it out

i have on a form a textbox and with that i want to run my
query for the report.

i created a report and have all the fields on there, but
when i run the report i get nothing

i used for the query
SELECT * FROM mytable WHERE phone is like "' + textbox.text + '"

when i pause in delphi i can see the value for the query
but the report doesnt show the data for that record.
what am i missing, since i can't figure it out for the last couple
of days

thanks so much

Comments

  • edited August 2008
    Hi Perry,

    Thanks for your interest in ReportBuilder!

    If you run the report without altering the SQL code of your query does the
    data print as expected? How is your data connected to the report? Are you
    using datapipelines on a form or are you using DADE (built-in data
    workspace)?

    Updating a search condition for a report can be done in various ways but the
    typical method is to use the AutoSearch feature of ReportBuilder. Take a
    look at the AutoSearch demos located in the \RBuilder\Demos\5.
    AutoSearch\... directory for examples of using this feature.

    --
    Regards,

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

    Best Regards,

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

    Hi,

    Not sure what was wrong... but it's working now.
    All I did was uninstall and reinstall Report Builder, after
    downloading the latest trial. for some reason it was 10.06 and now
    it's 10.09.

    Dont know if there maybe was a bug in 10.06?

    All i am using is the TTreport and a DBpipeline.

    .... this is working fine now....
    procedure TForm1.Button2Click(Sender: TObject); // report view
    begin
    adoquery2.SQL.Clear;
    if edit2.Text = ''
    then
    begin
    adoquery2.SQL.Add('select * from maininfo');
    end
    else
    adoquery2.SQL.Add('select * from maininfo where storename like "'+
    edit2.Text + '"');
    adoquery2.Open;
    ppreport1.Print;
    end;

    ---------------------------------------

    i tried working with a Search filter under the Data Tab, but can't
    figure that one out.
    from the examples i took some code and modified it
    i don't know what is wrong with this. but when the report comes up,
    it's all blank pages.. instead of only 1 page


    class function TMyApplicationParams.Callnumber: String;
    begin
    Result := uCallnumber;
    end;

    class procedure TMyApplicationParams.SetCallnumber(aCallnumber:
    string);
    begin
    uCallnumber := aCallnumber;
    end;


    class procedure TmyReportManager.PrepareReport(aReport: TppReport);
    var
    liIndex: Integer;
    begin

    // suppress search dialog
    aReport.ShowAutoSearchDialog := False;
    // initialize search field values

    for liIndex := 0 to aReport.AutoSearchFieldCount - 1 do
    PrepareSearchField(aReport.AutoSearchFields[liIndex]);

    end;

    class procedure TmyReportManager.PrepareSearchField(aAutoSearchField:
    TppAutoSearchField);
    begin

    if aAutoSearchField.FieldAlias = 'Maininfo2' then
    aAutoSearchField.SearchExpression :=
    TMyApplicationParams.callnumber;
    // else if ....add more conditions here

    end;

    procedure Tfmainform.ehReport_LoadEnd(Sender: TObject);
    begin
    // initialize the report
    TmyReportManager.PrepareReport(ppReport1);
    end;



    procedure Tfmainform.Button2Click(Sender: TObject);
    begin
    TMyApplicationParams.SetCallnumber(dbedit3.text);
    ppReport1.Template.FileName := TppFileUtils.GetApplicationFilePath +
    'formprint.rtm';
    ppReport1.Template.LoadFromFile;
    ppreport1.Print;
    end;



    procedure Tfmainform.FormCreate(Sender: TObject);
    var dd : integer;
    tt: tsearchrec;
    I : integer;
    begin

    adoquery1.Active :=true;
    adoQuery1.First;
    DBEdit3.text := adoQuery1.FieldValues['Callnumber'];

    TMyApplicationParams.Setcallnumber(dbedit3.Text);

    ppReport1.Template.OnLoadEnd := ehReport_LoadEnd;
    //if aReport.AutoSearchFieldCount:=0 then


    AutoSearchFieldCount is always 0 so i added this in here

    ppReport1.CreateAutoSearchCriteria('Callnumber', 'Maininfo2', Solike,
    'S',False);



    for I := 0 to dxNavBarViewsFactory.Count - 1 do
    cbViews.Items.Add(dxNavBarViewsFactory.Names[I]);
    cbViews.ItemIndex :=
    dxNavBarViewsFactory.IndexOfID(navigationbar.View);


    end;

















    On Wed, 20 Aug 2008 07:07:19 -0600, "Nico Cizik \(Digital Metaphors\)"
This discussion has been closed.