Avatar of Clif
Flag 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

8/22/2022 - Mon
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.

Nasir Razzaq

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck