Report viewer does not show the report when it runs on the server, but does it in local mode

0

Good. I'm working with asp.net. It turns out that I have a report that I generate in this way:

private void MostrarReporte()
    {
        //reset
        rptViewerActaVolante.Reset();
        //dataSource
        int idMateria = Convert.ToInt32( Session["materia"]);
        DataTable dt = getData(idMateria);
        ReportDataSource rds = new ReportDataSource("DataSetActaVolante", dt);
        rptViewerActaVolante.LocalReport.DataSources.Add(rds);
        //path
        rptViewerActaVolante.ProcessingMode = ProcessingMode.Local;

        LocalReport localReport = rptViewerActaVolante.LocalReport;
        rptViewerActaVolante.LocalReport.ReportPath = "ActaVolante.rdlc";
        //refresh
        rptViewerActaVolante.LocalReport.Refresh();
    }

    private DataTable getData(int idMateria)
    {
        DataTable dt = new DataTable();
        using (SqlConnection conn = new SqlConnection(Conexion.Cn))
        {
            SqlCommand cmd = new SqlCommand("spreporte_actaVolante", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@idMateria", SqlDbType.Int).Value = idMateria;

            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            adp.Fill(dt);
        }
        return dt;
    }

In local mode it worked fine, but when I did the deploy it gives me the following error:

  

An error occurred during local report processing.   The report definition for report 'ActaVolante' has not been specified   The file '\ xxxx \ public_html \ ActaVolante.rdlc' could not be found.

    
asked by Nicolas Comaschi 17.04.2017 в 21:05
source

1 answer

2

Copy the *.rdlc files of your reports to the server. In the public_html folder to be more accurate.

To avoid that, click on your file .rdlc , in properties:

Copy to the output directory: Always copy

    
answered by 17.04.2017 / 21:43
source