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

Silverlight report blank until refresh

1 Answer 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Devin
Top achievements
Rank 1
Devin asked on 07 Jun 2012, 12:00 AM
I have a report viewer in a silverlight control, and when it loads it comes up blank until I hit refresh on the viewer, and then the report is finally loaded. What could be happening? Here's the code I'm using:

public ReportWrapper()
{
    InitializeComponent();
 
    this.rptViewer.RenderBegin += new Telerik.ReportViewer.Silverlight.RenderBeginEventHandler(rptViewer_RenderBegin);
    this.Loaded += ReportWrapper_Loaded;
 
    this.rptViewer.ReportServiceUri = new Uri("http://webserver/reportserver/reportservice.svc");
    this.rptViewer.Report = "ReportLib.TestReport";
}
 
void rptViewer_RenderBegin(object sender, Telerik.ReportViewer.Silverlight.RenderBeginEventArgs args)
{
 
    args.ParameterValues["ID"] = ID;
}

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 08 Jun 2012, 11:21 AM
Hello Devin,

We've tried this in our Silverlight demo project directly, here is the code:

public partial class MainPage : UserControl
   {
       public MainPage()
       {
           InitializeComponent();
 
           ReportViewer1.Report = "Telerik.Reporting.Examples.CSharp.ProductLineSales, CSharp.ReportLibrary";
           ReportViewer1.ReportServiceUri = new Uri("../ReportService.svc", UriKind.Relative);
       }
 
       private void ReportViewer1_RenderBegin(object sender, RenderBeginEventArgs args)
       {
           args.ParameterValues["ProductCategory"] = "Components";
           args.ParameterValues["ProductSubcategory"] = new object[] { "Brakes", "Chains" };
       }
   }

and it worked correctly. The two notable differences with your code being:
  • the specified value for the Report property is not valid and the viewer would not find an available report type with such assembly qualified name.
  • the ID variable might not be available at the time the report renders. Where does it come from and have you verified it has a value when the report is rendered?

All the best,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Devin
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or