List with ObjectDataSource

2 posts, 0 answers
  1. Bruno
    Bruno avatar
    1 posts
    Member since:
    Nov 2013

    Posted 10 Nov 2014 Link to this post

    Hi,

    I have a web app and a class library. My wep app include my class library.
    On the page load of my default.aspx web form, i set the datasource of my report.

    Here is the code ( this.FolhaCargaCollection contains a List with 72 items):

    protected void Page_Load(object sender, EventArgs e)
    {
        ClassLibrary1.Report.FolhaCarga report = new ClassLibrary1.Report.FolhaCarga();
        report.DataSource = this.FolhaCargaCollection;
     
        Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
        reportSource.ReportDocument = report;
     
        this.ReportViewer1.ReportSource = reportSource;
        ReportViewer1.RefreshReport();
    }

    Then i have done this:
    Create new a report inside my class library (ClassLibrary1)
    Add a ObjectDataSource, then select the collection and select "No data source member". Then finish.
    On my report, i have set DataSource property to my new ObjectDataSource.

    Then i hit F5 key and all work. I got all my 72 items listed.

    Then i have done this:
    Create new a report inside my class library (ClassLibrary1)
    Add a ObjectDataSource, then select the collection and select "No data source member". Then finish.
    On my report, i add a new table.
    In Table wizard, i select the ObjectDataSource, then selected all properties to the table. Then finish.

    I changed my page load to load the right report, then hit F5 key. What happens next is that i saw the headers of my table repeated 72 times, without data.

    Is there any way that this can work, using the variable "this.FolhaCargaCollection" as the source of my report?

    Thanks in advance.
  2. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 13 Nov 2014 Link to this post

    Hello Bruno,

    Given the provided information it seems the issue is related to incorrectly configured Table item structure.
    Please make sure that the Report.DataSource is set to none, otherwise a Table item in the report's detail section will be repeated (headers included) for each row in the report's data source.
    In order to check the Table structure, select the Table item and open the Group Explorer window. In case the structure is not correct, we recommend that you create a brand new Table item by running the Table Wizard from the VS Toolbox.
    For more information on the Table structure, please refer to the Table help articles.

    In case the issue persists, please provide us additional information, such as a video of the report and table creation process, or attach a runnable sample project exhibiting the problematic behavior.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top