Referencing ObjectDataSource data fields for a report definition(Still Need Help Please) RRS feed

  • Question

  • I have several calculated fields that I would like to pass to a web form report. I am having difficulty finding a good example that would help me accomplish this task. I have done this in a VB Windows form program by assigning a bindingsource to the business object class. I am not quite sure how to  do this. The binding source functions found in the Windows form classes are not available in the Web form classes. The following code shows my business object class.

    Public Class FltCtlLogReportHeaderClass
        Private m_totalblock As Double
        Private m_totalflight As Double

        Public Property TotalBlock() As Double
                Return m_totalblock
            End Get
            Set(ByVal value As Double)
                m_totalblock = value
            End Set
        End Property
        Public Property TotalFlight() As Double
                Return m_totalflight
            End Get
            Set(ByVal value As Double)
                m_totalflight = value
            End Set
        End Property

    End Class

    This class works for a Windows program.

    How do I initialize the data fields prior to calling the report definition and assign the class to reportviewer object. Any help would be much appreciated, thanks.
    • Edited by VBJetGuy Saturday, July 25, 2009 1:04 PM
    Wednesday, July 8, 2009 1:39 AM


All replies

  • You can use that class in a report in webforms similar to the winforms report viewer.  This sample shows how to do it for webforms:

    Thursday, July 9, 2009 2:34 AM
  • Thanks for the reply. Yes I have followed that example, but I still do not understand how to initialize the class data fields with values generated inside the program. The example shows a list which I do not have and static hard coded data values. I would like to pass a value to both my data fields in the class from within my program to the class prior to opening the report definition. Additionally, I do not see the class as a datasource when I am designing the report. As previously stated, used this class definition in a Winform program  by using a binding source object that I related to the class. However this feature does not seem to be available in the webform application. Would like to get further comments and suggestions on this problem that I having. Thanks
    Thursday, July 9, 2009 12:45 PM
  • Hey if anyone is reading this thread that can help me out I would appreciate it. I am still struggling with this problem. How do I initialize these data fields in my program code and pass it on to the report. The example in the documentation has hard coded data values. I have fields that I need to calculate and then pass on to the report.
    Saturday, July 25, 2009 12:59 PM
  • I work at it myself and figured it out.  Thanks for the offers of help.
    • Marked as answer by VBJetGuy Tuesday, July 28, 2009 2:56 PM
    Tuesday, July 28, 2009 2:55 PM