Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Don't rely on others to show you the way, carry your own map
 
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

22
March

Crystal Reports Non - String Parameter Formulas

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;

1

Andra Hartwick

13
October
Hello there! This is my first visit to your blog! We are a team of volunteers and starting a new project in a community in the same niche. Your blog provided us useful information to work on. You have done a wonderful job!

MAKE A COMMENT

Name *

Email Address *

Comment *

To prove you are human what is:

33 + 87 =