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

ArgumentNull Exception when attempting to export report to any format WPF Report Viewer

3 Answers 21 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Franklin
Top achievements
Rank 1
Franklin asked on 01 Nov 2017, 02:53 PM

I am getting the following exception when attempting to export a report from WPF Report Viewer to any format in the pull down list:

System.ArgumentNullException was unhandled by user code
  HResult=-2147467261
  Message=Value cannot be null.
Parameter name: format
  Source=mscorlib
  ParamName=format
  StackTrace:
       at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
       at System.String.Format(String format, Object arg0)
       at Telerik.ReportViewer.Wpf.ReportViewerModel.ExportReport(String format, Hashtable deviceInfo)
       at Telerik.ReportViewer.Wpf.ReportViewerModel.set_SelectedRenderingExtension(RenderingExtension value)
  InnerException:

 

I'm not sure when this started. Has anyone else seen this problem?

Thanks

3 Answers, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 06 Nov 2017, 10:04 AM
Hi Franklin,

This is not a known issue.

Have you upgraded to a newer version recently? If yes, test running Telerik Reporting Upgrade Wizard to make sure that the project was updated correctly. Telerik UI WPF assemblies need to be updated manually - Manual Setup. Telerik Reporting is built with the version of Telerik UI Controls for WPF which is available at the time of the release - Upgrade Path.

We can provide more accurate suggestions after reviewing a sample project that reproduces the issue.


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
Franklin
Top achievements
Rank 1
answered on 06 Nov 2017, 06:10 PM

Katia,

Thanks for your reply. I found the cause of the issue was the existence of a custom Telerik.ReportViewer.WPF.TextResources file in which I attempted to rename the "Preview" button to "Refresh." The problems seems to be that the existence of this file causes the report viewer to use the file for all string resources and when attempting to export a report to PDF, for example, the "PDF" string is never found and a null is passed to String.Format referenced in my original post. I would like to rename the "Preview" button but not at the expense of breaking everything else.

Do you know of a solution that allows me to rename "Preview" in the report viewer and still retain export functionality?

Thanks,

Franklin

0
Katia
Telerik team
answered on 09 Nov 2017, 05:08 PM
Hello Franklin,

Based on the additional information you provided, it seems that some of the properties of the TextResources Class are not set. Make sure that you set all of the available properties, check Report Viewer Localization help article for more detailed information.

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
Franklin
Top achievements
Rank 1
Answers by
Katia
Telerik team
Franklin
Top achievements
Rank 1
Share this question
or