/// <summary> /// Convert a ReportGenerationType to a Crystal Export type enum /// </summary> /// <param name="type">internal ReportGenerationType to be converted</param> /// <returns>Crystal Report export type</returns> public static ExportFormatType ToCrystalType(ReportGenerationType type) { switch (type) { case ReportGenerationType.CrystalReport: return(ExportFormatType.CrystalReport); case ReportGenerationType.RichText: return(ExportFormatType.RichText); case ReportGenerationType.WordForWindows: return(ExportFormatType.WordForWindows); case ReportGenerationType.PortableDocFormat: return(ExportFormatType.PortableDocFormat); case ReportGenerationType.HTML32: return(ExportFormatType.HTML32); case ReportGenerationType.HTML40: return(ExportFormatType.HTML40); case ReportGenerationType.ExcelRecord: return(ExportFormatType.ExcelRecord); default: return(ExportFormatType.NoFormat); } }
/// <summary> /// /// </summary> /// <param name="templatePath"></param> /// <param name="templateName"></param> /// <param name="templateDescription"></param> /// <param name="generationType"></param> /// <param name="configureHandler"></param> public ReportGenerationItem(string templatePath, string templateName, string templateDescription, IStaticReportTranslation reportTranslation, ReportGenerationType generationType, ReportGetDataSourceEventHandler getDataHandler, ReportFillParameterEventHandler fillParameterHandler) : this(templatePath, templateName, templateDescription, null, null, null, reportTranslation, generationType, getDataHandler, fillParameterHandler, null) { }
/// <summary> /// /// </summary> /// <param name="templatePath"></param> /// <param name="templateName"></param> /// <param name="templateDescription"></param> /// <param name="reportPath"></param> /// <param name="reportName"></param> /// <param name="reportDescription"></param> /// <param name="generationType"></param> /// <param name="configureHandler"></param> /// <param name="createExportStreamHandler"></param> public ReportGenerationItem(string templatePath, string templateName, string templateDescription, string reportPath, string reportName, string reportDescription, IStaticReportTranslation reportTranslation, ReportGenerationType generationType, ReportGetDataSourceEventHandler getDataHandler, ReportFillParameterEventHandler fillParameterHandler, ReportStreamEventHandler createExportStreamHandler) { this.templatePath = templatePath; this.templateName = templateName; this.templateDescription = templateDescription; this.reportPath = reportPath; this.reportName = reportName; this.reportTranslation = reportTranslation; this.reportDescription = reportDescription; this.generationType = generationType; this.getDataHandler = getDataHandler; this.fillParameterHandler = fillParameterHandler; this.createExportStreamHandler = createExportStreamHandler; if (templatePath == null) { throw new ArgumentNullException("templatePath", "templatePath cannot be null"); } if (getDataHandler == null) { throw new ArgumentNullException("configureHandler", "configureHandler cannot be null"); } if (fillParameterHandler == null) { throw new ArgumentNullException("fillParameterHandler", "fillParameterHandler cannot be null"); } if (generationType != ReportGenerationType.ShowReportInDlg) { if (reportPath == null) { throw new ArgumentNullException("reportPath", "reportPath cannot be null for an export generation type"); } if (createExportStreamHandler == null) { throw new ArgumentNullException("createExportStreamHandler", "createExportStreamHandler cannot be null for an export generation type"); } } }