This is a migrated thread and some comments may be shown as answers.

Repeating Data on ReportTable

2 Answers 13 Views
GridView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 01 Oct 2012, 03:26 PM
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



















2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 02 Oct 2012, 05:26 AM
Hello,

 Your code is for ASP.NET not for Silverlight. Please post your question in the relevant forum!

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Vlad
Telerik team
answered on 02 Oct 2012, 05:28 AM
Hello,

 Actually my mistake. It is for Telerik Reporting!

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
James
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or