How to passing data table to report ? customername like 'J%'
Posted: Wed Apr 22, 2009 3:35 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.
or maybe I'm wrong in creating TEST.MRT ???
When creating TEST.MRT, I create Connection, named dt, also creating datasource named it as dt
NOTE : Actually I want attach TEST.MRT, but I don't how to attach it witihin this forum.
regards,
Steven
email : stvhui@yahoo.com
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.
or maybe I'm wrong in creating TEST.MRT ???
When creating TEST.MRT, I create Connection, named dt, also creating datasource named it as dt
NOTE : Actually I want attach TEST.MRT, but I don't how to attach it witihin this forum.
regards,
Steven
email : stvhui@yahoo.com