I have a asp.net(VS2010 - .NET 4.0) applications deployed on Windows Azure. I am trying to use .NET report viewer control. I am running the reports in Local Mode. Reports work fine and gets displayed correctly. When i try to export it to Excel/PDF/Word i get this error "ASP.NET session has expired or could not be found".
Here is my Sample Code : ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RxCloudReports.Default" EnableSessionState="True" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
</script>
</head>
</head>
<body>
<form id="form1" runat="server" enctype="multipart/form-data">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Local" SizeToReportContent="true" AsyncRendering = "true"
ShowPageNavigationControls="true" ShowExportControls="true" ShowToolBar="true" >
</rsweb:ReportViewer>
</form>
</body>
</html>
C#
DataSet ds = GetDataSet(_ID, _Module);
ReportViewer1.Reset();
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = "Reports/Reports1.rdlc";
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ReportDS", ds.Tables[0]));
ReportViewer1.LocalReport.Refresh();