Constructor not found

Posted by: prescott.chartier on 7 February 2020, 11:39 pm EST

    • Post Options:
    • Link

    Posted 7 February 2020, 11:39 pm EST

    I’ve used this code in a vb.net web application for years, I copied it into a vb.net web service and I get the subject error when I run it. What am I missing here?

    My Code:

        
    Public Function CompilePacket(ByVal pUsername as string, ByVal pPassword as string, ByVal MyDataSet As DataSet) As Object
            Dim MyConnection As OracleConnection = OpenConnection(pUsername), pPassword)
            Dim packet As DataSet = GetPacket(MyConnection)
            MyConnection.Close()
            MyConnection.Dispose()
            MyConnection = Nothing
            Dim MyDataRow As DataRow
            Dim MyDataRow2 As DataRow
            Dim MyDataSetClone As New DataSet
            Dim DataTableCopy As DataTable = MyDataSet.Tables(0).Copy
            Dim rpt As New AdditionalReport
            Dim rpt2 As Object
            For Each MyDataRow2 In MyDataSet.Tables(0).Rows
                MyDataSetClone = MyDataSet.Clone
                MyDataSetClone.Tables(0).ImportRow(MyDataRow2)
                MyDataSetClone.Tables(0).TableName = "Data"
                For Each MyDataRow In packet.Tables(0).Rows
                    rpt2 = New AdditionalReport
                    Dim typename As String = "DataInterface." & MyDataRow("ObjectName") & ", DataInterfce"
                    Dim type__1 As Type = System.Type.GetType(typename)
                    DirectCast(rpt2.Sections(0).Controls(0), GrapeCity.ActiveReports.SectionReportModel.SubReport).Report = Activator.CreateInstance(type__1)
                    rpt2.Sections(0).Controls(0).report.datasource = MyDataSetClone.Tables(0)
                    rpt2.run()
                    rpt.Document.Pages.AddRange(rpt2.Document.pages)
                Next
            Next
            Return rpt
        End Function
    
    
  • Posted 10 February 2020, 5:12 am EST

    Hello,

    Could you please try with the following code:

    For Each MyDataRow In packet.Tables(0).Rows
                    rpt2 = New AdditionalReport
                    Dim typename As String = "DataInterface." & MyDataRow("ObjectName") & ", DataInterfce"
                    Dim type__1 As Type = System.Type.GetType(typename)
                    DirectCast(rpt2.Sections(0).Controls(0), GrapeCity.ActiveReports.SectionReportModel.SubReport).Report = Activator.CreateInstance(type__1)
                    rpt2.Sections(0).Controls(0).report.datasource = MyDataSetClone.Tables(0)
                    rpt2.Run()
                    rpt.Run()
                    rpt.Document.Pages.AddRange(rpt2.Document.pages)
                Next
    

    If problem still occurs, could you please share the stripped-down running application so that I can arrow down the issue.

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels