Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: a crystal report depending on the selected item in Post Reply Post New Topic
Author Message
diana_j86
Newbie
Newbie


Joined: 24 Sep 2007
Location: Jordan
Online Status: Offline
Posts: 1
Quote diana_j86 Replybullet Topic: a crystal report depending on the selected item in
    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
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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"


Edited by BrianBischof - 24 Sep 2007 at 9:28am
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>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.