majeeka
asked on
crystal reports vb.net
Hi,
i'm creating a VB.net project. in the project i use datasets and VB adapters and now i would like to use crystal reports to display these datasets as charts. currently i can display the datasets in a datagrid and when i run the project this works fine.
i've created a report using the crystal reports wizard.
In the wizard I set one of the datasets as the source of information. On the form I have inserted a crystal report viewer and set the data source to be the report.
However when I now run the project, I get a database logon request. I don't know why it would ask me for this as I don't need to connect supply this information when I'm returning the dataset to the datagrid. I have checked all the fields and they match up correctly with the naming in the database.
I've pasted the report code below.
Thanks in advance to anyone who can help me out here!!!!! I'm going crazy!
Majeeka
Option Strict Off
Option Explicit On
Imports CrystalDecisions.CrystalRe ports.Engi ne
Imports CrystalDecisions.ReportSou rce
Imports CrystalDecisions.Shared
Imports System
Imports System.ComponentModel
Public Class CrystalReport1
Inherits ReportClass
Public Sub New()
MyBase.New
End Sub
Public Overrides Property ResourceName As String
Get
Return "CrystalReport1.rpt"
End Get
Set
'Do nothing
End Set
End Property
<Browsable(false), _
DesignerSerializationVisib ilityAttri bute(Syste m.Componen tModel.Des ignerSeria lizationVi sibility.H idden)> _
Public ReadOnly Property Section1 As CrystalDecisions.CrystalRe ports.Engi ne.Section
Get
Return Me.ReportDefinition.Sectio ns(0)
End Get
End Property
<Browsable(false), _
DesignerSerializationVisib ilityAttri bute(Syste m.Componen tModel.Des ignerSeria lizationVi sibility.H idden)> _
Public ReadOnly Property Section2 As CrystalDecisions.CrystalRe ports.Engi ne.Section
Get
Return Me.ReportDefinition.Sectio ns(1)
End Get
End Property
<Browsable(false), _
DesignerSerializationVisib ilityAttri bute(Syste m.Componen tModel.Des ignerSeria lizationVi sibility.H idden)> _
Public ReadOnly Property Section3 As CrystalDecisions.CrystalRe ports.Engi ne.Section
Get
Return Me.ReportDefinition.Sectio ns(2)
End Get
End Property
<Browsable(false), _
DesignerSerializationVisib ilityAttri bute(Syste m.Componen tModel.Des ignerSeria lizationVi sibility.H idden)> _
Public ReadOnly Property Section4 As CrystalDecisions.CrystalRe ports.Engi ne.Section
Get
Return Me.ReportDefinition.Sectio ns(3)
End Get
End Property
<Browsable(false), _
DesignerSerializationVisib ilityAttri bute(Syste m.Componen tModel.Des ignerSeria lizationVi sibility.H idden)> _
Public ReadOnly Property Section5 As CrystalDecisions.CrystalRe ports.Engi ne.Section
Get
Return Me.ReportDefinition.Sectio ns(4)
End Get
End Property
End Class
<System.Drawing.ToolboxBit mapAttribu te(GetType (CrystalDe cisions.Sh ared.Expor tOptions), "report.bmp")> _
Public Class CachedCrystalReport1
Inherits Component
Implements ICachedReport
Public Sub New()
MyBase.New
End Sub
Public Overridable Property IsCacheable As Boolean Implements CrystalDecisions.ReportSou rce.ICache dReport.Is Cacheable
Get
Return true
End Get
Set
'
End Set
End Property
Public Overridable Property ShareDBLogonInfo As Boolean Implements CrystalDecisions.ReportSou rce.ICache dReport.Sh areDBLogon Info
Get
Return false
End Get
Set
'
End Set
End Property
Public Overridable Property CacheTimeOut As System.TimeSpan Implements CrystalDecisions.ReportSou rce.ICache dReport.Ca cheTimeOut
Get
Return CachedReportConstants.DEFA ULT_TIMEOU T
End Get
Set
'
End Set
End Property
Public Overridable Function CreateReport() As CrystalDecisions.CrystalRe ports.Engi ne.ReportD ocument Implements CrystalDecisions.ReportSou rce.ICache dReport.Cr eateReport
Dim rpt As CrystalReport1 = New CrystalReport1
rpt.Site = Me.Site
Return rpt
End Function
Public Overridable Function GetCustomizedCacheKey(ByVa l request As RequestContext) As String Implements CrystalDecisions.ReportSou rce.ICache dReport.Ge tCustomize dCacheKey
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.BuildComple teCacheKey (
' request,
' null, // sReportFilename
' this.GetType(),
' this.ShareDBLogonInfo );
Return key
End Function
End Class
i'm creating a VB.net project. in the project i use datasets and VB adapters and now i would like to use crystal reports to display these datasets as charts. currently i can display the datasets in a datagrid and when i run the project this works fine.
i've created a report using the crystal reports wizard.
In the wizard I set one of the datasets as the source of information. On the form I have inserted a crystal report viewer and set the data source to be the report.
However when I now run the project, I get a database logon request. I don't know why it would ask me for this as I don't need to connect supply this information when I'm returning the dataset to the datagrid. I have checked all the fields and they match up correctly with the naming in the database.
I've pasted the report code below.
Thanks in advance to anyone who can help me out here!!!!! I'm going crazy!
Majeeka
Option Strict Off
Option Explicit On
Imports CrystalDecisions.CrystalRe
Imports CrystalDecisions.ReportSou
Imports CrystalDecisions.Shared
Imports System
Imports System.ComponentModel
Public Class CrystalReport1
Inherits ReportClass
Public Sub New()
MyBase.New
End Sub
Public Overrides Property ResourceName As String
Get
Return "CrystalReport1.rpt"
End Get
Set
'Do nothing
End Set
End Property
<Browsable(false), _
DesignerSerializationVisib
Public ReadOnly Property Section1 As CrystalDecisions.CrystalRe
Get
Return Me.ReportDefinition.Sectio
End Get
End Property
<Browsable(false), _
DesignerSerializationVisib
Public ReadOnly Property Section2 As CrystalDecisions.CrystalRe
Get
Return Me.ReportDefinition.Sectio
End Get
End Property
<Browsable(false), _
DesignerSerializationVisib
Public ReadOnly Property Section3 As CrystalDecisions.CrystalRe
Get
Return Me.ReportDefinition.Sectio
End Get
End Property
<Browsable(false), _
DesignerSerializationVisib
Public ReadOnly Property Section4 As CrystalDecisions.CrystalRe
Get
Return Me.ReportDefinition.Sectio
End Get
End Property
<Browsable(false), _
DesignerSerializationVisib
Public ReadOnly Property Section5 As CrystalDecisions.CrystalRe
Get
Return Me.ReportDefinition.Sectio
End Get
End Property
End Class
<System.Drawing.ToolboxBit
Public Class CachedCrystalReport1
Inherits Component
Implements ICachedReport
Public Sub New()
MyBase.New
End Sub
Public Overridable Property IsCacheable As Boolean Implements CrystalDecisions.ReportSou
Get
Return true
End Get
Set
'
End Set
End Property
Public Overridable Property ShareDBLogonInfo As Boolean Implements CrystalDecisions.ReportSou
Get
Return false
End Get
Set
'
End Set
End Property
Public Overridable Property CacheTimeOut As System.TimeSpan Implements CrystalDecisions.ReportSou
Get
Return CachedReportConstants.DEFA
End Get
Set
'
End Set
End Property
Public Overridable Function CreateReport() As CrystalDecisions.CrystalRe
Dim rpt As CrystalReport1 = New CrystalReport1
rpt.Site = Me.Site
Return rpt
End Function
Public Overridable Function GetCustomizedCacheKey(ByVa
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.BuildComple
' request,
' null, // sReportFilename
' this.GetType(),
' this.ShareDBLogonInfo );
Return key
End Function
End Class
ASKER
Thanks,
Sorry i'm having trouble understanding exactly where to put this? I pasted it into the form but it is giving errors regarding the oledbConnection not defined and the same error for the oledbdataAdapter?
I'm sorry for not getting this, i've pasted the form below and if you could take a look and and instruct me on where to insert the code, i'd greatly appreciate it.
Thanks,
majeeka.
Public Class Stock
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.ICon tainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Butto n
Friend WithEvents DataGrid1 As System.Windows.Forms.DataG rid
Friend WithEvents Button2 As System.Windows.Forms.Butto n
Friend WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDat aAdapter
Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCom mand
Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbCon nection
Friend WithEvents DsStockTake1 As fyp.dsStockTake
Friend WithEvents Button3 As System.Windows.Forms.Butto n
Friend WithEvents CrystalReportViewer1 As CrystalDecisions.Windows.F orms.Cryst alReportVi ewer
<System.Diagnostics.Debugg erStepThro ugh()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Button1 = New System.Windows.Forms.Butto n
Me.DataGrid1 = New System.Windows.Forms.DataG rid
Me.DsStockTake1 = New fyp.dsStockTake
Me.Button2 = New System.Windows.Forms.Butto n
Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDat aAdapter
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCom mand
Me.OleDbConnection1 = New System.Data.OleDb.OleDbCon nection
Me.Button3 = New System.Windows.Forms.Butto n
Me.CrystalReportViewer1 = New CrystalDecisions.Windows.F orms.Cryst alReportVi ewer
CType(Me.DataGrid1, System.ComponentModel.ISup portInitia lize).Begi nInit()
CType(Me.DsStockTake1, System.ComponentModel.ISup portInitia lize).Begi nInit()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Anchor = System.Windows.Forms.Ancho rStyles.To p
Me.Label1.Font = New System.Drawing.Font("Verda na", 18.0!, System.Drawing.FontStyle.R egular, System.Drawing.GraphicsUni t.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(264, 24)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(392, 24)
Me.Label1.TabIndex = 7
Me.Label1.Text = "Stock-Take"
Me.Label1.TextAlign = System.Drawing.ContentAlig nment.Midd leCenter
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(704, 584)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(144, 23)
Me.Button1.TabIndex = 8
Me.Button1.Text = "Update Database"
'
'DataGrid1
'
Me.DataGrid1.DataMember = "Product"
Me.DataGrid1.DataSource = Me.DsStockTake1
Me.DataGrid1.HeaderForeCol or = System.Drawing.SystemColor s.ControlT ext
Me.DataGrid1.Location = New System.Drawing.Point(40, 152)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.Size = New System.Drawing.Size(800, 200)
Me.DataGrid1.TabIndex = 9
'
'DsStockTake1
'
Me.DsStockTake1.DataSetNam e = "dsStockTake"
Me.DsStockTake1.EnforceCon straints = False
Me.DsStockTake1.Locale = New System.Globalization.Cultu reInfo("en -IE")
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(48, 120)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(112, 24)
Me.Button2.TabIndex = 10
Me.Button2.Text = "Launch StockTake"
'
'OleDbDataAdapter1
'
Me.OleDbDataAdapter1.Selec tCommand = Me.OleDbSelectCommand1
Me.OleDbDataAdapter1.Table Mappings.A ddRange(Ne w System.Data.Common.DataTab leMapping( ) {New System.Data.Common.DataTab leMapping( "Table", "Product", New System.Data.Common.DataCol umnMapping () {New System.Data.Common.DataCol umnMapping ("ProductI d", "ProductId"), New System.Data.Common.DataCol umnMapping ("prodId", "prodId"), New System.Data.Common.DataCol umnMapping ("stockTak eId", "stockTakeId"), New System.Data.Common.DataCol umnMapping ("ProductN ame", "ProductName"), New System.Data.Common.DataCol umnMapping ("actualSt ockLevel", "actualStockLevel"), New System.Data.Common.DataCol umnMapping ("finalCou nt", "finalCount"), New System.Data.Common.DataCol umnMapping ("differen ceReason", "differenceReason"), New System.Data.Common.DataCol umnMapping ("stockCat egory", "stockCategory")})})
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.Com mandText = "SELECT ProductId, ProductName FROM Product"
Me.OleDbSelectCommand1.Con nection = Me.OleDbConnection1
'
'OleDbConnection1
'
Me.OleDbConnection1.Connec tionString = "Integrated Security=SSPI;Packet Size=4096;Data Source=Katie;Tag with column colla" & _
"tion when possible=False;Initial Catalog=master;Use Procedure for Prepare=1;Auto" & _
" Translate=True;Persist Security Info=False;Provider=""SQLO LEDB.1"";W orkstation ID" & _
"=KATIE;Use Encryption for Data=False"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(264, 120)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 11
Me.Button3.Text = "test reading"
'
'CrystalReportViewer1
'
Me.CrystalReportViewer1.Ac tiveViewIn dex = -1
Me.CrystalReportViewer1.Lo cation = New System.Drawing.Point(224, 448)
Me.CrystalReportViewer1.Na me = "CrystalReportViewer1"
Me.CrystalReportViewer1.Re portSource = "C:\Documents and Settings\Katie Murphy\Desktop\FYP\BAR_VER SION3.1\Cr ystalRepor t1." & _
"rpt"
Me.CrystalReportViewer1.Si ze = New System.Drawing.Size(424, 176)
Me.CrystalReportViewer1.Ta bIndex = 12
'
'Stock
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(992, 666)
Me.Controls.Add(Me.Crystal ReportView er1)
Me.Controls.Add(Me.Button3 )
Me.Controls.Add(Me.Button2 )
Me.Controls.Add(Me.DataGri d1)
Me.Controls.Add(Me.Button1 )
Me.Controls.Add(Me.Label1)
Me.Name = "Stock"
Me.StartPosition = System.Windows.Forms.FormS tartPositi on.CenterS creen
Me.Text = "Stock"
CType(Me.DataGrid1, System.ComponentModel.ISup portInitia lize).EndI nit()
CType(Me.DsStockTake1, System.ComponentModel.ISup portInitia lize).EndI nit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.DialogResult = DialogResult.OK
End Sub
Private Sub Stock_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
DsStockTake1.Clear()
OleDbDataAdapter1.Fill(DsS tockTake1)
DsStockTake1.WriteXml("C:\ Documents and Settings\Katie Murphy\My Documents\Pocket_PC1 My Documents\sync.xml")
End Sub
Private Sub DataGrid1_Navigate(ByVal sender As System.Object, ByVal ne As System.Windows.Forms.Navig ateEventAr gs) Handles DataGrid1.Navigate
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim frmHelpDialog As New reading
frmHelpDialog.ShowDialog()
End Sub
End Class
Sorry i'm having trouble understanding exactly where to put this? I pasted it into the form but it is giving errors regarding the oledbConnection not defined and the same error for the oledbdataAdapter?
I'm sorry for not getting this, i've pasted the form below and if you could take a look and and instruct me on where to insert the code, i'd greatly appreciate it.
Thanks,
majeeka.
Public Class Stock
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.ICon
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Butto
Friend WithEvents DataGrid1 As System.Windows.Forms.DataG
Friend WithEvents Button2 As System.Windows.Forms.Butto
Friend WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDat
Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCom
Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbCon
Friend WithEvents DsStockTake1 As fyp.dsStockTake
Friend WithEvents Button3 As System.Windows.Forms.Butto
Friend WithEvents CrystalReportViewer1 As CrystalDecisions.Windows.F
<System.Diagnostics.Debugg
Me.Label1 = New System.Windows.Forms.Label
Me.Button1 = New System.Windows.Forms.Butto
Me.DataGrid1 = New System.Windows.Forms.DataG
Me.DsStockTake1 = New fyp.dsStockTake
Me.Button2 = New System.Windows.Forms.Butto
Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDat
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCom
Me.OleDbConnection1 = New System.Data.OleDb.OleDbCon
Me.Button3 = New System.Windows.Forms.Butto
Me.CrystalReportViewer1 = New CrystalDecisions.Windows.F
CType(Me.DataGrid1, System.ComponentModel.ISup
CType(Me.DsStockTake1, System.ComponentModel.ISup
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Anchor = System.Windows.Forms.Ancho
Me.Label1.Font = New System.Drawing.Font("Verda
Me.Label1.Location = New System.Drawing.Point(264, 24)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(392, 24)
Me.Label1.TabIndex = 7
Me.Label1.Text = "Stock-Take"
Me.Label1.TextAlign = System.Drawing.ContentAlig
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(704, 584)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(144, 23)
Me.Button1.TabIndex = 8
Me.Button1.Text = "Update Database"
'
'DataGrid1
'
Me.DataGrid1.DataMember = "Product"
Me.DataGrid1.DataSource = Me.DsStockTake1
Me.DataGrid1.HeaderForeCol
Me.DataGrid1.Location = New System.Drawing.Point(40, 152)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.Size = New System.Drawing.Size(800, 200)
Me.DataGrid1.TabIndex = 9
'
'DsStockTake1
'
Me.DsStockTake1.DataSetNam
Me.DsStockTake1.EnforceCon
Me.DsStockTake1.Locale = New System.Globalization.Cultu
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(48, 120)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(112, 24)
Me.Button2.TabIndex = 10
Me.Button2.Text = "Launch StockTake"
'
'OleDbDataAdapter1
'
Me.OleDbDataAdapter1.Selec
Me.OleDbDataAdapter1.Table
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.Com
Me.OleDbSelectCommand1.Con
'
'OleDbConnection1
'
Me.OleDbConnection1.Connec
"tion when possible=False;Initial Catalog=master;Use Procedure for Prepare=1;Auto" & _
" Translate=True;Persist Security Info=False;Provider=""SQLO
"=KATIE;Use Encryption for Data=False"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(264, 120)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 11
Me.Button3.Text = "test reading"
'
'CrystalReportViewer1
'
Me.CrystalReportViewer1.Ac
Me.CrystalReportViewer1.Lo
Me.CrystalReportViewer1.Na
Me.CrystalReportViewer1.Re
"rpt"
Me.CrystalReportViewer1.Si
Me.CrystalReportViewer1.Ta
'
'Stock
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(992, 666)
Me.Controls.Add(Me.Crystal
Me.Controls.Add(Me.Button3
Me.Controls.Add(Me.Button2
Me.Controls.Add(Me.DataGri
Me.Controls.Add(Me.Button1
Me.Controls.Add(Me.Label1)
Me.Name = "Stock"
Me.StartPosition = System.Windows.Forms.FormS
Me.Text = "Stock"
CType(Me.DataGrid1, System.ComponentModel.ISup
CType(Me.DsStockTake1, System.ComponentModel.ISup
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.DialogResult = DialogResult.OK
End Sub
Private Sub Stock_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
DsStockTake1.Clear()
OleDbDataAdapter1.Fill(DsS
DsStockTake1.WriteXml("C:\
End Sub
Private Sub DataGrid1_Navigate(ByVal sender As System.Object, ByVal ne As System.Windows.Forms.Navig
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim frmHelpDialog As New reading
frmHelpDialog.ShowDialog()
End Sub
End Class
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thats brilliant thanks!!!!!!
Use the following code to display crystal report.
Dim ss As New CrystalReport1
Dim dSet As New DataSet
Dim oleConn As New OleDbConnection("<Connecti
Dim oleAdapter As New OleDbDataAdapter
oleAdapter.SelectCommand = New OleDbCommand("<SQL String>", oleConn)
oleAdapter.Fill(dSet, "<Table Name specified in SQL String>")
ss.Database.Tables(0).SetD
CrystalReportViewer1.Repor