Print Page | Close Window

Crystal Reports and Parameter passing?

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=244
Printed Date: 04 May 2024 at 1:08am


Topic: Crystal Reports and Parameter passing?
Posted By: John
Subject: Crystal Reports and Parameter passing?
Date Posted: 26 Feb 2007 at 7:30am
Hello there, first I wish you luck on the new forum's, I hope they work out nicely!
 
I do have a question about parameterized reports with Crystal Reports that comes with VS2005 pro.
 
I need to develop reports that can have a variable number of parameters set in them.  I would like to give my users the ability to set or not set a finite list of parameters, but I'm not sure if this can be done easily.
 
So, I guess my real question is, if I create  parameter fields for a report, and do NOT populate them, will this cause me problems?  I'd try it out, but unfortunately, I don't have time right now to fit this testing in (but I have time to write a post about it! :) )



Replies:
Posted By: BrianBischof
Date Posted: 26 Feb 2007 at 10:26am
Well, unfortunately we are in the same boat. I never thought about optional parameters and thus haven't tried it before. It's an interesting idea though. Rather than not populate them, I would assign dummy values to the unused ones. Then if you need to, in your report logic check for the dummy values and act accordingly.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: John
Date Posted: 26 Feb 2007 at 1:35pm
Something I just read somewhere a few hours ago sounds very interesting.
 
Create a class to represent your data (like Employee or something like that). Then generate a list (or some enumerable type) of your Employee class.  Then bind the report to THAT list.
 
In this way, I would imagine that building the list is where you could have all of your parameters.  The only issue that I could see with this method is that you are potentially storing a considerable amount of information in memory to display the report? 
 
hmm


Posted By: BrianBischof
Date Posted: 26 Feb 2007 at 2:56pm
I don't think that answers your question. Binding to a custom class is really talking about using that class as your data source. Thus, your report prints the data from that class instead of from a database. The parameter collection isn't involved here at all.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window