This is a migrated thread and some comments may be shown as answers.

reportProcessor.RenderReport("XLS", ...) throws "XLS rendering format is not available" only when running via Edge.js

3 Answers 634 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 25 Oct 2017, 10:21 PM

I have an expression like reportProcessor.RenderReport("XLS", ...) which always throws an exception with message "XLS rendering format is not available" when running in Edge.js via an Electron app, but never throws when running "normally" via a WinForms app. Same assembly, same code, but different behavior.

Stack trace for the exception:

   at Telerik.Reporting.Processing.ReportProcessor.GetExtensionInfo(String format)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo)
   at [my code]

Other details about the environment:

Telerik.Reporting.dll, version 9.2.15.930

Windows 10

Excel 2016

 

What kind of conditions would cause XLS rendering to be unavailable?

It's probably important to note that this same body of code has an expression like reportProcessor.RenderReport("PDF", ...) which works totally correctly with both the Edge.js-based Electron app and the WinForms app. This expression executes a few statements before the one for XLS that fails.

I checked that the app domains of both apps are running with full trust because I suspected there might be a lack of unmanaged code permissions, but that's apparently not the problem. Both domains have full trust.

3 Answers, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 30 Oct 2017, 02:18 PM
Hello William,

Telerik Reporting engine throws such 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 it 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.
Note that the product requirements include .NET Framework 4+ Full Profile and consider if it's applicable to your scenario.

I hope this information will help.


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
William
Top achievements
Rank 1
answered on 01 Nov 2017, 06:09 PM

I configured a trace listener and got something very unexpected. When running in Edge.js, an error is logged from RenderReport("PDF", ...), before RenderReport("XLS", ...) ever executes. Here is the full trace:

*** ReportProcessor.ProcessReport STARTED ***

*** ProcessReport #0 STARTED ***
Bindings error - ErrorCode: InvocationError; Telerik.Reporting.Processing.PropertyOperationsException: An error occurred while invoking the setter on property 'Height' with value '1px' ---> System.InvalidCastException: Specified cast is not valid.
   at lambda_method(Closure , Object , Object )
   at Telerik.Reporting.Processing.PropertyOperationsHandler.SetPropertyValue(PropertyInfo property, Object leafTarget, Object value)
   --- End of inner exception stack trace ---
   at Telerik.Reporting.Processing.PropertyOperationsHandler.SetPropertyValue(PropertyInfo property, Object leafTarget, Object value)
   at Telerik.Reporting.Processing.ProcessingElement.ApplyBindings(IEnumerable`1 bindings)
*** ProcessReport #0 DONE in 00:00:01.9733623 ***

*** ReportProcessor.ProcessReport DONE in 00:00:01.9804408 ***


*** RenderReport #0 STARTED ***
*** RenderReport #0 DONE in 00:00:00.9761727 ***

This error does not appear in the trace when executing via our WinForms app.

After this error occurs, when RenderReport("XLS", ...) is executed and fails, no further trace content of any kind appears even though it throws the previously posted exception.

When I remove the RenderReport("PDF", ...) expression and re-run, the RenderReport("XLS", ...) expression still fails, and this time the trace is totally empty.

The assembly binding log viewer never shows any entries during any reproduction of this error.

0
Katia
Telerik team
answered on 06 Nov 2017, 12:08 PM
Hello William,

The error during the PDF export operation is related to the invalid property binding. When setting the value of the property to a string literal you can use double or single quotes, for example:
Property path: Height
Expression: '1px'

However, this error should not be connected to another one you receive about XLS format not being available. Unfortunately, without any details about the error and without being able to reproduce it on our side we can only guess what could have caused it. Furthermore, it might be caused by some specifics of your environment which we are not aware of.
We can provide further suggestions after reviewing a sample that reproduces the problematic behavior.


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
William
Top achievements
Rank 1
Answers by
Katia
Telerik team
William
Top achievements
Rank 1
Share this question
or