Followed the advice form this link below but still no luck
http://www.telerik.com/community/forums/reporting/telerik-reporting/how-do-you-programmatically-bind-subreports-in-q2-2012.aspx
Telerik.Reporting.SubReport mySubReport = (Telerik.Reporting.SubReport)oReport.Items.Find("MySubReport", true)[0];
//*** This is working
// this code block loads the data in sub report in this case if i set the subreport as an object Instance
var repSource = (InstanceReportSource)mySubReport.ReportSource;
var subreport = (Telerik.Reporting.Report)repSource.ReportDocument;
var odsItems = (Telerik.Reporting.ObjectDataSource)subreport.DataSource;
subreport.DataSource = objectDataSource;
//*** End
//*** This is not working
// this code block doesn't load the data in sub report in this case if i set the subreport as an XML Source (serialized report using ReportXmlSerializer)
var repSource = (XmlReportSource)kpiActionsSubReport.ReportSource;
Report subreport = TelerikReportHelper.DeSerilizeTelerikReportXML(XElement.Parse(repSource.Xml)); //(deserialized report using ReportXmlSerializer)
subreport.DataSource = objectDataSource;
//*** End
ReportViewer.prototype.GetError =
function
()
{
var
paramsArea = document.getElementById(
this
.paramsFrameID);
var
msg =
""
;
if
(paramsArea){ msg = paramsArea.contentWindow.ErrorMessage; }
if
(!msg) {
var
reportFrame = document.getElementById(
this
.reportFrameID);
if
(reportFrame) { msg = reportFrame.contentWindow.ErrorMessage; }
return
this
.LocalizeMessage(msg);
}
<%@ Page Language=
"C#"
Inherits=
"System.Web.Mvc.ViewPage<dynamic>"
%>
<%@ Register Assembly=
"Telerik.ReportViewer.WebForms, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
Namespace=
"Telerik.ReportViewer.WebForms"
TagPrefix=
"telerik"
%>
<%@ Register Assembly=
"Telerik.Reporting, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
Namespace=
"Telerik.Reporting"
TagPrefix=
"telerik"
%><br><%@ Import Namespace=
"System.Web.Mvc"
%>
<%@ Import Namespace=
"System.Data"
%>
<head runat=
"server"
>
<title></title>
</head>
<form id=
"main"
runat=
"server"
method=
"post"
action=
"#"
>
<telerik:ReportViewer ID=
"ReportViewer1"
runat=
"server"
style=
"width: 790px; height: 800px;"
>
</telerik:ReportViewer>
</form>
<script runat=
"server"
>
public override void VerifyRenderingInServerForm(Control control)
{
//base.VerifyRenderingInServerForm(control);
// to avoid the server form (<form id="Form2" runat="server">) requirement
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
ReportViewer1.ReportSource = new QuoteRpt();
var name = "QuoteReport"
ReportViewer1.ReportSource.Parameters.Add(new Telerik.Reporting.Parameter("QuoteId", ViewBag.QuoteID));
}
</script>
xmlns:Telerik_ReportViewer_Silverlight="clr-namespace:Telerik.ReportViewer.Silverlight;assembly=Telerik.ReportViewer.Silverlight"
<
Telerik_ReportViewer_Silverlight:FormatedNumberConverter
x:Key
=
"FormatedNumberConverter"
/>
<
TextBlock
Margin
=
"2, 0, 10, 0"
TextAlignment
=
"Center"
Text
=
"{Binding PageCount, ConverterParameter=of \{0\} pages, Converter={StaticResource FormatedNumberConverter}}"
VerticalAlignment
=
"Center"
>