p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/forumdisplay.php?f=215)
-   -   How to pass Parameter to Crystal Reports 10 (http://p2p.wrox.com/showthread.php?t=61615)

shakti_2505270 August 30th, 2007 01:44 AM

How to pass Parameter to Crystal Reports 10
 
hi iam a software programmer and facing a problem in Crystal Reports.
my doubt is, how to pass a value to parameter so that we can get that parameter in Crystal Reports 10. I want the code in C#


shakti_2505270 August 30th, 2007 06:01 AM

hi, this is shakti. i have successfully run this code. hope u will all find it helpful.

// here iam passing the text property of DropdownListContol as
// paramter in CrystalReport10.


reportDocument.SetDataSource(dt);
ParameterFieldDefinitions parameterFieldDefinitions = reportDocument.DataDefinition.ParameterFields;
ParameterFieldDefinition paramEventName = parameterFieldDefinitions[0];
paramEventName.CurrentValues.Clear();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = drpEventName.SelectedItem.Text.ToString();
paramEventName.CurrentValues.Add(paramDiscreteValu e);
paramEventName.ApplyCurrentValues(paramEventName.C urrentValues);

CrystalReportViewer1.ReportSource = reportDocument;[/red][/red]


All times are GMT -4. The time now is 03:12 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.