Error generating a crystal report report

0

I am having problems trying to generate a report made in crystal report from C #, this is an image of the error.

This is the code I am using to call the report:

        frmReporteDescuentosFaltanInabima view = new frmReporteDescuentosFaltanInabima();
        ReportDocument report = new DescuentoParaGarante();
        DatosInabima dsInabima = new DatosInabima();

        SqlConnection cn = new SqlConnection(DB.CadenaConexion);
        cn.Open();

        try
        {
            SqlDataAdapter da = new SqlDataAdapter("select a.NOMBRE, a.CEDULA, a.DESCUENTO from NOMINA_INABIMA_LLEGO_APLICAR a " +
                                                   "where not exists(select * from NOMINA_APLICAR_INABIMA b where b.doc_identificacion = a.CEDULA)", cn);
            da.SelectCommand.CommandType = CommandType.Text;
            da.Fill(dsInabima, "DESCUENTOS_FALTANTES");

            report.Load(RUTA_ARCHIVO+@\Reporte.rpt");
            report.SetDataSource(dsInabima);

            view.crystalReportViewer1.ReportSource = report;
            view.Show();
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        finally
        {
            cn.Close();
        }
    
asked by Ramón Zoquier 19.05.2017 в 12:58
source

1 answer

1

I have already found the error, hahaha, is that when I wrote the code I was a bit tired.

I declared the variable ReportDocument wrong, this would be the solution.

ReportDocument report = new ReportDocument();

Thanks anyway.

    
answered by 19.05.2017 / 14:44
source