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

newbie question

edited December 2003 in General
Hi,
This may sound trivial but I can't figure how to display in my report text
that the user enters in edit boxes in my delphi app. To rephrase I want in
my report a text field that is assosiated with an edit box in my app.
I know how to do this when my edit boxes are dbedit boxes but how about when
they are not?
Thnx,
George

Comments

  • edited December 2003
    Hi George,

    If you are using the latest version of ReportBuilder, try using Report
    Parameters to pass a value from delphi into a report. Below is a link to a
    simple example of how to do this.

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

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2003
    Hi Nico,
    Thanks for your reply.
    I downloaded the example, but still can't figure out how the label is
    associated with the parameter. I understand how you set parameters.

    ppReport1.Parameters['SystemInfo'].Value := 'RB 7.02';

    But there is just no code, or properties that associates Label1 with
    parameter SystemInfo.

    Please tell me where to look or I will go crazy.

    George


  • edited December 2003
    Hi George,

    I'm sorry, I was under the impression you were already using RAP. The label
    is being set in the data section of the report inside the TppLabel.OnGetText
    event. You can see this code by clicking on the data tab of the designer if
    you are using ReportBuilder Enterprise or Server.

    This may however not be the best solution for your needs. If you have
    already created a label on a report and you would like to assign it a value
    you can do so by accessing the TppLabel.Text property either before calling
    Report.Print or in an event that fires before the label is printed. For
    example:

    Say I had a simple application with a Report, Button, and Edit box on a
    form. In the Button's OnClick event I would do the following...

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ppLabel1.Text := Edit1.Text;

    ppReport1.Print;
    end;

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.