How to prepare parametrized (with more than one parameters) crystal report.pls tell me the code procedure, if any body can?



How to prepare parametrized (with more than one parameters) crystal report.pls tell me the code proc..

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

Post New Answer

More Dot Net General Interview Questions

Please explain what are an inheritance, polymorphism, and encapsulation?

1 Answers  


How is development of a Windows service different from a Windows Forms application?

1 Answers  


Explain clr, cts and cls?

1 Answers  


What is the use of Treeview control?

1 Answers   CGI,


What is 'Common Type System' (CTS) in .NET?

1 Answers   NA,


why do you want to join deloitte, where do you exactly fit in.

1 Answers   Deloitte,


How viewstate is being formed and how it's stored on client in .net?

1 Answers  


Where does the gac exist ?

1 Answers  


syntax for binding the data from database

1 Answers   Satyam,


Can a try block have more than one catch block?

1 Answers  


What is Assembly?

1 Answers   DELL, Wipro,


What are Generics? Where do we use them.

2 Answers   Value Labs,


Categories