ReportViewer rendering issue in a Sharepoint Webpart

4 posts, 0 answers
  1. dmetge
    dmetge avatar
    7 posts
    Member since:
    Jun 2007

    Posted 05 Oct 2010 Link to this post

    Hi,

    we're facing an issue, trying to display a reportviewer in a customized Webpart designed for a Sharepoint Application. I've tried to search in the forum and the KB for a couple of hours about this problem and found nothing.

    Of course, we first checked everything mentionned in the "Deploying Web ReportViewer in MOSS" article, and everything is fine.
    The reportviewer has a strange behaviour, when the page is loading, its toolbar starts appearing with its coloured and enabled icons, but then suddenly the icons turns gray and the toolbar is entierely disabled, as shown in the screenshot below. The report is empty.

    Here are parts of the code we used. We declare the ReportViewer in the CreateChildControls method of the webpart, but we populate the data and generate the report in the RenderControl method.

     

    protected Telerik.ReportViewer.WebForms.ReportViewer MyReportViewer;

     


     

    protected override void CreateChildControls()

     

    {

    MyReportViewer =

    new ReportViewer();

     

    MyReportViewer.ParametersAreaVisible =

    false; // Tried this but nothing changed

     

    Controls.Add(MyReportViewer);

    }

     

    protected override void Render(HtmlTextWriter output)

     

    {

     

    EnsureChildControls();

     

     

    var LObjetDataSource = new Telerik.Reporting.ObjectDataSource();

     

    LObjetDataSource.DataSource = PopulateDataView(); // Method returning the data in a DataView

    Telerik.Reporting.

    Report Rapport = new Report();

     

    Rapport.DataSource = LObjetDataSource;

    Rapport.ReportParameters.Clear();

    // Tried this in order to avoid bad parameters issues

     

     

     

    MyReportViewer.Report = Rapport;

    MyReportViewer.RenderControl(output);

    }


    Could the issue be relative to a bad databinding, in the lifecycle of the page/webpart ?
    If someone can help...

    thanks in advance.

    Daniel 
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 05 Oct 2010 Link to this post

    Hello dmetge,

    Try adding ID to the report viewer e.g.:

    MyReportViewer = new ReportViewer();
    MyReportViewer.ID = "myViewer1";

    Additionally this problem should not be present if you're using Q2 2010 or later version.

    All the best,
    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
  3. DevCraft banner
  4. dmetge
    dmetge avatar
    7 posts
    Member since:
    Jun 2007

    Posted 05 Oct 2010 Link to this post

    Thanks Steve,

    Alas I've just did what you suggested and nothing has changed (in fact we're using Q2 2010 version).

    If you have another idea...

    Thanks in advance,

    Daniel
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 08 Oct 2010 Link to this post

    Hello dmetge,

    Try using a tool like Firebug to see the markup generated on the page. We have a suspicion that this is a browser related problem that might be caused by document type. Things to try:
    • set explicit height and width to the viewer in pixels.
    • try opening the page in another browser. Btw what is the browser you're currently using? Have you tried compatibility mode?
    • remove the doctype from the page or master page hosting the control with the viewer.

    Greetings,
    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