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

Repeating Data on ReportTable

1 Answer 275 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 02 Oct 2012, 11:49 AM

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

1 Answer, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 02 Oct 2012, 06:26 PM
Solution: quit using a table and make all the fields a series of text boxes.
Setting the report source gets the data for all the fields once.
Tags
General Discussions
Asked by
James
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Share this question
or