Home RAP

Stringlist as Parameter

edited January 2010 in RAP
Delphi7, RB, RAP

Hello,

i tried to make a string like:

Delphi
s := s1 + #13#10 + s2 + #13#10 + s3 + #13#10 ....
ppReport.Parameters['sl'].Value := s;

But in RAP i get only the first string s1.

Is there a simple way for Stringlist?

Best regards, Olaf

Comments

  • edited January 2010
    Hi Olaf,

    The TStringList object is supported in RAP. You should be able to use it as
    you would in Delphi

    s := TStringList.Create;
    s.Add(...
    s.Add(...

    ... := s.Text;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2010
    Hi Nico,

    yes, i know i use the stringlist in RAP.

    But i can not transport it via Report.Parameters.
    I like to preper a stringlist in delphi and then transport it to RAP,
    where i want to use as parameter.

    Olaf


    Nico Cizik (Digital Metaphors) schrieb:
  • edited January 2010
    Hi Olaf,

    Thanks for the clarification. Unfortunately you cannot pass a StringList as
    a parameter to RAP.

    Which version of ReportBuilder are you using? In my testing with RB 11.07,
    setting the value of a parameter to something similar to what you described
    properly transferred to a memo object in RAP.

    In Delphi...

    ppReport1.Parameters['MyParam'].Value := 'John' + #13#10 + 'Paul' + #13#10 +
    'George' + #13#10 + 'Ringo';

    In Rap (Memo.OnPrint event)

    Memo1.Lines.Text := Report.Paramemters['MyParam'];

    Output...

    John
    Paul
    George
    Ringo

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2010

    I have not tried this, but perhaps try using the StringList.CommaText
    property like this...

    ppReport1.Parameters['MyParam'].Value := myStringList.CommaText;

    and then inside RAP, create a local string list and do this..

    lStringList.CommaText := ppReport1.Parameters['MyParam'].Value;


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



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2010
    Hi Nico,

    i think i am using RB 11.01 (where can i read the version)

    Your way will not work on 11.01.
    I get only "John".

    Thanks!
    Olaf

    Nico Cizik (Digital Metaphors) schrieb:
  • edited January 2010
    Hi Nard,

    this way will work fine on 11.02.

    For the memo, i took the following way:

    procedure Memo1OnPrint;
    var
    sl : TStrings;
    begin
    sl := TStringList.Create;
    sl.CommaText := Report.Parameters['sl'];
    Memo1.Lines.Text := sl.Text;
    sl.Free;
    end;

    Thanks!
    Olaf



    ard Moseley (Digital Metaphors) schrieb:
This discussion has been closed.