Sometimes no data on report

6 posts, 0 answers
  1. Christian Pardun
    Christian Pardun avatar
    112 posts
    Member since:
    May 2010

    Posted 13 Jul 2010 Link to this post

    Hello everybody!

    We are using Telerik Reporting in an ASP .NET Application.
    We had some issues with the report not showing while fetching data, which led to the application seeming to not respond.
    To overcome this issue we initialized the report at first with no data (i.e. Report Parameters not set) and placed an ASP Update Panel and ASP Timer.
    In the Tick event of the Timer the report parameters are set and the report is forced to update the data using the new report parameters. Below is a snippet of the update method called by the tick event of the timer.
    /// <summary>
    /// Updates the report.
    /// </summary>
    public void UpdateReport()
    {
        AcceptanceProtocol.AcceptanceProtocol report = this.ReportViewer1.Report as AcceptanceProtocol.AcceptanceProtocol;
        report.SetFilters(companyId, userId, deviceId, cultureName);
        this.ReportViewer1.Visible = true;
        this.ReportViewer1.RefreshReport();
    }

    In the NeedDataSource event of the report we are fetching our data using a custom business logic object (see below):
    /// <summary>
    /// Handles the NeedDataSource event of the AcceptanceProtocol control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    private void AcceptanceProtocol_NeedDataSource(object sender, EventArgs e)
    {
        Telerik.Reporting.Processing.Report rep = (Telerik.Reporting.Processing.Report)sender;
        this.DataSource = this.BusinessLogic.GetAcceptanceProtocol(
            this.CompanyId, this.UserId, this.DeviceId, this.CultureName,
            this.EventTypeIdFilter, this.EventTypeGroupIdFilter);
        rep.DataSource = this.DataSource;
    }

    The problem is that sometimes the report is showing data and sometimes not.
    If we force a second GET request to the page that renders the report everything is working fine.
    Some idea what is causing this?
  2. Massimiliano Bassili
    Massimiliano Bassili avatar
    323 posts
    Member since:
    May 2006

    Posted 13 Jul 2010 Link to this post

    In the http://www.telerik.com/help/reporting/data-items-need-data-source-event.html article, the datasource is set to the processing report item and not to the definition (i.e. this). So try removing the "this" part from your code to see how it behaves.
  3. DevCraft banner
  4. Christian Pardun
    Christian Pardun avatar
    112 posts
    Member since:
    May 2010

    Posted 13 Jul 2010 Link to this post

    Hello Massimiliano!

    Unfortunately using your suggestion changed nothing.
    The report still doesn't show any data.
    Furthermore we now got the problem, that the sub reports don't show any data at all.
  5. Massimiliano Bassili
    Massimiliano Bassili avatar
    323 posts
    Member since:
    May 2006

    Posted 13 Jul 2010 Link to this post

    What do you do in the SetFilters method in the report? Have you tried setting the report parameter values directly like so:

    public void UpdateReport()
    {
        AcceptanceProtocol.AcceptanceProtocol report = this.ReportViewer1.Report as AcceptanceProtocol.AcceptanceProtocol;
        report.ReportParameters["companyId"].Value = 123;
        report.ReportParameters["userId"].Value = 456;
        report.ReportParameters["deviceId"].Value = 789;
        report.ReportParameters["cultureName"].Value = 123;
        this.ReportViewer1.Visible = true;
        this.ReportViewer1.RefreshReport();
    }

    Cheers!
  6. Christian Pardun
    Christian Pardun avatar
    112 posts
    Member since:
    May 2010

    Posted 13 Jul 2010 Link to this post

    This is exactly what we are doing.
    The SetFilters method just encapsulates all report parameters and sets them according to the given value like in your example.
  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 14 Jul 2010 Link to this post

    Hi Uwe,

    Massimiliano has already asked you important details we needed to know. Unfortunately with the information so far we can only guess what is the problem. That is why we would need a sample runnable project to debug locally and advise you what is happening. Please open a support ticket and attach it there or provide a link to the project here, but make sure there are no Telerik dev assemblies included.

    Regards,
    Steve
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner