or
textbox1.Visible = false;
(this.Items.Find("textbox1", true)[0] as Telerik.Reporting.ReportItem).Visible = true;
readonly
System.Xml.XmlReaderSettings _settings =
new
System.Xml.XmlReaderSettings { IgnoreWhitespace =
true
};
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
Telerik.Reporting.Report report;
using
(System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(@
"Report.trdx"
, _settings))
{
var xmlSerializer =
new
ReportXmlSerializer();
report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
}
report.DataSource = GetDataSource();
//List<ParentObject>
var reportProcessor =
new
Telerik.Reporting.Processing.ReportProcessor();
var instanceReportSource =
new
InstanceReportSource { ReportDocument = report };
report.Items[
"detail"
].ItemDataBinding += ReportOnItemDataBinding;
...
}
}
private
void
ReportOnItemDataBinding(
object
sender, EventArgs eventArgs)
{
var detailSection = sender
as
Telerik.Reporting.Processing.DetailSection;
using
(System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(@
"SubReport.trdx"
, _settings))
{
var xmlSerializer =
new
ReportXmlSerializer();
var subReport = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
subReport.DataSource = ((ParentObject)detailSection.DataObject.RawData).Children;
var sr = (SubReport)detailSection.ItemDefinition.Items[
"subReport1"
];
sr.ReportSource =
new
InstanceReportSource {ReportDocument = subReport};
}
}
In the Sales by product line per period the demo show how the columns and the rows can be expanded and collapsed, but I don't see a way to do this? I cannot find this information in the documentation? How is this accomplished?
namespace
TelerikReporting
{
using
System;
using
System.ComponentModel;
using
System.Drawing;
using
System.Windows.Forms;
using
Telerik.Reporting;
using
Telerik.Reporting.Drawing;
using
System.Configuration;
using
System.Data.SqlClient;
using
DataService.ConnectionFactory;
public
partial
class
PropRep : Telerik.Reporting.Report
{
public
PropRep(
int
ID)
{
//
// Required for telerik Reporting designer support
//
InitializeComponent();
this
.ReportParameters[
"ID"
].Value = ID;
PropTest.Parameters[
"@ID"
].Value = ID;
PropTest.ConnectionString = ConnectionFactory.GetConnectionString(ConnectionType.SQLConnection);
//
// TODO: Add any constructor code after InitializeComponent call
//
}
}
}
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:ReportViewer
ID
=
"ReportViewer1"
Width
=
"100%"
Height
=
"800px"
runat
=
"server"
></
telerik:ReportViewer
>
</
div
>
</
form
>
</
body
>
</
html
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
public
partial
class
Reporting_Report : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
if
(Request.QueryString[
"PID"
] !=
null
)
{
int
ID = Convert.ToInt32(Request.QueryString[
"PID"
].ToString());
Telerik.Reporting.InstanceReportSource instanceReportSource =
new
Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument =
new
TelerikReporting.PropRep(ID);
this
.ReportViewer1.ReportSource = instanceReportSource;
}
}
}
}