sir i am using exporting report in pdf or excel format. it was working fine.
afterthat i used update progress there. but after using this it's generating this error:
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is
enabled.
Details: Error parsing near '%PDF-1.3%
It is not a good practice to use Response.Write from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
I found a blog by a microsoft comminity refer to this aspect. Please check it.(there is in the some replies in this link)
in my case wat is happening i am generating report through modalpopup means when user click on generate report button one modal popup is coming there has two radio button list export to excel and export to pdf and one button.
when i am selecting any of choice and click button then it's generating the report.
but some report has hugh data so it's taking some more seconds to export so in this case i want to use progress bar in my screen.
so that user should know that process is going on.
before i was using Async postback trigger in update panel this was working for me.
but when i used updateprogress so in this and postback trigger both are not working for me.
and without using trigger i am using export so report is not genearating and the same problem i am facing.
tell me some ideas on how to use http handler or how to use post back trigger for update progress.
i am generating report through modalpopup means when user click on generate report button one modal popup is coming there has two radio button list export to excel and export to pdf and one button.
when i am selecting any of choice and click button then it's generating the report.
but some report has hugh data so it's taking some more seconds to export so in this case i want to use progress bar in my screen.
so that user should know that process is going on.
before i was using Async postback trigger in update panel this was working for me.
and here is my exact error.
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is
enabled.
Details: Error parsing near '%PDF-1.3%
but when i used updateprogress so in this and postback trigger both are not working for me.
and without using trigger i am using export so report is not genearating and the same problem i am facing.
tell me some ideas on how to use http handler or how to use post back trigger for update progress.
Protected Sub btnExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExcel.Click
Dim ds As New MonthlyReportTableAdapters.DataTable1TableAdapter()
Dim rds As New ReportDataSource("MonthlyReport_DataTable1", ds.GetData())
Dim viewer As New ReportViewer()
viewer.ProcessingMode = ProcessingMode.Local
viewer.LocalReport.ReportPath = "TestMonthly.rdlc"
viewer.LocalReport.DataSources.Add(rds)
Dim warnings As Warning()
Dim streamids As String()
Dim mimeType As String = String.Empty
Dim encoding As String = String.Empty
Dim extension As String = String.Empty
Dim bytes As Byte() = viewer.LocalReport.Render("PDF", Nothing, mimeType, encoding, extension, streamids, _
warnings)
Response.Buffer = True
Response.Clear()
Response.ContentType = mimeType
Response.AddHeader("content-disposition", "attachment; filename=" & filename & "." & extension)
Response.BinaryWrite(bytes)
Response.End()
End Sub
so after that i am getting this error:-
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters,
HttpModules, or server trace is enabled.
Details: Error parsing near '%PDF-1.3%
1 0 obj '.
vicky1
Member
32 Points
349 Posts
how to use update progress when exporting report in pdf or excel format?
Aug 17, 2012 12:27 PM|LINK
Hai all,
Hope doing well,
sir i am using exporting report in pdf or excel format. it was working fine.
afterthat i used update progress there. but after using this it's generating this error:
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '%PDF-1.3%
how to resolve from this.
plz help me.
it's urgent waiting for reply.
thanks in advance.
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: how to use update progress when exporting report in pdf or excel format?
Aug 20, 2012 03:36 AM|LINK
Hi
It is not a good practice to use Response.Write from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
I found a blog by a microsoft comminity refer to this aspect. Please check it.(there is in the some replies in this link)
http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx
http://alpascual.com/blog/al/archive/2007/04/26/How-to-fix-Sys.WebForms.PageRequestManagerParserErrorException-in-AJAX.aspx.
You can use this http://mattberseth.com/blog/2007/07/modalpopup_as_an_ajax_progress.html
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
vicky1
Member
32 Points
349 Posts
Re: how to use update progress when exporting report in pdf or excel format?
Aug 20, 2012 09:17 AM|LINK
Hi sir,
in my case wat is happening i am generating report through modalpopup means when user click on generate report button one modal popup is coming there has two radio button list export to excel and export to pdf and one button.
when i am selecting any of choice and click button then it's generating the report.
but some report has hugh data so it's taking some more seconds to export so in this case i want to use progress bar in my screen.
so that user should know that process is going on.
before i was using Async postback trigger in update panel this was working for me.
but when i used updateprogress so in this and postback trigger both are not working for me.
and without using trigger i am using export so report is not genearating and the same problem i am facing.
tell me some ideas on how to use http handler or how to use post back trigger for update progress.
thanks in advance.
Song-Tian - ...
All-Star
43705 Points
4304 Posts
Microsoft
Re: how to use update progress when exporting report in pdf or excel format?
Aug 21, 2012 06:55 AM|LINK
Hi,
What is the problem when you using updateprogress?
For details of updateprogress, please refer to: http://msdn.microsoft.com/en-us/library/bb398821(v=vs.100).
Feedback to us
Develop and promote your apps in Windows Store
vicky1
Member
32 Points
349 Posts
Re: how to use update progress when exporting report in pdf or excel format?
Aug 21, 2012 07:14 AM|LINK
Hi sir,
here is my issues in details:
i am generating report through modalpopup means when user click on generate report button one modal popup is coming there has two radio button list export to excel and export to pdf and one button.
when i am selecting any of choice and click button then it's generating the report.
but some report has hugh data so it's taking some more seconds to export so in this case i want to use progress bar in my screen.
so that user should know that process is going on.
before i was using Async postback trigger in update panel this was working for me.
and here is my exact error.
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '%PDF-1.3%
but when i used updateprogress so in this and postback trigger both are not working for me.
and without using trigger i am using export so report is not genearating and the same problem i am facing.
tell me some ideas on how to use http handler or how to use post back trigger for update progress.
thanks in advance.
Song-Tian - ...
All-Star
43705 Points
4304 Posts
Microsoft
Re: how to use update progress when exporting report in pdf or excel format?
Aug 21, 2012 08:39 AM|LINK
Hi,
Please post the related code. So I may reproduce your scenario on my side.
Feedback to us
Develop and promote your apps in Windows Store
vicky1
Member
32 Points
349 Posts
Re: how to use update progress when exporting report in pdf or excel format?
Aug 25, 2012 04:23 AM|LINK
Here is my design code:
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<%-- <asp:Image ID="Img" ImageUrl="~/AjaxProgressBig.gif" AlternateText="Processing" runat="server" /> --%>
<div style="background-color:Black; filter:alpha(opacity=60); opacity:0.80; width: 100%; top: 0px; left: 0px; position: fixed; height: 100%;">
</div>
<div style="margin:auto;
font-family:Trebuchet MS;
filter: alpha(opacity=100);
opacity: 1;
font-size:small;
vertical-align: middle;
top: 40%;
position: fixed;
right: 42%;
color: #275721;
text-align: center;
background-color: White;
height: 80px;">
<table style=" background-color: White; font-family: Sans-Serif; text-align: center; border: solid 1px #275721; color: #275721; width: inherit; height: inherit; padding: 15px; border-color:#67CFF5;">
<tr>
<%-- <td style="text-align: inherit;"><asp:Image ID="Image1" runat="server" ImageUrl="~/loader.gif" /></td>--%>
<td style=" text-align: inherit;"><span style="font-family: Sans-Serif; font-size: medium; font-weight: bold; font">Request is in process...</span></td>
</tr>
</table>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<%-- <Triggers>
<asp:PostBackTrigger ControlID="btnExcel" />
</Triggers>--%>
<ContentTemplate>
<asp:Panel ID="Panel3" runat="server" Width="300px">
<div>
<table style="width:100%; background-color:White;">
<tr>
<td colspan="2" align="center">
<asp:Image ID="Image2" runat="server" ImageUrl="~/Images/SecurAx1.jpg" />
</td>
<td valign="top">
<asp:ImageButton ID="BtnClose" runat="server" ImageUrl="~/images/CrossImage.jpg" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Label ID="Label1" runat="server" Text="Export Report" CssClass="printformat"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label3" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td align="center">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" CssClass="textbox150">
<asp:ListItem>Export To Excel</asp:ListItem>
<asp:ListItem>Export To Pdf</asp:ListItem>
</asp:RadioButtonList>
</td>
<td>
<fieldset>
<asp:Button ID="btnExcel" runat="server" Text="Export" CssClass="button_57" OnClientClick="hidePopup();" />
</fieldset>
</td>
</tr>
<tr>
<td align="center">
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label4" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label5" runat="server" Text=""></asp:Label>
<asp:Label ID="Label6" runat="server" Text=""></asp:Label>
</td>
</tr>
</table>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BehaviorID="Modal1" TargetControlID="BtnShow" PopupControlID="Panel3" BackgroundCssClass="modalpopup" CancelControlID="BtnClose">
</asp:ModalPopupExtender>
And here is my page behind code:
Protected Sub btnExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExcel.Click
Dim ds As New MonthlyReportTableAdapters.DataTable1TableAdapter()
Dim rds As New ReportDataSource("MonthlyReport_DataTable1", ds.GetData())
Dim viewer As New ReportViewer()
viewer.ProcessingMode = ProcessingMode.Local
viewer.LocalReport.ReportPath = "TestMonthly.rdlc"
viewer.LocalReport.DataSources.Add(rds)
Dim warnings As Warning()
Dim streamids As String()
Dim mimeType As String = String.Empty
Dim encoding As String = String.Empty
Dim extension As String = String.Empty
Dim bytes As Byte() = viewer.LocalReport.Render("PDF", Nothing, mimeType, encoding, extension, streamids, _
warnings)
Response.Buffer = True
Response.Clear()
Response.ContentType = mimeType
Response.AddHeader("content-disposition", "attachment; filename=" & filename & "." & extension)
Response.BinaryWrite(bytes)
Response.End()
End Sub
so after that i am getting this error:-
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '%PDF-1.3%
1 0 obj '.
please help me. how to resolve this issue?
thanks