Print button on viewer

Stimulsoft Reports.WPF discussion
rbajaj
Posts: 6
Joined: Thu Apr 26, 2012 3:11 pm
Location: USA

Print button on viewer

Post by rbajaj »

Hi:
I am trying to display a report in the browser.

I am using the following code:

StiReport report = new StiReport();
report.Load(@"C:\\Reports\\samplereport.mrt");
report.RenderWithWpf(true);
RptViewer.Report = report;

When I try to use the report viewer Print button; I get the following error message
InvalidOperationException was unhandled
"Cannot change MainWindow in a browser-hosted application."

Also, the Close button performs no action!
Attachments
1807.Stimulsoft-print error.jpg
1807.Stimulsoft-print error.jpg (33.78 KiB) Viewed 4789 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Print button on viewer

Post by HighAley »

Hello.
rbajaj wrote:I am trying to display a report in the browser.

I am using the following code:

StiReport report = new StiReport();
report.Load(@"C:\\Reports\\samplereport.mrt");
report.RenderWithWpf(true);
RptViewer.Report = report;

When I try to use the report viewer Print button; I get the following error message
InvalidOperationException was unhandled
"Cannot change MainWindow in a browser-hosted application."

Also, the Close button performs no action!
Did you set "Full trast application" mode?
If yes then send us your project for analysis.

Thank you.
rbajaj
Posts: 6
Joined: Thu Apr 26, 2012 3:11 pm
Location: USA

Print button on viewer

Post by rbajaj »

Yes, I am running in full trust mode.
Attachments
1815.trust level.jpg
1815.trust level.jpg (50.05 KiB) Viewed 4770 times
Anton Lozovskiy
Posts: 135
Joined: Tue Aug 11, 2009 9:38 am

Print button on viewer

Post by Anton Lozovskiy »

Hello,

Can you please send us a simple test application, which reproduce the issue?

Thank you.
rbajaj
Posts: 6
Joined: Thu Apr 26, 2012 3:11 pm
Location: USA

Print button on viewer

Post by rbajaj »

Hello:
I just created a test application which works fine! So I need to dig in deeper into our app. to see what's going on.

Thanks for your response.

Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Print button on viewer

Post by Alex K. »

Hello,

Ok.
Let us know if you need any additional help.

Thank you.
rbajaj
Posts: 6
Joined: Thu Apr 26, 2012 3:11 pm
Location: USA

Print button on viewer

Post by rbajaj »

Hello:
This error happens in a browser hosted application. I had previously created a standalone application in which the Print seemed to work correctly.
I am attaching a sample solution to reproduce this error
Attachments
1939.WpfBrowserApplication1.zip
(98.04 KiB) Downloaded 300 times
1933.Print Error.zip
(16.23 KiB) Downloaded 236 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Print button on viewer

Post by Alex K. »

Hello,

Please check your attachment. It is contains only .sln file.

Thank you.
rbajaj
Posts: 6
Joined: Thu Apr 26, 2012 3:11 pm
Location: USA

Print button on viewer

Post by rbajaj »


Oops! sorry about that. I uploaded another zip file. The report is in the original zip file.
Anton Lozovskiy
Posts: 135
Joined: Tue Aug 11, 2009 9:38 am

Print button on viewer

Post by Anton Lozovskiy »

Hello,

The problem is fixed. The patch is available in prerelease build of on 21 June 2012.

Thank you.
Post Reply