xtrareport Object reference not set to an instance of an object

2

I am trying to visualize a report in vb.net which uses as report Xtrareport but the same I did in a separate project, when I try to pass the parameters I get this error:

  

Object reference not set to an instance of an object.

This is the code:

Public Sub CreateAndShowReport1(ByVal Codprestamo As String)

    Dim report As XtraReport =  XtraReport.FromFile("F:\J_RAMIREZ\PROYECTOS\Easy Money\Easy Money\Reportes\RptAmortizacion.repx", True)

    report.Parameters("Codempresa").Value = Codempresa
    report.Parameters("Codprestamo").Value = Codprestamo

    Dim printTool As New ReportPrintTool(report)
    printTool.ShowPreviewDialog()

End Sub
    
asked by JOSE ANGEL RAMIREZ HERNANDEZ 12.08.2016 в 06:44
source

1 answer

1

I solved the problem on my own and it was not instantiating the object this is the code after the modification

    Dim Report as New xtraReport
    Public Sub CreateAndShowReport1(ByVal Codprestamo As String) 
             XtraReport =XtraReport.FromFile("F:\J_RAMIREZ\PROYECTOS\Easy Money\Easy Money\Reportes\RptAmortizacion.repx", True)
 report.Parameters("Codempresa").Value = Codempresa
 report.Parameters("Codprestamo").Value = Codprestamo 
Dim printTool As New ReportPrintTool(report)
 printTool.ShowPreviewDialog() 
        End Sub
    
answered by 24.09.2016 / 13:42
source