You are on page 1of 1

Private Sub XtraReport1_DataSourceDemanded(ByVal sender As Object, ByVal e As Ev

entArgs)
Dim report As XtraReport = TryCast(sender, XtraReport)
Dim adapter As New OleDbDataAdapter("SELECT * FROM Categories", "Pro
vider=Microsoft.Jet.OLEDB.4.0;Data Source=..\..\nwind.mdb")
Dim ds As New DataSet()
adapter.Fill(ds)
report.DataSource = ds
End Sub
i already try this,,, should i call "XtraReport1_DataSourceDemanded"? in a parti
cular event?

lee porciun3 years ago

actually sir this is my code:


--------------------------------------------------------------------------------Imports MySql.Data.MySqlClient
Public Class Form1
Dim con As MySqlConnection
Dim Report As New XtraReport1()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.Eve
ntArgs) Handles MyBase.Load
PrintControl1.PrintingSystem = Report.PrintingSystem
Report.CreateDocument()
End Sub
Private Sub XtraReport1_DataSourceDemanded(ByVal sender As Object, ByVal e A
s EventArgs)
Dim report As XtraReport1 = TryCast(sender, XtraReport1)
con = New MySqlConnection("Server = localhost; database=softwen; uid=ro
ot;pwd=")
Dim adapter As New MySqlDataAdapter("select * from item", con)
Dim ds As New DataSet()
adapter.Fill(ds)
report.DataSource = ds
End Sub
End Class
---------------------------------------------------------------------------------

You might also like