How to passing run-time created dataset to report ?
Posted: Mon Apr 27, 2009 8:12 am
Hello to you,
I'm newbie in .net world, also newbie using stimulsoft report.
I'm using VB.NET 2005, StimulReport 2008.2, MS-ACCESS 2000 database
How to passing data to report ?
The scenario is :
I hv database named "ABC"
contains TBLCUSTOMER (CustomerID, CustomerName, Address)
I hv a Form, named "Form1"
contains button "btnPreview"
I want to do is :
When "btnPreview" clicked, I want to passing the data table (dt) for customername like 'J%' to preview
I try put some code to btnPreview as shown :
Public dt As DataTable
Public da As OleDb.OleDbDataAdapter
da = New OleDb.OleDbDataAdapter("select * from tblCustomer where customerid like 'J%'", pCnn2AppDB)
dt = New DataTable()
da.Fill(dt)
Dim rpt As New Stimulsoft.Report.StiReport
rpt.Load("c:\test.mrt")
rpt.RegData("dt", dt)
rpt.Show()
from above code, the report will shown all the data, but I just want to show for CustomerName like 'J%'
Please show me the code & guide me step by step.
I'm newbie in .net world, also newbie using stimulsoft report.
I'm using VB.NET 2005, StimulReport 2008.2, MS-ACCESS 2000 database
How to passing data to report ?
The scenario is :
I hv database named "ABC"
contains TBLCUSTOMER (CustomerID, CustomerName, Address)
I hv a Form, named "Form1"
contains button "btnPreview"
I want to do is :
When "btnPreview" clicked, I want to passing the data table (dt) for customername like 'J%' to preview
I try put some code to btnPreview as shown :
Public dt As DataTable
Public da As OleDb.OleDbDataAdapter
da = New OleDb.OleDbDataAdapter("select * from tblCustomer where customerid like 'J%'", pCnn2AppDB)
dt = New DataTable()
da.Fill(dt)
Dim rpt As New Stimulsoft.Report.StiReport
rpt.Load("c:\test.mrt")
rpt.RegData("dt", dt)
rpt.Show()
from above code, the report will shown all the data, but I just want to show for CustomerName like 'J%'
Please show me the code & guide me step by step.