Page 1 of 1
What to use instead of UseExternalReport
Posted: Wed Oct 15, 2014 11:48 am
by tpontow
Hello,
i have reports dynamically created in C# code. In there i also create subreport controls and link them to pages in the report where the subreport is build. So no subreport from external file is used. Everything works fine until i now upgraded to version 2014.2. I saw that the use of
is obsolete. In code i saw that is set fix to false.
So since 2014.2 the rendering process always tries to load my internal subreport from external files instead from the internal pages.
Any suggestions what i have to change in my code? How can i get the rendering process to use my internal subreport now?
Thanks and kind regards
Thorsten Pontow
Re: What to use instead of UseExternalReport
Posted: Wed Oct 15, 2014 2:03 pm
by tpontow
Ok, i found out that there is a new method
Code: Select all
StiSubReport.GetExternalSubReport()
which is called everytime. In my own StiReport-Subclass i have overwritten the following method which i calles then:
Code: Select all
protected override void OnGetSubReport(StiGetSubReportEventArgs e)
In that method i try to load from a file. but that is not what i want if have an internal subreport only. So how can i supress the call of GetExternalSubReport()? UseExternalReport-Flag is not used anymore unfortunately.
Re: What to use instead of UseExternalReport
Posted: Wed Oct 15, 2014 2:45 pm
by tpontow
I found a solution or at least a workaround for my problem. In my specialized StiReport subclass for my code generated report i overwrote method
with empty body. With that it masks the OnGetSubReport() method in my own base StiReport-subclass which tries to load subreport from file. That's not the nicest solution but it is a solution for me now

Re: What to use instead of UseExternalReport
Posted: Thu Oct 16, 2014 12:30 pm
by HighAley
Hello.
Why did you use UseExternalReport() while you don't use external sub-report?
You shouldn't subscribe on GetSubReport event.
Could you specify how do you create sub-reports?
Thank you.
Re: What to use instead of UseExternalReport
Posted: Thu Oct 16, 2014 12:54 pm
by tpontow
Hello Aleksey,
the core of my problem simply was that in earlier versions of Stimulsoft.StiReport the GetSubReport event was fired only if there was a subreport component with no own report page but with external mrt-file. And now that event fires also for an internal subreport with own page.
I needed to override OnGetSubReport() because i don't open a file directly but load the subreport with memory stream from a database or some own business objects.
I now solved the problem by checking myself for internal subreports (with own page and no external mrt-file) and then leave the OnGetSubReport() method.
Kind regards
Thorsten Pontow
Re: What to use instead of UseExternalReport
Posted: Fri Oct 17, 2014 11:08 am
by HighAley
Hello, Thorsten.
Thank you for the description. We will check this issue.
Let us know if you need any additional help.
Thank you.