SubReport UseExternalReport

Stimulsoft Reports.Silverlight discussion
Locked
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

SubReport UseExternalReport

Post by tpontow »

Hello,

is it true that

Code: Select all

StiSubReport.UseExternalReport = true 
does not work in Silverlight? No chance of loading a subreport from another report design file at runtime?

Regards
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: SubReport UseExternalReport

Post by Alex K. »

Hello,

Please check the following code as example:

Code: Select all

private void button1_Click(object sender, RoutedEventArgs e)
{
StiReport report = null;
var sr = Assembly.GetExecutingAssembly().GetManifestResourceStream("SilverlightApplication1.Report1SubReport.mrt");

report = new StiReport();
report.GetSubReport += new StiGetSubReportEventHandler(report_GetSubReport);
report.Load(sr);

sr.Close();
sr.Dispose();

report.Render();
report.Show();
}

private void report_GetSubReport(object sender, StiGetSubReportEventArgs e)
{
StiReport report = null;
var sr = Assembly.GetExecutingAssembly().GetManifestResourceStream("SilverlightApplication1.Report2SubReport.mrt");

report = new StiReport();
report.GetSubReport += new StiGetSubReportEventHandler(report_GetSubReport);
report.Load(sr);

sr.Close();
sr.Dispose();

e.Report = report;
}
Thank you.
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: SubReport UseExternalReport

Post by tpontow »

Hello Aleksey,

your code works for Forms and Wpf but not for Silverlight. I did it a similar way but i used the OnGetSubReport() method which i have overwritten. But both ways did not work in Silverlight.

Thank you
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: SubReport UseExternalReport

Post by tpontow »

Hello,

it looks as if i have some timing/synchronization problems in my application. I will have a deeper look on that and will come back later with more detailed information.

Thank you
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: SubReport UseExternalReport

Post by Alex K. »

Hello,

Ok.
Let us know if you have any additional information.

Thanky ou.
Locked