How to prepare parametrized (with more than one parameters) crystal report.pls tell me the code procedure, if any body can?
Answer / Sudeep Kumar
Creating a parametrized Crystal Report with multiple parameters in .NET involves defining and setting the parameters in your Crystal Report file, as well as handling those parameters within your application's code. Here is a simple example of using a Crystal Report with two parameters in C#:nn```csharpnReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Path.GetFullPath(@"C:MyReportsMyReport.rpt"));
TextObject param1 = (TextObject)crystalReport.Database.CommandInfo.FindParameter("Param1");
param1.Value = TextObject.Parse(""" + yourVariable1 + """);
TextObject param2 = (TextObject)crystalReport.Database.CommandInfo.FindParameter("Param2");
param2.Value = TextObject.Parse(""" + yourVariable2 + """);
CrystalDecisions.Shared.TableLogOnInfo logonInfo;
for (int i = 0; i < crystalReport.Database.Tables.Count; i++)
{
logonInfo = crystalReport.Database.Tables[i].LogOnInfo;
logonInfo.ConnectionInfo = crystalReport.Database.DefaultLogonInfo;
crystalReport.Database.Tables[i].ApplyLogOnInfo(logonInfo);
}
CrystalReportViewer1.ReportSource = crystalReport;n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Please explain what are an inheritance, polymorphism, and encapsulation?
How is development of a Windows service different from a Windows Forms application?
Explain clr, cts and cls?
What is the use of Treeview control?
What is 'Common Type System' (CTS) in .NET?
why do you want to join deloitte, where do you exactly fit in.
How viewstate is being formed and how it's stored on client in .net?
Where does the gac exist ?
syntax for binding the data from database
Can a try block have more than one catch block?
What is Assembly?
What are Generics? Where do we use them.