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

ReportViewer not rendering reports

1 Answer 182 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
HelpdeskLisboa
Top achievements
Rank 1
HelpdeskLisboa asked on 17 May 2010, 04:14 PM
Hello everyone,

I'm facing a problem with telerik reportviewer. I am adding a reportviewer to an ascx UserControl like so:

<telerik:ReportViewer ID="rpvIssues" runat="server" Width="100%" Height="100%">  
</telerik:ReportViewer> 

and I have a report named test.cs that only containts a simple textbox in the header section and another textbox in the detail section. Both values were hardcoded for testing purposes because I was facing this problem with a much more complex report. But for the sake of easyness I setup this example for you:

this is the a part of my teste.designer.cs auto-generated code regarding the above mentioned textboxes definition:
            //   
            // textBox1  
            //   
            this.textBox1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.4000000953674316, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.4999997615814209, Telerik.Reporting.Drawing.UnitType.Cm));  
            this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.9999997615814209, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.60000008344650269, Telerik.Reporting.Drawing.UnitType.Cm));  
            this.textBox1.Value = "DETAIL SAMPLE TEXT";  
            //   
            // textBox2  
            //   
            this.textBox2.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(3.2999999523162842, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(1.2000000476837158, Telerik.Reporting.Drawing.UnitType.Cm));  
            this.textBox2.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.0000002384185791, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.59999990463256836, Telerik.Reporting.Drawing.UnitType.Cm));  
            this.textBox2.Value = "TITLE SAMPLE TEXT"

Then, on the code-behind of my ascx control I setup my reportviewer like so:

        protected void Page_Load(object sender, EventArgs e)  
        {  
            teste t = new teste();  
            rpvIssues.Report = t;  
        } 
Being "teste" my report class.

Then I put my usercontrol inside an aspx page and when I launch the page using Web Development Server from MS Visual Studio 2008 all I get is an empty reportviewer. However, if I try to print the "blank" report, it prints everything as it should!! Both textboxes are printed correctly.

If I place a reportviewer directly on an aspx page then the reports are correctly rendered....
Anything I'm missing here when using a reportviewer inside an usercontrol?

1 Answer, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 17 May 2010, 06:00 PM
Hello HelpdeskLisboa,

In your case the problem seems to be with the report viewer's height. It is just too small and that is why the report cannot be seen although it prints correctly. To fix the issue you have to set height: 100% not only to the report viewer control but all its parent elements as well. For example:

<html style="height: 100%">
<head runat="server">
    <title></title>
</head>
<body style="height: 100%">
    <form id="form1" runat="server" style="height: 100%">
    <div style="height: 100%">
        <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="100%" Width="100%">
        </telerik:ReportViewer>
    </div>
    </form>
</body>
</html>

Hope this helps.

Kind regards,
Chavdar
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
HelpdeskLisboa
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Share this question
or