Crystal Reports XI和SAP Crystal Reports 2013

2020-09-21 03:18发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)我正在为不同的客户开发Windo...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


我正在为不同的客户开发Windows服务,并自动创建多个报告。 这些报告(rpt文件)是使用CR9和CR XI创建的。

现在,一位客户希望导出" XLSX"。 因此,我认为应该切换到SAP Crystal Report2013。

现在我们的问题是:是否可以并行安装CrystalReportXIRev2SP3和CRforVS_13_0_22?

"旧"报告(* .rpt- 文件)与CR2013一起使用吗?

在哪里可以找到CrystalReport 2013的API? 获得XLSX导出的实现是什么? 什么是正确的" CRExportFormatType"(crEFTExcel ???)?

这些是我计算机的安装:
操作系统:Windows 10 Pro
IDE:Microsoft Visual Studio 2010,版本10.0.40219.1 SP1Rel
Microsoft .NET Framework 4.7.02558 SP1Rel
< br>预先感谢

Stefan Grasse(VAB GmbH)

3条回答
空代码
2020-09-21 03:24 .采纳回答

史蒂芬,你好

转到此处获取VS的CR:

https: //wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

还有样品作为其他参考材料。

是的,您需要3.5 Framework及更高版本的完整版本,让MS保持最新。 我们也可以使用4.7,现在仅需要3.5。

文档创建于2014年,暂停了所有有效文件并保持最新状态,编辑并不会更改创建日期,但它是最新的。

您现在可以在查看器中启用任何导出格式:

//设置格式导出类型:
 int myFOpts =(int)(
     CrystalDecisions.Shared.ViewerExportFormats.RptFormat |
     CrystalDecisions.Shared.ViewerExportFormats.PdfFormat |
     CrystalDecisions.Shared.ViewerExportFormats.RptrFormat |
     CrystalDecisions.Shared.ViewerExportFormats.XLSXFormat |
     CrystalDecisions.Shared.ViewerExportFormats.CsvFormat |
     CrystalDecisions.Shared.ViewerExportFormats.EditableRtfFormat |
     CrystalDecisions.Shared.ViewerExportFormats.ExcelRecordFormat |
     CrystalDecisions.Shared.ViewerExportFormats.RtfFormat |
     CrystalDecisions.Shared.ViewerExportFormats.WordFormat |
     CrystalDecisions.Shared.ViewerExportFormats.XmlFormat |
     CrystalDecisions.Shared.ViewerExportFormats.ExcelFormat |
     CrystalDecisions.Shared.ViewerExportFormats.ExcelRecordFormat);
//CrystalDecisions.Shared.ViewerExportFormats.NoFormat); //不允许出口
//int myFOpts =(int)(CrystalDecisions.Shared.ViewerExportFormats.AllFormats);

 crystalReportViewer1.AllowedExportFormats = myFOpts;

 尝试导出:

 如果(ExportTypeSelected ==" crReportExportFormatXLSX")
 #region XLSX
 {
    //这项工作不会改变
    //这将获取报告名称,并将导出名称设置为与扩展名相同的名称
     字符串outputFileName ="";
     字符串MyRptName = rpt.FileName.ToString();
     outputFileName = MyRptName.Substring(9,rpt.FileName.Length-9);
     outputFileName = outputFileName.Substring(0,(outputFileName.Length-3))+" xlsx";

     尝试
     {
         如果(File.Exists(outputFileName))
         {
             File.Delete(outputFileName);
         }

         CrystalDecisions.ReportAppServer.ReportDefModel.DataOnlyExcelExportFormatOptions RASXLXSExportOpts = new DataOnlyExcelExportFormatOptions();
         RASXLXSExportOpts =(DataOnlyExcelExportFormatOptions)rptClientDoc.get_SavedExportOptions(CrReportExportFormatEnum.crReportExportFormatXLSX);

        //textBox1 =" Excel-BaseAreaGroupNumber:" + RASXLXSExportOpts.BaseAreaGroupNumber.ToString()+" \ n";
        //textBox1 + =" Excel-BaseAreaType:" + RASXLXSExportOpts.BaseAreaType.ToString()+" \ n";
        //textBox1 + =" Excel-ConstantColWidth:" + RASXLXSExportOpts.ConstantColWidth.ToString()+" \ n";
        //textBox1 + =" Excel-ExportImages:" + RASXLXSExportOpts.ExportImages.ToString()+" \ n";
        //textBox1 + =" Excel-ExportObjectFormatting:" + RASXLXSExportOpts.ExportObjectFormatting.ToString()+" \ n";
        //textBox1 + =" Excel-ExportPageHeaderAndFooter:" + RASXLXSExportOpts.ExportPageHeaderAndFooter.ToString()+" \ n";
        //textBox1 + =" Excel-MaintenanceColumnAlignment:" + RASXLXSExportOpts.MaintainColumnAlignment.ToString()+" \ n";
        //textBox1 + =" Excel-MaintenanceRelativeObjectPosition:" + RASXLXSExportOpts.MaintainRelativeObjectPosition.ToString()+" \ n";
        //textBox1 + =" Excel-ShowGroupOutlines:" + RASXLXSExportOpts.ShowGroupOutlines.ToString()+" \ n";
        //textBox1 + =" Excel-SimplifyPageHeaders:" + RASXLXSExportOpts.SimplifyPageHeaders.ToString()+" \ n";
        //textBox1 + =" Excel-UseConstantColWidth:" + RASXLXSExportOpts.UseConstantColWidth.ToString()+" \ n";
        //textBox1 + =" Excel-UseWorksheetFunctionsForSummaries:" + RASXLXSExportOpts.UseWorksheetFunctionsForSummaries.ToString()+" \ n";

        //现在设置它们:
        //RasXLSExpOpts.BaseAreaType = CrAreaSectionKindEnum.crAreaSectionKindPageHeader;
        //RasXLSExpOpts.UseConstantColWidth = false;
        //RasXLSExpOpts.ShowGridlines = false;
        //RasXLSExpOpts.StartPageNumber = 3;
        //RasXLSExpOpts.EndPageNumber = 10;

        //保存修改后的信息
        //rptClientDoc.set_SavedExportOptions(CrReportExportFormatEnum.crReportExportFormatXLSX,RASXLXSExportOpts);

         CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions exportOpts1 =新的CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions();
         exportOpts1.ExportFormatType = CrReportExportFormatEnum.crReportExportFormatXLSX;
         exportOpts1.FormatOptions = RASXLXSExportOpts;
         RASXLXSExportOpts.ConstantColWidth = Convert.ToInt32(36.6);
         RASXLXSExportOpts.ExportObjectFormatting = true;
         RASXLXSExportOpts.ExportImages = false;
         RASXLXSExportOpts.UseWorksheetFunctionsForSummaries = false;
         RASXLXSExportOpts.MaintainRelativeObjectPosition = true;
         RASXLXSExportOpts.MaintainColumnAlignment = true;
         RASXLXSExportOpts.ExportPageHeaderAndFooter = false;
         RASXLXSExportOpts.SimplifyPageHeaders = true;
         RASXLXSExportOpts.ShowGroupOutlines = false;


         CrystalDecisions.ReportAppServer.ReportDefModel.ExcelExportFormatOptions ExpXLXSOpts = new ExcelExportFormatOptions();
        //ExpXLXSOpts.ConstantColWidth = 45;
        //ExpXLXSOpts.ConvertDatesToStrings = true;

         exportOpts1.ExportOptionsEx = null;

        //和导出
         rptClientDoc.PrintOutputController.ExportEx(exportOpts1).Save(outputFileName,true);
         MessageBox.Show("导出到Excel XLXS已完成","",MessageBoxButtons.OK,MessageBoxIcon.Information);
     }
     抓住(例外)
     {
         btnSQLStatement.Text ="错误:" + ex.Message;
         返回;
     }
 }
 #endregion XLSX

 您将需要测试并使用代码,不确定在编写本文时我正在测试什么...

 唐

一周热门 更多>