or
/// <summary> /// Initializes a new instance of the <see cref = "OverviewReportBase{T}" /> class. /// </summary> public OverviewReportBase() { // // Required for telerik Reporting designer support // InitializeComponent(); // Set DataSource to null, so that the NeedDataSource Event gets fired. // This is done because otherwise the ReportParameters are not getting filled from the Silverlight Client. // see a comment on http://blogs.telerik.com/blogs/posts/09-12-07/programmatic_initialization_of_report_parameter_values_in_telerik_reporting_silverlight_viewer.aspx for more information DataSource = null; }
OnNeedDataSource method:
/// <summary> /// Called when the report needs a data source. /// </summary> /// <param name = "sender">The sender.</param> /// <param name = "e">The <see cref = "System.EventArgs" /> instance containing the event data.</param> protected override void OnNeedDataSource(Object sender, EventArgs e) { Unit writeableArea = CalculateWidthOfWriteableArea(); IEnumerable<String> columnNames = ((Object[]) ReportParameters["columnNames"].Value).OfType<String>(); Int32 columnCount = columnNames.Count(); IEnumerable<Int32> columnPercentages = ((Object[]) ReportParameters["columnPercentages"].Value).Select(x => Int32.Parse(x.ToString())); Double summedUpWidth = 0D; for (Int32 i = 0; i < columnCount; i++) { Unit controlWidth = writeableArea.Multiply(columnPercentages.ElementAt(i)).Divide(100); TextBox captionTextBox = new TextBox { Location = new PointU(new Unit(summedUpWidth, UnitType.Mm), new Unit(0, UnitType.Cm)), Size = new SizeU(controlWidth, new Unit(0.75, UnitType.Cm)), Name = String.Format(CultureInfo.InvariantCulture, "captionTextBox{0}", i), StyleName = "Caption", TextWrap = false, Value = RetrieveDisplayName(columnNames.ElementAt(i)) }; labelsGroupHeader.Items.Add(captionTextBox); TextBox dataTextBox = new TextBox { Location = new PointU(new Unit(summedUpWidth, UnitType.Mm), new Unit(0, UnitType.Cm)), Size = new SizeU(controlWidth, new Unit(0.75, UnitType.Cm)), Name = String.Format(CultureInfo.InvariantCulture, "dataTextBox{0}", i), StyleName = "Data", TextWrap = false, Value = RetrieveValuePathOfColumn(columnNames.ElementAt(i)) }; detail.Items.Add(dataTextBox); summedUpWidth += controlWidth.Value; } SetDataSourceHere(); base.OnNeedDataSource(sender, e); }
Best Regards
public Order.OrderMetaData cmd { get; set; }public IList<OrderDetail.OrderDetailMetaData> ligneCmd { get; set; }I have a report with three subreports. The FilesAttached subreport is working, but the other two subreports do not show any data. Here is my binding code. Is there something I am missing? Where else should I look?
Dim summaryReport As New telSummaryReport summaryReport.DataSource = DS.Tables("SCR") summaryReport.subNotes.ReportSource.DataSource = DS.Tables("Notes") summaryReport.subFilesAttached.ReportSource.DataSource = DS.Tables("Files") summaryReport.subCCB.ReportSource.DataSource = DS.Tables("Decisions") Dim reportProcessor As Telerik.Reporting.Processing.ReportProcessor = New Telerik.Reporting.Processing.ReportProcessor() Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", summaryReport, Nothing) HttpContext.Current.Response.Clear() HttpContext.Current.Response.ContentType = result.MimeType HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.Private) HttpContext.Current.Response.Expires = -1 HttpContext.Current.Response.Buffer = True HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("{0};FileName=""{1}""", "attachment", filename)) HttpContext.Current.Response.BinaryWrite(result.DocumentBytes) HttpContext.Current.Response.End()<body> <div style="width: 700px; margin-left: auto; margin-right: auto;"> <a href='/Patients/Show/<%= ViewData["PatientId"] %>' class="button">Current User</a><br /> <br /> <script runat="server"> //protected override void OnPreRender(EventArgs e) { // ReportViewer1.Report = new Report1(); // base.OnPreRender(e); //} public override void VerifyRenderingInServerForm(Control control) { // to avoid the server form (<form runat="server">) requirement } protected override void OnLoad(EventArgs e) { base.OnLoad(e); // bind the report viewer var priliminaryReport = new PatientPriliminaryReport(); priliminaryReport.ReportParameters["patientId"].Value = ViewData["PatientId"]; priliminaryReport.ReportParameters["userId"].Value = ViewData["UserId"]; ReportViewer1.Report = priliminaryReport; } </script> <form id="Form1" runat="server"> <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="1100px" Width="700px"> </telerik:ReportViewer> </form> </div></body>namespace Faq.Reports { using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using Telerik.Reporting; using Telerik.Reporting.Drawing; /// <summary> /// Summary description for PatientPriliminaryReport. /// </summary> public partial class PatientPriliminaryReport : Telerik.Reporting.Report { public PatientPriliminaryReport() { // // Required for telerik Reporting designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } }}An error has occurred while processing Table 'table1':
Group with name 'Group1' already exists. Groups should have unique names.
Could someone please help me to attack that problem?