Crystal report

Feb 18 2010 1:34 AM


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:
  1. private void ExportData()   
  2. {   
  3. ReportDocument report = new ReportDocument();   
  4. report.Load(Server.MapPath("CrystalReport.rpt"));   
  5. report.SetDatabaseLogon("sa""CFO123+""SERVER\\SQLEXPRESS""Libraray");   
  6. string filetype = ddlFormats.Text;   
  7. CrystalDecisions.Shared.ExportFormatType efileType = (CrystalDecisions.Shared.ExportFormatType)Enum.Parse(typeof(CrystalDecisions.Shared.ExportFormatType), filetype);   
  8. Response.Write(filetype );   
  9. switch (efileType)   
  10. {   
  11. case CrystalDecisions.Shared.ExportFormatType.Excel:   
  12. report.ExportToDisk(efileType.Excel, "report.xls");   
  13. break;   
  14. case CrystalDecisions.Shared.ExportFormatType.PortableDocFormat:   
  15. report.ExportToDisk(efileType.PortableDocFormat, "reportpdf.pdf");   
  16. break;   
  17. }   
  18.   
  19. }  

Answers (1)