or
var reportDefinitionFile = Server.MapPath("~/app/reports/repository/rpt/" + _reportPath);
var xmlSerializer = new ReportXmlSerializer();
reportDocument = (Telerik.Reporting.Report)xmlSerializer.Deserialize(reportDefinitionFile);
var reportSource = new InstanceReportSource();
reportSource.ReportDocument = reportDocument;
trdParameters.ReportSource = reportSource;protected override void OnInit(EventArgs e){ reportDocument.ItemDataBound += new EventHandler(reportDocument_ItemDataBound);
base.OnInit(e);}private void reportDocument_ItemDataBound(object sender, EventArgs e){ Telerik.Reporting.Processing.Report rpt = (Telerik.Reporting.Processing.Report)sender; var obj = rpt.Parameters;}Private Sub VRSummaryStore_ItemDataBound(sender As Object, e As EventArgs) Dim srPowerBoys As SubReport Dim thisReport As InstanceReportSource Dim myFoot As Telerik.Reporting.ReportFooterSection Dim X_Unit, Y_Unit As Telerik.Reporting.Drawing.Unit Dim APoint, UPoint As Telerik.Reporting.Drawing.PointU Dim subReport As Reports.VRPowerBuys Dim dsSubReport As DataSet Dim BoothNumber As Integer myFoot = Me.ReportFooterSection1 APoint = Me.srActualTotals.Location srPowerBoys = New SubReport srPowerBoys.Style.BackgroundColor = System.Drawing.Color.Chartreuse myFoot.Items.Add(srPowerBoys) srPowerBoys.Left = Me.srActualTotals.Left srPowerBoys.Top = APoint.Y + Me.srActualTotals.Height srPowerBoys.Size = Me.srActualTotals.Size thisReport = New InstanceReportSource subReport = New Reports.VRPowerBoys thisReport.ReportDocument = subReport BoothNumber = Me.Report.ReportParameters(0).Value dsSubReport = DataManager.GetDataSP("rpt_store_powerboys_show", BoothNumber.ToString) subReport.DataSource = dsSubReportEnd SubpictureBox1.Docking = DockingStyle.Left;// ReportDefinitionFile is the path to my .trdx filevar xmlSerializer = new ReportXmlSerializer();var reportDocument = (Report)xmlSerializer.Deserialize(ReportDefinitionFile); var reportSource = new InstanceReportSource();reportSource.ReportDocument = reportDocument; SqlConnectionStringBuilder scsb = new SqlConnectionStringBuilder();
.... // initialize connection string
SqlDataSource sds = (SqlDataSource)reportDocument.DataSource;sds.ConnectionString = scsb.ConnectionString; this.reportViewer1.ReportSource = reportSource;this.reportViewer1.RefreshReport();