cancel
Showing results for 
Search instead for 
Did you mean: 

Error on opening XLSX file exported (.NET only)

0 Kudos

When exporting to XLSX, file generate does´t open. A message: “We Have Found a Problem with Some Content in Excel”

Versions:

CR2020 for .Net runtime - CR13SP30 running on Windows Server 2016 STD (Version=13.0.4000.0)

Excel for Microsoft 365

It works well when generated by CR Developer 2020 (14.3.1.3701) but not when generated by .Net Runtime at server.
It works well for XLS (both formatted or only data); the problem only affects XLSX format.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

Did you use these new ENUM's?

Solution

This enhancement is introduced in the patches listed in the "Support Packages & Patches" section below.

Due to different internal processes, the "Support Packages & Patches" section of the SAP Note will be populated as below:

- for fixes delivered in "Support Packages": immediately (even if the "Support Package" is planned to be released several months later)

- for fixes delivered in "Patches": ONLY once the "Patch" is released AND available on SMP (not before)

For Business Intelligence Platform maintenance schedule and strategy see the Knowledge Base Article 2144559 in References section.

Update “ReportExportFormat” in RAS Java SDK API

  • Add “XLSX” for page based XLSX
  • Add “recordToXLSX” for record based XLSX (same to existingrecordToMSExcel2007”)

Update “CrReportExportFormatEnum” in RAS .NET SDK API

  • Add “crReportExportFormatPageToXLSX” for page based XLSX
  • Add “crReportExportFormatRecordToXLSX” for record based XLSX (same to existingcrReportExportFormatXLSX”)

Update “ExportFormatType” in CR .NET SDK API

  • Add “XLSXPagebased” for page based XLSX
  • Add “XLSXRecord” for record based XLSX (same to existingExcelWorkbook”)

Update “ViewerExportFormats” in CR .NET SDK API

  • Add “XLSXPagebasedFormat” for page based XLSX
  • Add “XLSXRecordFormat” for record based XLSX (same to existingXLSXFormat”)

Answers (4)

Answers (4)

0 Kudos

Thank you, Don!

We´ve done all of it!

1. Enabled the code you suggested (attached picture)
2. Recompiled our application on Visual Studio Community 2019 - ver 16.9.6
3. .Net Framework 4.8.04084
4. Reinstalled Crystal runtime 64bits for .net - version 13.0.30.3805

- First, we used only CrystalDecisions.Shared.ViewerExportFormats.AllFormats

It doesn´t work.

- But then, we used it exactly as you posted.... and the error message continues...

Some interesting remarks:

1. The same Windows 10 (64bit) we have this error from Web Export, works fine with Crystal Developer (As I´d mentioned before). That´s why we though it was .Net Runtime problem on webserver...

2. But... the same XLSX file that shows error on desktop opens normally on iPhone and Android Excel versions!!

Tho help us to identify the problem, we attached: (1. Versions of compilers; 2. The XLSX file we have this error message)

Files for Explanation

https://drive.google.com/file/d/1nL631ECCQQX4e3bHXoJiP9yRdDQJL7BZ/view?usp=sharing

0 Kudos

You also need to enable the Viewer to show them:

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.XLSXPagebasedFormat | CrystalDecisions.Shared.ViewerExportFormats.XLSXRecordFormat | CrystalDecisions.Shared.ViewerExportFormats.ExcelRecordFormat); //CrystalDecisions.Shared.ViewerExportFormats.NoFormat); // no exports allowed //int myFOpts = (int)(CrystalDecisions.Shared.ViewerExportFormats.AllFormats);

crystalReportViewer1.AllowedExportFormats = myFOpts;

0 Kudos

It works exporting from CR Viewer (although it exports only Data mode).

Furthermore, from CR Develop it also exports XLSX and XLSX-only data without any error.

The problem is specific on .net runtime

0 Kudos

Try cleaning up your report, SDK assumes the report is 100% without error.

Open the Report in CR Designer and check every formula and remove any unused formula or tables not required.

If you export from the Viewer does that work?