I'm developing an AJAX-enabled web application. In one of my pages, I try to export a report to PDF format. I don't show the report on the web page, I just export it directly to be printed.
However, if I do this directly from my page, it won't work because this is not compatible with AJAX. So, I made the print button to open a pop-up window (by using the window.open javascript function and calling it from server side.)
And at the page load of the pop up page, I export the report. However, the problem that happens is that the pop up page closes immediately after being opened. I tried to disable the pop up blocker in my IE8 but this didn't work.
I think we cant prog disable pop up blockers.. Or plz wait for other answers. Or try, After export, Response.Write("-script language='javascript'-window.print();-/script-");
Mark as Answer, on the posts replys that helped you !!!.
I don't mean to disable the pop-up blocker programatically. As I said in my previous post. I did disable the pop-up blocker manually. However, the problem continued to occur. So, it seems that it's not a matter of pop-up blocking.
I debugged the pop up page load, but there's no errors or exceptions that appear at all. It goes fine through all the lines until the last one, and then it closes it gives that sound like if a pop-up is caught by the browser.
Please note that when I place a button inside the pop up page and let the user click it to export the report instead of exporting it at page load, it works fine. However, I think that letting it be exorted at page load is more user friendly.
net fan
Member
549 Points
189 Posts
Disable Pop-Up blocker to print report
Aug 16, 2009 05:37 PM|LINK
Hi All,
I'm developing an AJAX-enabled web application. In one of my pages, I try to export a report to PDF format. I don't show the report on the web page, I just export it directly to be printed.
However, if I do this directly from my page, it won't work because this is not compatible with AJAX. So, I made the print button to open a pop-up window (by using the window.open javascript function and calling it from server side.)
And at the page load of the pop up page, I export the report. However, the problem that happens is that the pop up page closes immediately after being opened. I tried to disable the pop up blocker in my IE8 but this didn't work.
Any help is really appreciated.
print AJAX popup page_load ie8 report blocker
suthish nair
All-Star
15176 Points
3304 Posts
Re: Disable Pop-Up blocker to print report
Aug 16, 2009 06:21 PM|LINK
My Blog
net fan
Member
549 Points
189 Posts
Re: Disable Pop-Up blocker to print report
Aug 16, 2009 06:35 PM|LINK
Thanks suthish,
I don't mean to disable the pop-up blocker programatically. As I said in my previous post. I did disable the pop-up blocker manually. However, the problem continued to occur. So, it seems that it's not a matter of pop-up blocking.
Any ideas on why this is happening?
Thanks in advance,
suthish nair
All-Star
15176 Points
3304 Posts
Re: Disable Pop-Up blocker to print report
Aug 16, 2009 07:04 PM|LINK
My Blog
net fan
Member
549 Points
189 Posts
Re: Disable Pop-Up blocker to print report
Aug 16, 2009 11:10 PM|LINK
Hi suthish,
I debugged the pop up page load, but there's no errors or exceptions that appear at all. It goes fine through all the lines until the last one, and then it closes it gives that sound like if a pop-up is caught by the browser.
Here's how I export my report:
// Read query string CrystalDecisions.CrystalReports.Engine.ReportDocument doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); string path = "report path"; doc.Load(path); doc.SetDatabaseLogon("db user name", "db password"); doc.SetParameterValue("parameter name", parameter_value); doc.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "ExportedReport");Please note that when I place a button inside the pop up page and let the user click it to export the report instead of exporting it at page load, it works fine. However, I think that letting it be exorted at page load is more user friendly.
Thanks
suthish nair
All-Star
15176 Points
3304 Posts
Re: Disable Pop-Up blocker to print report
Aug 17, 2009 06:25 AM|LINK
similar issue, with solution. please check:
http://forums.asp.net/t/1045910.aspx
more examples:
http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-print.htm
http://www.codeproject.com/KB/cs/Crystal_Report_Export.aspx?display=Print
My Blog