How to Declare a varaible before it is used RRS feed

  • Question

  • Hi

    I have a local report that I am calling the render function. One of the properties is a Microsotft.reporting.windforms.warning.  The compiler is complaning (only a warning) that the variable has not been assigned a value before it is called.

    My Code is as follows

     Dim warnings As Warning()

        m_streams = New List(Of Stream)()


        myLocalReport.Render("Image", deviceInfo, AddressOf CreateStream, warnings)

        For Each stream As Stream In m_streams

          stream.Position = 0


    How do I set a value to this property  before it is used.


    Any assistance would be greatly apprecated



    Friday, December 2, 2011 8:25 PM

All replies

  • Hello Anthony,

    What is this Warning object ? Never seen this before ...

    Should you try : Dim warnings As New Warning()

    Friday, December 2, 2011 10:22 PM
  • Hi


    Its a microsoft.reporting.winforms.warning.


    I didnt write the code - found it on the net.  But I managed to get around the problem by


    dim warnings as warnings = nothing 

    This seemed to do the trick



    Thursday, December 8, 2011 5:49 PM