Link to home
Start Free TrialLog in
Avatar of b001
b001Flag for Afghanistan

asked on

report

Hi Experts

i have datatable dt2 with fields
part
selling
I have report1.rdlc which has textBox1 and textBox2

how can I run report1 and bind data from dt2
part  in textBox1
and
selling  in textBox1

is that possible ?

Thanks
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

You would need to design the report using a dataset first and then populate it with datatable at runtime

http://msdn.microsoft.com/en-us/library/ms252094(v=vs.80).aspx
Create the report with a ghost dataset with the fields you want Then do somehitng like

StrSql = StrSql + "Señect .........")
ReportViewer1.Reset()
ReportViewer1.LocalReport.ReportEmbeddedResource = "WindowsApplication1.ReportName.rdlc"
Conn.Open()
adap1 = New System.Data.SqlClient.SqlDataAdapter(StrSql, Conn)
ds = New System.Data.DataSet()
adap1.Fill(ds, "Wherever")
Conn.Close()
ReportViewer1.LocalReport.DataSources.Clear()
Dim rs As Microsoft.Reporting.WinForms.ReportDataSource = Nothing
rs = New Microsoft.Reporting.WinForms.ReportDataSource("RerortDatasetGhostName", ds.Tables(0))
ReportViewer1.LocalReport.DataSources.Add(rs)
ReportViewer1.AutoSize = True
Me.ReportViewer1.RefreshReport()

Hope this help


ASKER CERTIFIED SOLUTION
Avatar of Alfredo Luis Torres Serrano
Alfredo Luis Torres Serrano
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial