3

I have a C# WinForms application which is generating a .xls type report using the Telerik.Reporting dll.

We are in the process of developing an enhanced version of the application in electron using Angular. We are using EdgeJs to access the reporting features during the transition from the legacy product to the new product. That is, we are running the exact same C# code in both the legacy application and the electron app.

The problem is that the Telerik.Reporting RenderReport method throws an exception, "XLS rendering format is not available", in the electron version of the app, but not in the WinForms version. Here are the relevant lines of code:

var reportSource = new InstanceReportSource { ReportDocument = rpt };
result = processor.RenderReport("XLS", reportSource, null);
rptStream = new FileStream(path + "\\" + rpttmpXlsPath, FileMode.Create);
rptStream.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);

We cannot figure out why this is happening. Here is what we know:

  1. The data being reported is identical in both cases.
  2. The C# code being executed is the same in both cases.
  3. The issue is reproducible on other (non-dev) machines.
  4. On a single developer machine (Window 7/Excel 2010), the exception does not occur and the report generates as expected. As an added bonus, this machine also contains the Telerik license for developing the reports.
  5. On another non-dev machine with Windows 7/Excel 2010, we get the same exception.
  6. We have tested the application on a Windows 7/Excel 2013 machine and got the exception.
  7. We have tried updating to the latest EdgeJs to no avail.
  8. We also render the report in PDF which works in both apps.
Chadley08
  • 559
  • 1
  • 8
  • 26

1 Answers1

2

Telerik Reporting engine throws such an exception when it can't resolve a required dependency for the target format, but the XLS exporting routines are embedded in Telerik.Reporting.dll so it's not likely that you're missing an assembly file. XLS rendering also doesn't have any external dependencies in contrast with XLSX rendering, which requires DocumentFormat.OpenXml.dll. You'll have to collect more information about the exception to see what causes the problem. Usually helps to attach a trace listener to your application and examine its logs to see the exception stack trace or another important details. Another option is to use the Assembly Binding Log Viewer that displays information for assembly binds and see if its log will give you any hint about what's happening. Please note that the product requirements include .NET Framework 4+ Full Profile and consider if it's applicable to your scenario.

user1659955
  • 133
  • 1
  • 4