Generating WPF Reports with a service

Stimulsoft Reports.WPF discussion
Post Reply
Nick - BIG VZW
Posts: 15
Joined: Fri Mar 04, 2016 9:25 am

Generating WPF Reports with a service

Post by Nick - BIG VZW »

Hi,

When i call the report.RenderWithWPF() function in a service i get the following error:
StiRenderProviderV2: Method : [GetPainter] : StiPainter for 'Stimulsoft.Report.Components.StiText' is not found!
full error log in attachement:
StimulsoftReport.log
(11.43 KiB) Downloaded 215 times

Code:
Report.Load(Path.Combine(TemplatePath, TemplateFile));
Report.Dictionary.Databases.Clear();
Report.RegData("tdsReportData", ReportData);
Report.RenderWithWpf(false);

  • This error occurs with all our mrt files.
  • I have tried this with version 2017.1.4 and 2018.2.3 but got the same results.
  • The mrt files are generated without any problems in the WPF designer and from code in a WPF application.
  • If i call report.Render() everything works as expected, but all our other documents are generated with WPF and we would like to use the same method everywhere.

Is it possible to call RenderWithWPF from a non WPF application?
Or am i just doing something wrong?

Thanks,
Nick
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Generating WPF Reports with a service

Post by Lech Kulikowski »

Hello,

Please send us a simple project which reproduces the issue for analysis.

Thank you.
Nick - BIG VZW
Posts: 15
Joined: Fri Mar 04, 2016 9:25 am

Re: Generating WPF Reports with a service

Post by Nick - BIG VZW »

Hi,

I included the sample project.
Sorry it took so long to respond.

Nick
Nick - BIG VZW
Posts: 15
Joined: Fri Mar 04, 2016 9:25 am

Re: Generating WPF Reports with a service

Post by Nick - BIG VZW »

Hi,

Adding the project as a attachment or sending it by mail failed.
I hope a WE transfer link is ok...


Thanks,

Nick
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Generating WPF Reports with a service

Post by Lech Kulikowski »

Hello,

We need some time to check the issue.

Thank you.
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Generating WPF Reports with a service

Post by Lech Kulikowski »

Hello,

Please try to add assemblies to the GAC.

Thank you.
Nick - BIG VZW
Posts: 15
Joined: Fri Mar 04, 2016 9:25 am

Re: Generating WPF Reports with a service

Post by Nick - BIG VZW »

Hi,

I tried your solution, but it didn't work for me.

If you call the following line of code in a Class Library which references the stimulsoft wpf dll's you get the error as mentioned above:
StiPainter stiPainter = StiPainter.GetPainter(typeof(Stimulsoft.Report.Components.StiText), Stimulsoft.Base.StiGuiMode.Wpf);

The project will build correctly, so the problem is not a missing reference.

If "Report.RenderWithWPF" can not be called from a class library (so without a UI) we will use the "Report.Render" method.
But this solution will require us to change lots of other related things and is therefore a last resort for us.

Thanks for your help so far,
Nick
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Generating WPF Reports with a service

Post by Lech Kulikowski »

Hello,

We couldn't reproduce the issue when assemblies are installed in the GAC.

Please send us a simple project which reproduces the issue for analysis on support@stimulsoft.com.

thank you.
Nick - BIG VZW
Posts: 15
Joined: Fri Mar 04, 2016 9:25 am

Re: Generating WPF Reports with a service

Post by Nick - BIG VZW »

Hi,

Finally had some time to revisit this issue.
Turn out you were right.

To call the RenderWithWpf() method you needs the Stimulsoft.report.wpf dll.
But it gets optimized away on build time if you do not place a direct call the the dll.

So instead of adding it to the GAC, i made the below addition to my code:
var DoNotRemoveMePlease = new Stimulsoft.Report.Wpf.YearValidation();

Thanks for your assistence,
Nick
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Generating WPF Reports with a service

Post by Lech Kulikowski »

Hello,

Thank you for the workaround.
Post Reply