Pre loader

ExportToXps produces blank image

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi,

I’m trying to export my graphs using the XamlRenderSurface and the ExportToXPS extension function.

I can export a BitmapImage from it fine but the xps image only has the Axis lines and a vertical annotation on it. See images for comparison.

Also, it outright crashes in some other graphs I have on Get MinorDelta because of a null reference exception, no additional info is given out by DebugWhySciCharDoesntRender = true. Likewise in this case, I can export to bitmap just fine. I am using custom tick providers.

I should also note that I’m rendering the charts from memory they’re not visually displayed when export them.

Version
4.2.2.9777
Images
  • You must to post comments
0
0

Hi Kewur,

SciChartSurface.ExportToXps(string filePath) internally calls SciChartSurface.ExportToFile(filePath, ExportType.Xps, true).

The signature for ExportToFile is

    /// <summary>
    /// Saves snapshot of current <see cref="SciChartSurfaceBase"/> to file
    /// </summary>
    /// <param name="fileName">The Filename to save to</param>
    /// <param name="exportType">Defines format of file to export</param>
    /// <param name="useXamlRenderSurface">Defines better quality of export output</param>
    public virtual void ExportToFile(string fileName, ExportType exportType, bool useXamlRenderSurface) { } 

If the parameter useXamlRenderSurface is TRUE (it is, from ExportToXps) then SciChart uses the XamlRenderSurface intenrally.

I checked and your license type (SciChart WPF 2D Pro) does not include a license for this feature. The XamlRenderSurface is only available in SciChart WPF 2D Enterprise or SciChart WPF SDK Professional.

Can you try this code instead?

 string fileName;
 sciChartSurface.ExportToFile(filename, ExportType.Xps, false);

If you still experience problems, please submit a support ticket including code to reproduce the issue. We will investigate.

Best regards,
Andrew

  • kewur
    Hi Andrew, I requested an extension to my trial for enterprise to test the xps exports. I tried with the alternative but it produces the same result as before. I will try to make a project reproducing the issue.
  • Andrew Burnett-Thompson
    You can check trial is applied correctly by setting SciChartSurface.RenderSurface = new XamlRenderSurface(). If the chart in your app goes blank, then its not applied.
  • kewur
    Yes it is applied, just tested it.
  • Andrew Burnett-Thompson
    Thanks for checking! Please send some code over, we will investigate asap.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies