Last post Mar 19, 2011 09:09 PM by nguyen190887
Mar 16, 2011 12:30 AM|nguyen190887|LINK
ReportViewer control. Everything works well in my pc (Windows XP, IIS 5.1).
However, when I deploy the code to app server (Windows 2k3, IIS 6), I encounter a critical issue. After the report window is opened, whenever I click a button or change value of a DropDownList (UpdatePanel will be reloaded after these actions), an exception
"Failed to load viewstate" is thrown.
I've tried to update the Report Viewer Redistributable 2005 (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e7d661ba-dc95-4eb3-8916-3e31340ddc2c) in the server to SP1 (assembly version: 8.0.50727.817), but the issue was still there.
Please help me to resolve this issue. Thanks!
Mar 16, 2011 03:35 AM|nguyen190887|LINK
I also post the code for binding data to report
dtSource = new ReportDataSource(ReportDataSourceName, dt);
DataView dv = dt.DefaultView;
dv.Sort = SortField;
dtSource = new ReportDataSource(ReportDataSourceName, dv);
Mar 16, 2011 04:44 AM|Nishantg|LINK
The code you have given is seems to be fine. The error you are getting is because when page is refreshing its not able to load the values from viewstate for the controls available in your page. So please look into your asp.net page & code.
Mar 16, 2011 06:24 AM|nguyen190887|LINK
Thanks for your reply, but as I mentioned, the report is opened in a separated window. Its code completely does not relate to the code of main page. When the report is not opened, the main page still works well.
Also, since the code works in local environment, I think maybe there is a difference in config between local and server environment (but I don't know exactly what it is).
Mar 17, 2011 03:09 AM|Nishantg|LINK
Can you please post the whole code for the Report page, I mean the html and the code behind both.
Mar 17, 2011 07:31 AM|nguyen190887|LINK
This is the code for Report page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AllItemDetailsReport.aspx.cs"
Inherits="Reports_AllItemDetailsReport" MasterPageFile="~/MasterPages/Report.master" %>
<asp:Content ID="ctMain" runat="server" ContentPlaceHolderID="mainContentPlaceHolder">
<div class="emptyText" id="divMessage" runat="server">
<span>No report data found.</span>
<rsweb:ReportViewer ID="rvAllOrders" runat="server" Font-Names="Verdana" Font-Size="8pt"
Height="650px" Width="100%" Visible="False" DocumentMapCollapsed="True" PromptAreaCollapsed="True"
<LocalReport ReportPath="Reports\AllItemDetailsReport.rdlc" EnableExternalImages="true">
Mar 19, 2011 09:09 PM|nguyen190887|LINK
<div style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; width: 100%; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; margin:
Due to the urgency of my project, I have to change the render mode of ReportViewer control to Synchronous. The system now works both on local pc and server. However, this approach is not good for report with huge data (base on things I googled).
I hope to continue receiving your ideas about this issue. Thanks!