Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 23, 2012 06:02 AM by -_-
Member
376 Points
1046 Posts
Feb 23, 2012 06:02 AM|LINK
private void button1_Click(object sender, EventArgs e) { ReportDocument report = new ReportDocument(); report.Load("DiffFileFormatRpt.rpt"); report.SetDatabaseLogon("username", "password", @"server", "database"); string filetype = cmbFileFomats.Text; CrystalDecisions.Shared.ExportFormatType efileType = (CrystalDecisions.Shared.ExportFormatType)Enum.Parse(typeof(CrystalDecisions.Shared.ExportFormatType), filetype); switch (efileType) { case CrystalDecisions.Shared.ExportFormatType.Excel: report.ExportToDisk(efileType, "reportExcel.xls"); break; case CrystalDecisions.Shared.ExportFormatType.ExcelRecord: report.ExportToDisk(efileType, "reportExcel.xls"); break; case CrystalDecisions.Shared.ExportFormatType.HTML32: report.ExportToDisk(efileType, "reporthtml.html"); break; case CrystalDecisions.Shared.ExportFormatType.HTML40: report.ExportToDisk(efileType, "reporthtml.html"); break; case CrystalDecisions.Shared.ExportFormatType.NoFormat: report.ExportToDisk(efileType, "reportExcel.xls"); break; case CrystalDecisions.Shared.ExportFormatType.PortableDocFormat: report.ExportToDisk(efileType, "reportpdf.pdf"); break; case CrystalDecisions.Shared.ExportFormatType.RichText: report.ExportToDisk(efileType, "reportrtf.rtf"); break; case CrystalDecisions.Shared.ExportFormatType.WordForWindows: report.ExportToDisk(efileType, "reportdoc.doc"); break; } }
i would like to export all the report that place into the same folder, but can i make sure if the report if place in folder or not?
can report document has this functions?
-_-
Member
376 Points
1046 Posts
export text file directly to disk
Feb 23, 2012 06:02 AM|LINK
private void button1_Click(object sender, EventArgs e) { ReportDocument report = new ReportDocument(); report.Load("DiffFileFormatRpt.rpt"); report.SetDatabaseLogon("username", "password", @"server", "database"); string filetype = cmbFileFomats.Text; CrystalDecisions.Shared.ExportFormatType efileType = (CrystalDecisions.Shared.ExportFormatType)Enum.Parse(typeof(CrystalDecisions.Shared.ExportFormatType), filetype); switch (efileType) { case CrystalDecisions.Shared.ExportFormatType.Excel: report.ExportToDisk(efileType, "reportExcel.xls"); break; case CrystalDecisions.Shared.ExportFormatType.ExcelRecord: report.ExportToDisk(efileType, "reportExcel.xls"); break; case CrystalDecisions.Shared.ExportFormatType.HTML32: report.ExportToDisk(efileType, "reporthtml.html"); break; case CrystalDecisions.Shared.ExportFormatType.HTML40: report.ExportToDisk(efileType, "reporthtml.html"); break; case CrystalDecisions.Shared.ExportFormatType.NoFormat: report.ExportToDisk(efileType, "reportExcel.xls"); break; case CrystalDecisions.Shared.ExportFormatType.PortableDocFormat: report.ExportToDisk(efileType, "reportpdf.pdf"); break; case CrystalDecisions.Shared.ExportFormatType.RichText: report.ExportToDisk(efileType, "reportrtf.rtf"); break; case CrystalDecisions.Shared.ExportFormatType.WordForWindows: report.ExportToDisk(efileType, "reportdoc.doc"); break; } }