I can not initialize a ReportViewer in VS2017, but in DataTools 2015 it works correctly

0

I have been having problems with a .rdl report that I made in Data Tools 2015 in a C # Windows Forms project in VS2017. Following this guide I have managed to import my report to the application and associate it with my reportviewer, but when I start the Form nothing appears, not even an error message.

This is the code I've been handling:

private void frmReportePrivado_Load(object sender, EventArgs e)
    {
        reportViewer1.ProcessingMode = ProcessingMode.Local;
        LocalReport localReport = reportViewer1.LocalReport;
        localReport.ReportEmbeddedResource = "Soporte.ReporteAulasPrivadas.rdlc";
        localReport.ReportPath = "ReporteAulasPrivadas.rdlc";

        ReportParameter rpIDReporte = new ReportParameter();
        rpIDReporte.Name = "IDReporte";
        rpIDReporte.Values.Add(Conexion.IDReporte.ToString());

        // Set the report parameters for the report  
        localReport.SetParameters(
            new ReportParameter[] { rpIDReporte });

        this.reportViewer1.RefreshReport();
    }

When I insert it from the properties of the reportviewer if it seems to work, but I'm interested in doing it with embedded resources if possible, and apparently from the properties I have to declare a common file address to associate the reportviewer with the report.

EDIT: I think I managed to make it work using the same properties of the reportviewer and it seems to work, but now it marks me the error No data source instance has been provided for the DataSet1 data source I understood that this data source was already embedded in the same .rdl because I configured it from there. What should I put in that data source? In the Data Tools just place the connection string, should I put it back into the code?

    
asked by M. Lugo 05.12.2017 в 18:46
source

0 answers