Page 1 of 1

Generating WPF Reports with a service

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

Re: Generating WPF Reports with a service

Posted: Mon Jul 30, 2018 9:55 am
by Lech Kulikowski
Hello,

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

Thank you.

Re: Generating WPF Reports with a service

Posted: Mon Aug 13, 2018 8:39 am
by Nick - BIG VZW
Hi,

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

Nick

Re: Generating WPF Reports with a service

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

Re: Generating WPF Reports with a service

Posted: Tue Aug 14, 2018 12:19 pm
by Lech Kulikowski
Hello,

We need some time to check the issue.

Thank you.

Re: Generating WPF Reports with a service

Posted: Mon Aug 27, 2018 7:56 am
by Lech Kulikowski
Hello,

Please try to add assemblies to the GAC.

Thank you.

Re: Generating WPF Reports with a service

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

Re: Generating WPF Reports with a service

Posted: Mon Sep 17, 2018 12:43 pm
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.

Re: Generating WPF Reports with a service

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

Re: Generating WPF Reports with a service

Posted: Fri Oct 05, 2018 6:34 am
by Lech Kulikowski
Hello,

Thank you for the workaround.