I have a web app that was developed in earlier Telerik report viewer.
I am using Stored Procedure to Populate the report data source as well as Session Variable to filter the Report Data. Seems can't able to work in HTML5 Format. Below are my Web Form and code file. Any Help will be appreciated for a sample application or link . Thanks
gc_0620
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// this.ReportViewer1.RefreshReport();
// Response.AppendHeader("X-UA-Compatible", "IE=edge");
string[] retrievedLocations = (string[])Session["FacilityData"];
Array.Sort(retrievedLocations);
for (int i = 0; i <
retrievedLocations.Length
; i++)
{
if (i == 0)
{
location
=
""
+ retrievedLocations[i] + ","; // Add a comma if data already exists
}
else
{
location += "" + retrievedLocations[i] + ",";
}
}
location
= location.Substring(0, location.Length - 1);
Reports.Intake_Coordinator_CM_Assignments
myReport
=
new
Reports.Intake_Coordinator_CM_Assignments();
string
sql
=
"[dbo].[Intake_Coordinator_Report_Source]"
;
SqlCommand
command
=
new
SqlCommand(sql, new SqlConnection(connectionString));
command.CommandType
= CommandType.StoredProcedure;
var
sqlparam
=
new
SqlParameter("@location", SqlDbType.NVarChar);
sqlparam.Value
=
location
; //outer value
command.Parameters.Add(sqlparam);
DataSet
dataSet
=
new
DataSet();
adapter.Fill(dataSet);
myReport.DataSource
=
dataSet
.Tables[0];//outer data source
string
Tempstr
=
command
.CommandText.ToString();
string
Tempstr1
= Tempstr;
var
reportSourceInstance1
=
new
InstanceReportSource() {
ReportDocument
=
myReport
};
ReportViewer1.ReportSource
=
reportSourceInstance1
;
}
}
________________________
Web Form.
<%@ Page
Title
=
"Intake CM Assignments Report"
Language
=
"C#"
MasterPageFile
=
"~/MasterPage.master"
AutoEventWireup
=
"true"
CodeFile
=
"Intake_Coordinator_CM_Assignments_Report.aspx.cs"
Inherits
=
"Intake_Coordinator_CM_Assignments_Report"
%>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=12.1.18.620, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
runat
=
"Server"
>
<
link
href
=
"styles.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
runat
=
"Server"
>
<
asp:Panel
runat
=
"server"
ID
=
"Panel2"
Visible
=
"True"
CssClass
=
"form_header_label"
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
Text
=
"Intake YTD Status"
Font-Size
=
"14px"
Font-Bold
=
"true"
Font-Underline
=
"True"
></
asp:Label
>
</
asp:Panel
>
<
br
/>
<
br
/>
<
br
/>
<
div
>
<
telerik:ReportViewer
ID
=
"ReportViewer1"
runat
=
"server"
Style
=
"border: 1px solid #ccc;"
Height
=
"650px"
Width
=
"95%"
Skin
=
"Office2007"
>
<
typereportsource
typename
=
"Reports.Intake_Coordinator_CM_Assignments, Reports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
></
typereportsource
>
</
telerik:ReportViewer
>
</
div
>
</
asp:Content
>