or
<telerik:ReportViewer ID="ReportViewerFiche" runat="server" BorderStyle="Solid" BorderWidth="1" Report="Rapports.Fiches.FicheAA.MyReport, Rapports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Width="100%" Height="500px" ViewMode="PrintPreview"></telerik:ReportViewer>public string ConnectionString { get; set; }private void Rpt_CustomerAccountsReport_NeedDataSource(object sender, EventArgs e){ try { if (Report.ReportParameters["MarketListID"].Value == null && Report.ReportParameters["BranchID"].Value == null && Report.ReportParameters["CustomerGroupID"].Value == null && Report.ReportParameters["CustomerID"].Value == null) { ErrorMsg("Error! This report cannot be run without parameters. Please select a Branch, Marketing list or Customer group."); } else { SqlData data = new SqlData(ConnectionString); // Shared getdataset function dsMain = data.GetDataSet("spRpt_CustomerAccountsReport", CommandType.StoredProcedure, "@EmployeeUserID", Report.ReportParameters["EmployeeUserID"].Value, "@MarketListID", Report.ReportParameters["MarketListID"].Value, "@CustomerID", Report.ReportParameters["CustomerID"].Value, "@BranchID", Report.ReportParameters["BranchID"].Value, "@CustomerGroupID", Report.ReportParameters["CustomerGroupID"].Value, "@EmployeeID", Report.ReportParameters["EmployeeID"].Value); // ** Moving the max record limit to the stored procedure so we can change / make it user configurable without a re-compile if (dsMain.Tables[0].Rows.Count > 40000) { ErrorMsg("Over 40,000 results were returned. The report cannot render. Please select more specific criteria."); } else { Report.DataSource = dsMain.Tables[0]; } } // They provided parameters } catch (Exception ex) { ErrorMsg(ex.Message); }}private void GroupHeaderArea1_ItemDataBinding(object sender, EventArgs e){ try { // Get the section Telerik.Reporting.Processing.GroupSection section = (sender as Telerik.Reporting.Processing.GroupSection); if (section != null) { // Get the customer ID for this section object id = section.DataObject["CustomerID"]; if (id != null) { int CustID = (int)id; // Filter out sub-report data DataRow[] drContacts = dsMain.Tables[1].Select("CustomerID=" + CustID.ToString()); DataRow[] drCrossSell = dsMain.Tables[2].Select("CustomerID=" + CustID.ToString()); DataRow[] drAccounts = dsMain.Tables[3].Select("CustomerID=" + CustID.ToString()); Rpt_CustomerAccountsReportAccountSummary rptAcct = new Rpt_CustomerAccountsReportAccountSummary(); Rpt_CustomerAccountsReportContacts rptContact = new Rpt_CustomerAccountsReportContacts(); Rpt_CustomerAccountsReportCrossSell rptCrossSell = new Rpt_CustomerAccountsReportCrossSell(); rptAcct.DataSource = drAccounts; rptContact.DataSource = drContacts; rptCrossSell.DataSource = drCrossSell; srContacts.ReportSource = rptContact; srCrossSell.ReportSource = rptCrossSell; srAccountSummary.ReportSource = rptAcct; } } } catch (Exception ex) { ErrorMsg(ex.Message); }}