Global variable
Hello,
Can y send to my report a global variable ?
I would like to have a variable (defined in Delphi) in a box that i can drop
on my page like a data.
Is it possible ?
I saw the parameters editor box and i defined one, but i can use in
reportBuilder, i can't access it.
David.
Can y send to my report a global variable ?
I would like to have a variable (defined in Delphi) in a box that i can drop
on my page like a data.
Is it possible ?
I saw the parameters editor box and i defined one, but i can use in
reportBuilder, i can't access it.
David.
This discussion has been closed.
Comments
Parameters can be accessed in RAP and assigned to a global variable if
needed. ReportBuilder does not have a built-in feature to access parameters
from the designer however it is very simple from RAP. The following example
shows how they can be used.
http://www.digital-metaphors.com/tips/SimpleParameters.zip
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I can't load the entire program: "Class TraCodeModule not found..."
I saw the "SystemInfo" in ppReport1's parameters, but nothing in report (on
the page, i've only "label1" that render: Label1 on preview).
How can i get this parameter in report ?
Can't i have a parameter named "myParameter" ?
Regards.
If you are talking about doing this in Delphi, here is a snippet of code
from how I did this. This works even without RAP ability.
The user selects a report in a list box, then chooses a date range (Min &
Max Date). Based upon those selections, a variable component calculates the
labels to display on the report, such as:
Min. Date: 1/1/06
Max. Date: 12/31/06
=====================
{wMinDate & wMaxDate are global variables set based upon user selection from
a date component}
procedure TLoanReportForm.ppMinDateCalc(Sender: TObject;
var Value: Variant);
begin
Value:='Min. Date:'+FormatDateTime('m/d/yy',wMinDate);
end;
procedure TLoanReportForm.ppMaxDateCalc(Sender: TObject;
var Value: Variant);
begin
Value:='Max. Date:'+FormatDateTime('m/d/yy',wMaxDate);
end;
If you would like to access parameters from within the report template, you
will need to use RAP which is available with the Enterprise edition of
ReportBuilder. Otherwise you will need to create your "global variable"
values in Delphi and assign them to the report using one of the report
events such as the OnCalc as David Miller mentioned in his post.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com