Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 21, 2012 06:43 AM by ali.alakhdar
Member
168 Points
83 Posts
Jun 20, 2012 07:55 PM|LINK
hi everyone
my problem is that when i set the datasource for the report and the report viewer i get the report loaded but without the data in in
here is the code i use
Dim da As New SqlDataAdapter Dim dt As New DataTable Dim cmdd As New SqlCommand cmdd.CommandType = CommandType.StoredProcedure cmdd.CommandText = "sp_selectcustombilldetailsbyid" cmdd.Parameters.AddWithValue("@custname", ComboBox1.SelectedValue) cmdd.Parameters.AddWithValue("@bbid", bbid) cmdd.Connection = conn da.SelectCommand = cmdd 'da.Fill(ds, "ds_custombill") da.Fill(dt) Dim bs1 As New BindingSource 'bs1.DataSource = ds.Tables("ds_custombill") bs1.DataSource = dt 'bs1.DataMember = "ds_custombill" 'DataGridView1.DataSource = bs1 SetReportParameters() Dim rptds As New Microsoft.Reporting.WinForms.ReportDataSource() rptds.Name = "dataset1" rptds.Value = bs1 Me.ReportViewer1.LocalReport.DataSources.Add(rptds) Me.ReportViewer1.ProcessingMode = ProcessingMode.Local Me.ReportViewer1.LocalReport.ReportPath = "C:\Users\Allouch\Documents\Visual Studio 2010\Projects\kassir-program\kassir-program\custombilldetails.rdlc" Me.ReportViewer1.RefreshReport()
if anyone can help
thanks in advance
Participant
993 Points
311 Posts
Jun 21, 2012 04:21 AM|LINK
first initially check weather there is a data in that table where ur retriving .if yes then later check the values are coming in dataset.
Jun 21, 2012 06:43 AM|LINK
thanks for your reply
in the problem resolved by matching the dataset names ( the report dataset and the prormammed dataset )
change 1 : rptds.Name = "name of th dataset in the report "
change 2: bas1.datasource=ds.tables (0)
ali.alakhdar
Member
168 Points
83 Posts
local report datasource - not showing data
Jun 20, 2012 07:55 PM|LINK
hi everyone
my problem is that when i set the datasource for the report and the report viewer i get the report loaded but without the data in in
here is the code i use
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Dim cmdd As New SqlCommand
cmdd.CommandType = CommandType.StoredProcedure
cmdd.CommandText = "sp_selectcustombilldetailsbyid"
cmdd.Parameters.AddWithValue("@custname", ComboBox1.SelectedValue)
cmdd.Parameters.AddWithValue("@bbid", bbid)
cmdd.Connection = conn
da.SelectCommand = cmdd
'da.Fill(ds, "ds_custombill")
da.Fill(dt)
Dim bs1 As New BindingSource
'bs1.DataSource = ds.Tables("ds_custombill")
bs1.DataSource = dt
'bs1.DataMember = "ds_custombill"
'DataGridView1.DataSource = bs1
SetReportParameters()
Dim rptds As New Microsoft.Reporting.WinForms.ReportDataSource()
rptds.Name = "dataset1"
rptds.Value = bs1
Me.ReportViewer1.LocalReport.DataSources.Add(rptds)
Me.ReportViewer1.ProcessingMode = ProcessingMode.Local
Me.ReportViewer1.LocalReport.ReportPath = "C:\Users\Allouch\Documents\Visual Studio 2010\Projects\kassir-program\kassir-program\custombilldetails.rdlc"
Me.ReportViewer1.RefreshReport()
if anyone can help
thanks in advance
sairam62.cse
Participant
993 Points
311 Posts
Re: local report datasource - not showing data
Jun 21, 2012 04:21 AM|LINK
first initially check weather there is a data in that table where ur retriving .if yes then later check the values are coming in dataset.
s.sairam
ali.alakhdar
Member
168 Points
83 Posts
Re: local report datasource - not showing data
Jun 21, 2012 06:43 AM|LINK
thanks for your reply
in the problem resolved by matching the dataset names ( the report dataset and the prormammed dataset )
change 1 : rptds.Name = "name of th dataset in the report "
change 2: bas1.datasource=ds.tables (0)