iam working at crystal report, but me getting problems.
take in mind that iam using reporting by parameters queries...
1). when i run the program at start one textbox and one button appears by default, but i do not need of it.. in this case i got my result which i want but textbox and button appears...
other problem is
2). i want to export data from crystal report to excel and pdf..
please geve me good solution..
me have followed many articals but me could not became success...
code for problem#2:
- private void ExportData()
- {
- ReportDocument report = new ReportDocument();
- report.Load(Server.MapPath("CrystalReport.rpt"));
- report.SetDatabaseLogon("sa", "CFO123+", "SERVER\\SQLEXPRESS", "Libraray");
- string filetype = ddlFormats.Text;
- CrystalDecisions.Shared.ExportFormatType efileType = (CrystalDecisions.Shared.ExportFormatType)Enum.Parse(typeof(CrystalDecisions.Shared.ExportFormatType), filetype);
- Response.Write(filetype );
- switch (efileType)
- {
- case CrystalDecisions.Shared.ExportFormatType.Excel:
- report.ExportToDisk(efileType.Excel, "report.xls");
- break;
- case CrystalDecisions.Shared.ExportFormatType.PortableDocFormat:
- report.ExportToDisk(efileType.PortableDocFormat, "reportpdf.pdf");
- break;
- }
-
- }