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

Sometimes no data on report

5 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 13 Jul 2010, 09:27 AM
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?

5 Answers, 1 is accepted

Sort by
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 13 Jul 2010, 12:08 PM
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.
0
Christian
Top achievements
Rank 1
answered on 13 Jul 2010, 03:13 PM
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.
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 13 Jul 2010, 03:21 PM
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!
0
Christian
Top achievements
Rank 1
answered on 13 Jul 2010, 03:33 PM
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.
0
Steve
Telerik team
answered on 14 Jul 2010, 03:30 PM
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
Tags
General Discussions
Asked by
Christian
Top achievements
Rank 1
Answers by
Massimiliano Bassili
Top achievements
Rank 1
Christian
Top achievements
Rank 1
Steve
Telerik team
Share this question
or