Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Report viewer does not load, showing blank space - running local RDLC files

I got a problem with reporting services, running local rdlc files on the 2005 version.

I have in the HTML a report viewer set to run locally as follows :

 <rsweb:ReportViewer ID="ReportingServicesReportViewer" runat="server" Height="100%"
            ProcessingMode="Local" ShowParameterPrompts="False" Width="100%">
        </rsweb:ReportViewer>

In the code

// create SqlConnection
        SqlConnection myConnection = new SqlConnection(ConnectionString);
        myCommand.Connection = myConnection;
        SqlDataAdapter da = new SqlDataAdapter(myCommand);

        //get the data
        DataSet data = new DataSet();
        da.Fill(data);

        if (data != null && data.Tables.Count > 0 && data.Tables[0].Rows.Count > 0)
        {
            ReportingServicesReportViewer.Visible = true;
            ltrStatus.Text = string.Empty;

            //provide local report information to viewer
            ReportingServicesReportViewer.LocalReport.ReportPath = Server.MapPath(Report.RDLCPath);

            //bind the report attributes and data to the reportviewer
            ReportDataSource rds = new ReportDataSource("DataSet1", data.Tables[0]);
            ReportingServicesReportViewer.LocalReport.DataSources.Clear();
            ReportingServicesReportViewer.LocalReport.DataSources.Add(rds);
            ReportingServicesReportViewer.LocalReport.Refresh();
        }
        else
        {
            ReportingServicesReportViewer.Visible = false;
            ltrStatus.Text = "No data to display.";
        }

When the method to populate the report viewer with the results of the report is executed, nothing comes up as if the report viewer is not even there.

What I did to trouble shoot till now:

  • Checked the event viewer for errors and this is the only thing related which I get, [Domain]\sp_dbadmin Reason: Failed to open the explicitly specified database. . However, my user which I am connecting is a sysadmin. I have checked that and am sure because I checked the sys.server_role_members
  • I tried impersonating the logged in user, to no avail
  • I created a specific user with sysadmin rights, and gave all access rights both from IIS and also on the sql server 2008.

Has anyone encountered a problem similar to this, any ideas?

like image 674
Mez Avatar asked Oct 13 '11 13:10

Mez


People also ask

How do I get rid of blank pages in Rdlc report PDF?

Just decrease the size of your RDLC report page, it will not add additional page in PDF.

How do I reduce the size of my Rdlc report?

Hit F4 to see the properties tab. Here, you will see a "Size" property. This can be expanded for the width and height. The width you see here represents the width that the body of your report requires as printable area.

How can I print Rdlc directly without viewing?

How to print the RDLC report directly without viewing in WinRT ReportViewer? Printing reports directly without viewing is not supported. This can be achieved by exporting the reports into PDF and the resultant stream is used in the PdfDocument for printing. Initialize the ReportWriter and load the report stream.


1 Answers

I was getting the same problem when I add parameter in rdlc but not assigning it. I solved by adding this code.

Dim p_Date As Microsoft.Reporting.WebForms.ReportParameter
p_Date = New Microsoft.Reporting.WebForms.ReportParameter("DATE", txtDate.Text)
    Me.ReportViewer1.LocalReport.SetParameters(New Microsoft.Reporting.WebForms.ReportParameter() {p_Date})
    ReportViewer1.LocalReport.Refresh()
like image 176
user3567457 Avatar answered Oct 02 '22 14:10

user3567457