Click here to Skip to main content
15,893,588 members
Articles / Containers / Virtual Machine

ASP.NET Report Kit Grasshoper (Race to Linux)

Rate me:
Please Sign up or sign in to vote.
2.38/5 (5 votes)
2 Oct 20057 min read 38K   19  
Porting and deploying the report starter kit to Linux (RH7.3/Tomcat5.0.28/Grasshoper1.61)
<html><head><link rel=stylesheet href=style.css></head><body><div class=SourcePanel style='font-size:12'><pre style='background-color:white'>
<font color= "blue">Imports</font> System
<font color= "blue">Imports</font> System.Collections
<font color= "blue"></font>
<font color= "blue">Namespace</font> ASPNET.StarterKit.Reports.Components
<font color= "blue"></font>
<font color= "green">    '*********************************************************************</font>
<font color= "green">    '</font>
<font color= "green">    ' SimpleReportCollection Class </font>
<font color= "green">    '</font>
<font color= "green">    ' The SimpleReportCollection is a Custom SimpleReport collection used </font>
<font color= "green">    ' to represent a list of SimpleReport objects.</font>
<font color= "green">    '</font>
<font color= "green">    '</font>
<font color= "green">    '*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue">    Public Class</font> SimpleReportCollection
<font color= "blue">        Inherits</font> ArrayList
<font color= "blue"></font>
<font color= "blue">        Public Enum</font> SimpleReportFields
<font color= "blue">            </font>InitValue
<font color= "blue">            </font>City
<font color= "blue">            </font>CompanyName
<font color= "blue">            </font>ContactName
<font color= "blue">            </font>ContactTitle
<font color= "blue">            </font>Phone
<font color= "blue">        End Enum</font><font color= "green"> 'SimpleReportFields</font>
<font color= "blue"></font>
<font color= "blue">        Public Overloads Sub</font> Sort(ByVal sortField As SimpleReportFields, ByVal isAscending As Boolean)
<font color= "blue">            Select Case</font> sortField
<font color= "blue">                Case</font> SimpleReportFields.City
<font color= "blue">                    </font>MyBase.Sort(New CityComparer())
<font color= "blue">                Case</font> SimpleReportFields.CompanyName
<font color= "blue">                    </font>MyBase.Sort(New CompanyNameComparer())
<font color= "blue">                Case</font> SimpleReportFields.ContactName
<font color= "blue">                    </font>MyBase.Sort(New ContactNameComparer())
<font color= "blue">                Case</font> SimpleReportFields.ContactTitle
<font color= "blue">                    </font>MyBase.Sort(New ContactTitleComparer())
<font color= "blue">                Case</font> SimpleReportFields.Phone
<font color= "blue">                    </font>MyBase.Sort(New PhoneComparer())
<font color= "blue">            End Select</font>
<font color= "blue"></font>
<font color= "blue"></font><font color= "blue">            If </font>Not isAscending <font color= "blue">Then</font>
<font color= "blue">                </font>MyBase.Reverse()
<font color= "blue"></font><font color= "blue">            End If</font><font color= "blue"></font>
<font color= "blue">        End Sub</font><font color= "green"> 'Sort</font>
<font color= "blue"></font>
<font color= "blue">        Private </font>NotInheritable <font color= "blue"></font>Class CityComparer
<font color= "blue">            Implements</font> IComparer
<font color= "blue"></font>
<font color= "blue">            Public Function</font> Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare
<font color= "blue">                Dim </font>first <font color= "blue">As </font>SimpleReport = CType(x, SimpleReport)
<font color= "blue">                Dim </font>second <font color= "blue">As </font>SimpleReport = CType(y, SimpleReport)
<font color= "blue">                </font>Return <font color= "blue"></font>first.City.CompareTo(second.City)
<font color= "blue"></font><font color= "blue">            End Function</font><font color= "blue"></font><font color= "green"> 'Compare</font>
<font color= "blue"></font><font color= "blue">        End Class</font><font color= "blue"></font><font color= "green"> 'CityComparer</font>
<font color= "blue"></font>
<font color= "blue">        Private </font>NotInheritable <font color= "blue"></font>Class CompanyNameComparer
<font color= "blue">            Implements</font> IComparer
<font color= "blue"></font>
<font color= "blue">            Public Function</font> Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare
<font color= "blue">                Dim </font>first <font color= "blue">As </font>SimpleReport = CType(x, SimpleReport)
<font color= "blue">                Dim </font>second <font color= "blue">As </font>SimpleReport = CType(y, SimpleReport)
<font color= "blue">                </font>Return <font color= "blue"></font>first.CompanyName.CompareTo(second.CompanyName)
<font color= "blue"></font><font color= "blue">            End Function</font><font color= "blue"></font><font color= "green"> 'Compare</font>
<font color= "blue"></font><font color= "blue">        End Class</font><font color= "blue"></font><font color= "green"> 'CompanyNameComparer</font>
<font color= "blue"></font>
<font color= "blue">        Private </font>NotInheritable <font color= "blue"></font>Class ContactNameComparer
<font color= "blue">            Implements</font> IComparer
<font color= "blue"></font>
<font color= "blue">            Public Function</font> Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare
<font color= "blue">                Dim </font>first <font color= "blue">As </font>SimpleReport = CType(x, SimpleReport)
<font color= "blue">                Dim </font>second <font color= "blue">As </font>SimpleReport = CType(y, SimpleReport)
<font color= "blue">                </font>Return <font color= "blue"></font>first.ContactName.CompareTo(second.ContactName)
<font color= "blue"></font><font color= "blue">            End Function</font><font color= "blue"></font><font color= "green"> 'Compare</font>
<font color= "blue"></font><font color= "blue">        End Class</font><font color= "blue"></font><font color= "green"> 'ContactNameComparer</font>
<font color= "blue"></font>
<font color= "blue">        Private </font>NotInheritable <font color= "blue"></font>Class ContactTitleComparer
<font color= "blue">            Implements</font> IComparer
<font color= "blue"></font>
<font color= "blue">            Public Function</font> Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare
<font color= "blue">                Dim </font>first <font color= "blue">As </font>SimpleReport = CType(x, SimpleReport)
<font color= "blue">                Dim </font>second <font color= "blue">As </font>SimpleReport = CType(y, SimpleReport)
<font color= "blue">                </font>Return <font color= "blue"></font>first.ContactTitle.CompareTo(second.ContactTitle)
<font color= "blue"></font><font color= "blue">            End Function</font><font color= "blue"></font><font color= "green"> 'Compare</font>
<font color= "blue"></font><font color= "blue">        End Class</font><font color= "blue"></font><font color= "green"> 'ContactTitleComparer</font>
<font color= "blue"></font>
<font color= "blue">        Private </font>NotInheritable <font color= "blue"></font>Class PhoneComparer
<font color= "blue">            Implements</font> IComparer
<font color= "blue"></font>
<font color= "blue">            Public Function</font> Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare
<font color= "blue">                Dim </font>first <font color= "blue">As </font>SimpleReport = CType(x, SimpleReport)
<font color= "blue">                Dim </font>second <font color= "blue">As </font>SimpleReport = CType(y, SimpleReport)
<font color= "blue">                </font>Return <font color= "blue"></font>first.Phone.CompareTo(second.Phone)
<font color= "blue"></font><font color= "blue">            End Function</font><font color= "blue"></font><font color= "green"> 'Compare</font>
<font color= "blue"></font><font color= "blue">        End Class</font><font color= "blue"></font><font color= "green"> 'PhoneComparer</font>
<font color= "blue"></font><font color= "blue">    End Class</font><font color= "blue"></font><font color= "green"> 'SimpleReportCollection</font>
<font color= "blue"></font><font color= "blue">End Namespace</font><font color= "blue"></font><font color= "green"> 'ASPNET.StarterKit.Reports.Components</font>
</pre>

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
I love to code! Working in C# is my passion, visit my github

Comments and Discussions