Print Page | Close Window

a crystal report depending on the selected item in

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
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=1367
Printed Date: 01 May 2024 at 8:30am


Topic: a crystal report depending on the selected item in
Posted By: diana_j86
Subject: a crystal report depending on the selected item in
Date Posted: 24 Sep 2007 at 3:06am

How to generate a  crystal report depending on the selected item in a dropdownlist filled with values from a table in database?

Note: I am using code behind
 
Thanks,


-------------
Diana



Replies:
Posted By: BrianBischof
Date Posted: 24 Sep 2007 at 9:28am
Use a formula field in the report for your record selection formula. Then when you instantiate the report in code, set the formula field's value using the value in the drop down list.  (in C#)
myReport.DataDefinition.FormulaFields("formulaname").Text="""" + dropDownList.Text + """";

If it isn't a text dropdown value, then you don't need to insert the double quotes around the field's value.

I cover this on page 318 in my book, "CR.NET Programming"


-------------
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