C# .NET - how to access values from dropdownlist to crystal reoprt page

Asked By mani on 05-Apr-12 02:07 AM
hi i am shorlisting data in gridview using datatime picker ...and taking  that shorlisted data into report section..
i can do it easily..but i need to show that datatime picker value in my crystal report ..how to get that value in crystal report any help please??
Somesh Yadav replied to mani on 05-Apr-12 02:48 AM
CrystalReportViewer1.ParameterFieldInfo.Clear();
CrystalReportViewer1.ReportSource = Server.MapPath("CrystalReport6.rpt");
ParameterFields ParamFields = CrystalReportViewer1.ParameterFieldInfo();
ParameterField CatId = new ParameterField();
CatId.Name = "Cat_Id";
ParameterDiscreteValue CatId_Value = new ParameterDiscreteValue();
CatId_Value.Value = DropDownList1.SelectedValue;
CatId.CurrentValues.Add(CatId_Value);
ParamFields.Add(CatId);
Jitendra Faye replied to mani on 05-Apr-12 03:04 AM
For working example follow this link-

http://www.aspdotnet-suresh.com/2012/01/pass-parameters-to-crystal-reports-in.html


http://3.bp.blogspot.com/-YsMC28MH_-g/TxmQOitP-EI/AAAAAAAAA7U/iDZsVzNGzWU/s1600/OutputReports.Gif