Telerik Forums
Reporting Forum
1 answer
353 views

Posted 20 hours ago (permalink)

Hi,

I have a Report with a table

With the parameters I'm testing with, my data call returns 17 rows of order objects.  Binding directly to the table datasource gives 17 rows as expected.  The report has a footer that relies on the same dataset and setting the report dataset causes the table data to repeat.  Instead of one page with 17 rows, it becomes 18 pages with  the same 17 rows reapeated on each page.

I tried setting the data source on the table's NeedDataSource event, and it ran 18 times.
I'm currently setting the table datasource in the report NeedDataSource.

This gives proper grid, no footer:
this.OrderDetailsTable.DataSource = SupplyReplacementFacade.GetOrdersByCompanyID(newAndPendingOnly, patientFilter, startDate, endDate);

This gives 18 pages of grid with proper footer:
 private void OrdersDetailReport_NeedDataSource(object sender, EventArgs e)
        {
                string authToken = (string)this.ReportParameters["AuthToken"].Value;
                bool newAndPendingOnly = (bool)this.ReportParameters["NewAndPendingOnly"].Value;
                DateTime startDate = (DateTime)this.ReportParameters["StartDate"].Value;
                DateTime endDate = (DateTime)this.ReportParameters["EndDate"].Value;
                PatientSearchType patientFilter = (PatientSearchType)(int)(long)this.ReportParameters["PatientFilter"].Value;


                if (SRServicesFacade.VerifyAuthentication(authToken, SERVICE_NAME, SERVICE_VERSION))
                {
                    //TODO: Change this for a regular GetCompanyInfo call when the change to store the company info happens

                    this.txtCompanyName.Value = CompanyManagementFacade.GetCompanyName();
                    this.DataSource = SupplyReplacementFacade.GetOrdersByCompanyID(newAndPendingOnly, patientFilter, startDate, endDate);
                    this.OrderDetailsTable.DataSource = this.DataSource;
                    //this.OrderDetailsTable.DataSource = SupplyReplacementFacade.GetOrdersByCompanyID(newAndPendingOnly, patientFilter, startDate, endDate);

                }
        }
The same thing happens when you set the datasource in the needs datasource event.
private void OrderDetailsTable_NeedDataSource(object sender, EventArgs e)
        {
            if (((Telerik.Reporting.Processing.Table)(sender)).DataSource == null)
                ((Telerik.Reporting.Processing.Table)(sender)).DataSource = Report.DataSource;
        }


How do I set the report datasource, so that I get the page footer information, and set the table datasource so that it has one page of 17 rows?

Thank you for your help,

James Trimmier
James
Top achievements
Rank 1
 answered on 02 Oct 2012
1 answer
128 views
Hi there,

I noticed a very strage behavior while creating a PDF-report:
it's a quite simple report with a table with data from an objectDataSource.datamenber (a method that collects the needed data elsewhere)
If I just show the output on screen with the reportviewer everything works as expected.
But if I switch to only PDF-output, I got a second thread "rendering" and BOTH threads do use the datamember so it runs twice delivering exactley the same data. So my output tooks twice as long.
So why do both threads (rendering and "main") are using the objectDataSource? Can I somehow deny spawning a second thread?

Thanks in advance!
Elian
Telerik team
 answered on 02 Oct 2012
0 answers
85 views
Hi.  Does anyone knows what the code is and how to apply this to the Telerik equivalence?

 	Dim MyTable As CrystalDecisions.CrystalReports.Engine.Table
        Dim mySubreport As CrystalDecisions.CrystalReports.Engine.ReportDocument
Frank
Top achievements
Rank 1
 asked on 01 Oct 2012
7 answers
1.7K+ views
I have a question, that seems extremely simple, but I can not seem to figure it out. I have created a basic report and simply added a datasource. I have a list of parts, and I would like for the column headers to repeat on each page, not on each line. If I put the column headers in the details section, they repeat on every row. If I put them in the page header, they then appear above the report header.

How can I simply put the column headers below the report header, and have the repeat on each page. Seems like I need to add a second page header, but have it below the report header.

I am doing this through the GUI also.
Steve
Telerik team
 answered on 01 Oct 2012
6 answers
571 views
Hi,

I would like to create a  report based on a generic IList. How do I get the generic type to load in the report's design view? I can't seem to be able to add it as a datasource.
Petr
Top achievements
Rank 1
 answered on 01 Oct 2012
1 answer
135 views
Hi,

I am following the example "AutoGenerateColumns" found on the forum to dynamically populate data from the database in Telerik.Reporting.Table.


	private void table1_ItemDataBinding(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Table processingTable = (sender as Telerik.Reporting.Processing.Table);
            processingTable.DataSource = _dataTable;
 
            //create two HtmlTextBox items (one for header and one for data) which would be added to the items collection of the table
            Telerik.Reporting.HtmlTextBox textboxGroup;
            Telerik.Reporting.HtmlTextBox textBoxTable;
 
            //we do not clear the Rows collection, since we have a details row group and need to create columns only
            this.table1.ColumnGroups.Clear();
            this.table1.Body.Columns.Clear();
            this.table1.Body.Rows.Clear();
            int i = 0;
            this.table1.ColumnHeadersPrintOnEveryPage = true;
            foreach (DataColumn dc in _report.ReportData.Columns)
            {
                Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
                this.table1.ColumnGroups.Add(tableGroupColumn);
                this.table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));
 
                textboxGroup = new Telerik.Reporting.HtmlTextBox();
                textboxGroup.Style.BorderColor.Default = Color.Black;
                textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
                textboxGroup.Value = dc.ColumnName.ToString();
                textboxGroup.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                tableGroupColumn.ReportItem = textboxGroup;
 
                textBoxTable = new Telerik.Reporting.HtmlTextBox();
                textBoxTable.Style.BorderColor.Default = Color.Black;
                textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
                textBoxTable.Value = "=Fields.[" + dc.ColumnName + "]";
                textBoxTable.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                this.table1.Body.SetCellContent(0, i++, textBoxTable);
                this.table1.Items.AddRange(new ReportItemBase[] { textBoxTable, textboxGroup });
            }
        }
the DataTable is a very simple two-column table : Employee Name / Employee Email address The below exception is thrown for each email address table cell when the table is generated :
System.Xml.XmlException: The '@' character, hexadecimal value 0x40, cannot be included in a name. Line 1, position 30.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at Telerik.Reporting.HtmlEngine.HtmlParser.ParseHtmlNode(XmlReader reader)
   at Telerik.Reporting.HtmlEngine.HtmlParser.Parse()
   at Telerik.Reporting.HtmlEngine.HtmlParser.Parse(String html, ReportObject parent)
   at Telerik.Reporting.Processing.HtmlTextBox.ProcessItem()
   at Telerik.Reporting.Processing.ReportItemBase.Process(DataMember data)


Please advise

Thanks
Paulino
Steve
Telerik team
 answered on 29 Sep 2012
1 answer
511 views
Hello,

We are using aspnet report viewer.
However we have some difficulties to auto size the viewer to fit content of the browser when it is resized by end user.
I can successfully auto size on the width using CSS and width = 100% but not the height.
Is there anyway to auto size the viewer height and width to fit content of the browser?

Here is the code:

    <form id="ReportManagement" runat="server" style="width: 100%">
    <div id="content" >
        <telerik:ReportViewer ID="ReportManagementViewer" runat="server"    
             Width="100%" ViewMode="PrintPreview"  Height="690px"
             ParametersAreaVisible="False" ShowParametersButton="False"
            ShowDocumentMapButton="False" ShowPrintPreviewButton="False" 
            ZoomPercent="200" ShowZoomSelect="False" ShowHistoryButtons="False">
        </telerik:ReportViewer>
    </div>   
    </form>

Width of the viewer can resize to fit the with of the browser, but it doesn't work for the height.
Thanks for your help
Regards

Joël
Steve
Telerik team
 answered on 29 Sep 2012
1 answer
122 views
Ik have a report with a chart which is showing sales.
This report has a couple of parameters:
  • customer
  • year
  • period from (month)
  • period to (month)

when I select a period from which is larger as 1, the chart is showing strange behaviour (see image 1). In this example, I am using the following parameters: from period 3 (march) till period 6 (jun). A total of 4 months.

  • the axis labels are all right;
  • the amount of months is ok
  • but strangely the months januari and februari are shown as zero values in the graph. Because the chart is showing 4 months, the values for may and june are not shown.

When I preview the datasource, I get a perfect dataset, and only the range between the selected periods are returned.

What could be the problem? Thanks in advan
Elian
Telerik team
 answered on 29 Sep 2012
1 answer
133 views
How can I format the parameters area on the top of a report?
Steve
Telerik team
 answered on 29 Sep 2012
1 answer
251 views
Hi, we use the wcf service to render reports to pdf for emailing within our application, as well as the silverlight report viewer for viewing them on screen.  If an image within a report is invalid somehow (we occasionally have zero byte image files generated by another part of our application), then within the silverlight app report viewer it shows in the picture box as being invalid. 

However, when using the wcf service the error gets propogated all the way back into the results of the render operation, in the Errors array, and in the HasErrors boolean.  I check the HasErrors boolean, and the content of the Errors array to report rendering failures, and do not email the resulting rendered document if any errors exist.

This isn't really an error from the point of view of not emailing the report as far as we are concerned.  Is there any way to reliably discriminate between fatal errors (whatever they might be), and other minor errors like this?  If the report has rendered at all we would still want to email it, although we could still report on minor errors in our logging.  Could I check on the DocumentBytes property and see if that's non-null and has a size of greater than zero?

Alternateively is there some way to get the picturebox to completely suppress the error and not throw its own exception under this particular circumstance?

Thanks,

Colin.
Steve
Telerik team
 answered on 28 Sep 2012
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?