Generate Report from SQL Server VB.NET 2005 - Crystal Reports
BarCode SDK sample in Crystal Reports demonstrating ‘Generate Report from SQL Server VB.NET 2005’
CrystalReport1.vb
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.4927
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Imports System.ComponentModel
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.CrystalReports.Engine
Public Class CrystalReport1
Inherits ReportClass
Public Sub New()
End Sub
Public Overloads Overrides Property ResourceName() As String
Get
Return "CrystalReport1.rpt"
End Get
' Do nothing
Set
End Set
End Property
<Browsable(False)> _
<DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
Public ReadOnly Property Section1() As CrystalDecisions.CrystalReports.Engine.Section
Get
Return Me.ReportDefinition.Sections(0)
End Get
End Property
<Browsable(False)> _
<DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
Public ReadOnly Property Section2() As CrystalDecisions.CrystalReports.Engine.Section
Get
Return Me.ReportDefinition.Sections(1)
End Get
End Property
<Browsable(False)> _
<DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
Public ReadOnly Property Section3() As CrystalDecisions.CrystalReports.Engine.Section
Get
Return Me.ReportDefinition.Sections(2)
End Get
End Property
<Browsable(False)> _
<DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
Public ReadOnly Property Section4() As CrystalDecisions.CrystalReports.Engine.Section
Get
Return Me.ReportDefinition.Sections(3)
End Get
End Property
<Browsable(False)> _
<DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
Public ReadOnly Property Section5() As CrystalDecisions.CrystalReports.Engine.Section
Get
Return Me.ReportDefinition.Sections(4)
End Get
End Property
End Class
<System.Drawing.ToolboxBitmapAttribute(GetType(CrystalDecisions.Shared.ExportOptions), "report.bmp")> _
Public Class CachedCrystalReport1
Inherits Component
Implements ICachedReport
Public Sub New()
End Sub
<Browsable(False)> _
<DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
Public Overridable Property IsCacheable() As Boolean Implements ICachedReport.IsCacheable
Get
Return True
End Get
'
Set
End Set
End Property
<Browsable(False)> _
<DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
Public Overridable Property ShareDBLogonInfo() As Boolean Implements ICachedReport.ShareDBLogonInfo
Get
Return False
End Get
'
Set
End Set
End Property
<Browsable(False)> _
<DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _
Public Overridable Property CacheTimeOut() As System.TimeSpan Implements ICachedReport.CacheTimeOut
Get
Return CachedReportConstants.DEFAULT_TIMEOUT
End Get
'
Set
End Set
End Property
Public Overridable Function CreateReport() As CrystalDecisions.CrystalReports.Engine.ReportDocument Implements ICachedReport.CreateReport
Dim rpt As New CrystalReport1()
rpt.Site = Me.Site
Return rpt
End Function
Public Overridable Function GetCustomizedCacheKey(request As RequestContext) As String Implements ICachedReport.GetCustomizedCacheKey
Dim key As [String] = Nothing
' // The following is the code used to generate the default
' // cache key for caching report jobs in the ASP.NET Cache.
' // Feel free to modify this code to suit your needs.
' // Returning key == null causes the default cache key to
' // be generated.
'
' key = RequestContext.BuildCompleteCacheKey(
' request,
' null, // sReportFilename
' this.GetType(),
' this.ShareDBLogonInfo );
Return key
End Function
End Class
DataSet1.Designer.vb
��' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
' <