Click here to Skip to main content
15,897,273 members
Articles / Programming Languages / Visual Basic

Open Door - Reporting, Charts, Enquiry Drill-Downs

Rate me:
Please Sign up or sign in to vote.
4.37/5 (11 votes)
2 Feb 2009CPOL6 min read 39.5K   2K   59  
A utility for generating user editable reports, charts, documents, enquiries
Public Class DataSourceList
inherits nbfBrowseCol
    Public Sub New()
        MyBase.new()
    End Sub
   Shadows Public Property Item(index As Integer) As DataSourceInfo
      Get
        Item = ctype(mybase.item(Index),DataSourceInfo)
      End Get
      Set (ByvaL Value as DataSourceInfo)
         List(index) = value
      End Set
   End Property
   shadows Readonly Public Property Item(indx As String) As DataSourceInfo
      Get
         Return CType(mybase.item(indx), DataSourceInfo)
      End Get
   End Property
   shadows Readonly Public Property Item() As DataSourceInfo
      Get
         Return CType(mybase.Item(), DataSourceInfo)
      End Get
   End Property
   shadows Public Function Add() As Integer
      dim ccon = new DataSourceInfo()
      Return mybase.Add(ccon)
   End Function 'Add
   shadows Public Function Add(value As DataSourceInfo) As Integer
        Return mybase.Add(value)
   End Function 'Add
    overrides Public Function AddNewEx() As Object
        dim cc as New DataSourceInfo()
        mybase.Add(cc)
        return ctype(mybase.list(mybase.list.Count - 1),DataSourceInfo)
    End Function
   shadows Public Function IndexOf(value As DataSourceInfo) As Integer
        return mybase.IndexOf(value)
   End Function 'IndexOf
   shadows Public Sub Insert(index As Integer, value As DataSourceInfo)
        mybase.Insert(index,value)
   End Sub 'Insert
   shadows Public Sub Remove(value As DataSourceInfo)
        mybase.Remove(value)
   End Sub 'Remove
   Public Sub Delete(Index As Integer)
    dim s as string
    list(index).delete
    List.RemoveAt(Index)
   End Sub
   Public Function Contains(value As DataSourceInfo) As Boolean
      ' If value is not of type Customer, this will return false.
      Return List.Contains(value)
   End Function 'Contains
   Protected Overrides Sub OnInsert(index As Integer, value As [Object])
      If Not value.GetType() Is Type.GetType("nbfSqlReporter.DataSourceInfo") Then
         Throw New ArgumentException("value must be of type DataSourceInfo.", "value")
      End If
   End Sub 'OnInsert
   Protected Overrides Sub OnRemove(index As Integer, value As [Object])
      If Not value.GetType() Is Type.GetType("nbfSqlReporter.DataSourceInfo") Then
         Throw New ArgumentException("value must be of type DataSourceInfo.", "value")
      End If
   End Sub 'OnRemove
   Protected Overrides Sub OnSet(index As Integer, oldValue As [Object], newValue As [Object])
      If Not newValue.GetType() Is Type.GetType("nbfSqlReporter.DataSourceInfo") Then
         Throw New ArgumentException("newValue must be of type DataSourceInfo.", "newValue")
      End If
   End Sub 'OnSet
   Protected Overrides Sub OnValidate(value As [Object])
      If Not value.GetType() Is Type.GetType("nbfSqlReporter.DataSourceInfo") Then
         Throw New ArgumentException("value must be of type DataSourceInfo.")
      End If
   End Sub 'OnValidate
	Public ReadOnly Property Name() As String
		Get
			Return "DataSourceInfos"
		End Get
	End Property	
End Class
public Class DataSourceInfo
    public ds as nbfDB.NbfResultSet
    public dtb as DataTable
    private pvDataSourceName as String
    private pvNoRows as Boolean = false
    public property DataSourceName() as String
    Get
        return pvDataSourceName
    End Get
    Set
        pvDataSourceName = Value
    End Set
    End Property
    public property NoRows as Boolean
    Get
        return pvNoRows
    End Get
    Set
        pvNoRows = Value
    End Set
    End Property
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions