Page 1 of 2

Print button on viewer

Posted: Thu Apr 26, 2012 3:20 pm
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!

Print button on viewer

Posted: Fri Apr 27, 2012 5:36 am
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.

Print button on viewer

Posted: Fri Apr 27, 2012 11:01 am
by rbajaj
Yes, I am running in full trust mode.

Print button on viewer

Posted: Sat Apr 28, 2012 2:00 am
by Anton Lozovskiy
Hello,

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

Thank you.

Print button on viewer

Posted: Thu May 03, 2012 10:53 am
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.


Print button on viewer

Posted: Fri May 04, 2012 6:19 am
by Alex K.
Hello,

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

Thank you.

Print button on viewer

Posted: Tue Jun 12, 2012 11:45 am
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

Print button on viewer

Posted: Wed Jun 13, 2012 7:20 am
by Alex K.
Hello,

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

Thank you.

Print button on viewer

Posted: Wed Jun 13, 2012 11:24 am
by rbajaj

Oops! sorry about that. I uploaded another zip file. The report is in the original zip file.

Print button on viewer

Posted: Thu Jun 14, 2012 1:56 pm
by Anton Lozovskiy
Hello,

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

Thank you.