A number of clients have asked me how does one display the parameter values of the report. This is the second part and covers non string parameter formulas to be placed in the heading sections of the reports.
This blog, provides some of the formulas that can be used to show the non-string parameter values within crystal reports report:
In all cases the formulas must loop to store all the values of the parameters, and then be concatenated into a single string.
Multiple Discrete Numerical Parameter Values
WhilePrintingRecords;
NumberVar counter; StringVar parameterlist;
for counter := 1 to Count({?Parameter}) do (
parameterlist := parameterlist + Totext({?Parameter}[counter],0,"")+ Chr(13);
);
parameterlist
Multiple Discrete Date Time Parameter Values
WhilePrintingRecords;
NumberVar counter; StringVar parameterlist;
for counter := 1 to Count({?Parameter}) do (
parameterlist := parameterlist + Totext({?Parameter}[counter],"dd/MM/yyyy")+ Chr(13);
);
parameterlist;
Ranged Numerical Parameter Values
WhilePrintingRecords; NumberVar counter; StringVar parameterlist;
for counter := 1 to Count({?Order Date}) do
(
if minimum({?Parameter} Counter]) = maximum({?Parameter}[Counter])
then (parameterlist:= parameterlist + Totext(minimum({?Parameter}[counter]),0,"")+ Chr(13);) else (parameterlist:= parameterlist + Totext(minimum({?Parameter} [counter]),0,"")+" to "+ Totext(Maximum({?Parameter} [counter]),0,"") +Chr(13););
);
parameterlist;
Ranged DateTime Parameter Values
WhilePrintingRecords; NumberVar counter; StringVar parameterlist;
for counter := 1 to Count({?Order Date}) do
(
if minimum({?Parameter} Counter]) = maximum({?Parameter}[Counter])
then (parameterlist:= parameterlist + Totext(minimum({?Parameter}[counter]),"dd/MM/yyyy")+ Chr(13);)
else
(parameterlist:= parameterlist + Totext(minimum({?Parameter} [counter]),"dd/MM/yyyy")+" to "+ Totext(Maximum({?Parameter} [counter]),"dd/MM/yyyy") +Chr(13););
);
parameterlist; |