Avatar of Clif
ClifFlag for United States of America

asked on 

Passing Multiple Values or a Range to a Crystal Report

I'm usinf VB.Net 2010 (pro), the report was created with CR XI and the CrystalDecisions version is 13.x

I'm creating a report "broadcaster" application.  Basically the app will take in a list of reports, the email addresses of those who are subscribed, values for parameters and days/times of sending.

Everything is fine except the parameters.  A couple of the reports have, potentially, a list of values (like department names).  In the report itself, this is a listbox showing all possibilities, and another listbox that allows you to add one or more items from the first listbox.  Hopefully you know what I'm talking about.

How do I do this in code, though?

For example, if I want to show records for department ABC, I know I can do this:
myReportDocument.SetParameterValue("DeptName", "ABC")

Open in new window

But what happens if I want to show records for department ABC, DEF and GHI?

Would I do this:
myReportDocument.SetParameterValue("DeptName", "ABC")
myReportDocument.SetParameterValue("DeptName", "DEF")
myReportDocument.SetParameterValue("DeptName", "GHI")

Open in new window

Or this:
myReportDocument.SetParameterValue("DeptName", "ABC,DEF,GHI")

Open in new window

Or something completely different?

Visual Basic.NET

Avatar of undefined
Last Comment
Avatar of Mike McCracken
Mike McCracken

Is the parameter setup for multiple values?
If so you just add them 1 at a time.

I believe you use the AddParameterValue method.

Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Clif
Flag of United States of America image


What it means is that you have to pass in a ParameterValues collection as the second parameter of SetParameterValue.
This is what I thought, but the description in the Help file suggests that you can only pass strings or integers.

Tested and works perfectly.  Thanks.
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo