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 » Fri Jul 27, 2018 7:19 am

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 12 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: 682
Joined: Tue Mar 20, 2018 5:34 am

Re: Generating WPF Reports with a service

Post by Lech Kulikowski » Mon Jul 30, 2018 9:55 am

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 » Mon Aug 13, 2018 8:39 am

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 » Tue Aug 14, 2018 8:42 am

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: 682
Joined: Tue Mar 20, 2018 5:34 am

Re: Generating WPF Reports with a service

Post by Lech Kulikowski » Tue Aug 14, 2018 12:19 pm

Hello,

We need some time to check the issue.

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

Re: Generating WPF Reports with a service

Post by Lech Kulikowski » Mon Aug 27, 2018 7:56 am

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 » Wed Sep 12, 2018 11:10 am

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: 682
Joined: Tue Mar 20, 2018 5:34 am

Re: Generating WPF Reports with a service

Post by Lech Kulikowski » Mon Sep 17, 2018 12:43 pm

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 » Wed Oct 03, 2018 9:58 am

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: 682
Joined: Tue Mar 20, 2018 5:34 am

Re: Generating WPF Reports with a service

Post by Lech Kulikowski » Fri Oct 05, 2018 6:34 am

Hello,

Thank you for the workaround.
Post Reply