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

ASP.Net viewer does not show report

2 Answers 190 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ed Lance
Top achievements
Rank 1
Ed Lance asked on 27 Mar 2012, 07:54 PM
This is a weird one.  I have an ASP.Net page with the report viewer control.  The report is in a separate dll as per best practice recommendations.  When the page comes up, the report area is blank.  But, if I export the report to PDF, the report contents are there as expected.  What is going on with this? 

Clicking the Preview or refresh buttons does not help.

This is the code in the viewer page (the session variable does have a value and it comes in correctly:
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    'If Not IsPostBack Then
    Dim report1 As New PMP2Reports.DocumentsReviewed
    Dim objSession As Object
 
    objSession = Session("subIdx")
    If Not objSession Is Nothing Then
        report1.ReportParameters("subIdx").Value = objSession
    End If
 
 
    ReportViewer1.Report = report1
    ReportViewer1.RefreshReport()
    ' End If
 
End Sub


VS 2010, Reporting 2012 Q1

Thanks.

2 Answers, 1 is accepted

Sort by
0
Ed Lance
Top achievements
Rank 1
answered on 27 Mar 2012, 11:35 PM
Ok, figured this one out. 

If you set the ReportViewer control's height to a percentage (versus pixels) the report area won't show unless the tag that contains the reportviewer (i.e. a div tag) and possibly all parent tags, has a height set.  I had everything set up for that but then added one div tag without a height and that threw it off. 
0
Jon_BCV
Top achievements
Rank 1
answered on 27 Jun 2013, 11:29 PM
 Thanks!!!!!!!!!!!

This was driving me crazy for hours.!!!

thx for the post
Tags
General Discussions
Asked by
Ed Lance
Top achievements
Rank 1
Answers by
Ed Lance
Top achievements
Rank 1
Jon_BCV
Top achievements
Rank 1
Share this question
or