Microsoft Developer Network >
Forums Home
>
Visual Studio Express Editions Forums
>
Visual Basic Express Edition
>
Data not getting displayed in report viewer
Data not getting displayed in report viewer
- Hi ,
Iam trying to display the database table using reportviewer object.
Iam using Mysql database,
iam able to populate results in Datagridview object
Some how the table is not getting visible in report viewer,
In a form i created a reportviewer object,also added reportitem in the project
Below is the code used,
Could any one please help,Dim
mycon As
MySqlConnection = New
MySqlConnection("Server=IP;Database=abc;User ID=root;Password=123;" )
Dim sql As MySqlCommand = New MySqlCommand("SELECT * FROM table" , mycon)
mycon.Open()
Dim myadp As MySqlDataAdapter = New MySqlDataAdapter(sql)
Dim myds As DataSet = New DataSet()
myadp.Fill(myds, "table" )
'I can see datagridview
DataGridView1.DataSource = myds.Tables("table" ).DefaultView
'Dim table1 As DataTable
'table1 = myds.Tables(0)
Me .ReportViewer1.ProcessingMode = ProcessingMode.LocalReportViewer1.LocalReport.ReportPath = "C:\Documents and Settings\Admin\My Documents\Visual Studio 2005\Projects\Myapp\Myapp\Report1.rdlc"
Me .ReportViewer1.LocalReport.DataSources.Clear()
Me .ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("table" , myds.Tables("table" )))
Me .ReportViewer1.RefreshReport()
mycon.Close()
Thanks in advance ,- Edited byVB_netBeginner09 Wednesday, November 04, 2009 9:33 AMFormatting
Answers
- Hi VB_netBeginner09,
Do you want to connect a Dataset created in code with ReportViewer? I think you can look into the following link for some information
http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/94874327-e47e-4218-8e62-1962828f2a60
You can consider posting it at Visual Studio Report Controls forum for quicker and better responses. Thanks!
Regards
Jeff Shan
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Proposed As Answer byMaDFroG20091013 Wednesday, November 11, 2009 1:15 AM
- Marked As Answer byMartin Xie - MSFTMSFT, ModeratorWednesday, November 11, 2009 5:12 AM
All Replies
I think the problem is your code is the source of your locl file.
Try it Using CMM As New SqlConnection(sStrin) Dim Dataap As New SqlDataAdapter(New SqlCommand("Select * From Table_Inf Where FirstName='" & NN & "'", CMM)) CMM.Open() Dim MeTable As New DataSet MeTable.Tables.Add("Table_Inf") Dataap.Fill(MeTable, "Table_Inf") Dim DB As New BindingSource DB.DataSource = MeTable.Tables("Table_Inf") Me.DataGridView1.DataSource = DB 'Me.ReportViewer1.Reset() Me.ReportViewer1.ProcessingMode = ProcessingMode.Local Dim newds As New _ Microsoft.Reporting.WinForms.ReportDataSource("MeTable") newds.Value = DB Me.ReportViewer1.LocalReport.DataSources.Add(newds) Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "ClientReportApp.Report2.rdlc" ---put the c:/ souce here Me.ReportViewer1.RefreshReport() End UsingEnd Using
Don't judge me, just Upgrade me. Thanks!- Hi,
Thanks for the mail,
When i use the below command i get error,
Me.ReportViewer1.ProcessingMode = ProcessingMode.LocalReportViewer1.LocalReport.ReportPath = "C:\Documents and Settings\Admin\My Documents\Visual Studio 2005\Projects\Myapp\Myapp\Report1.rdlc"
So iam coding as mentioned below
Me.ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.LocalReport.ReportPath = "C:\Documents and Settings\Admin\My Documents\Visual Studio 2005\Projects\Myapp\Myapp\Report1.rdlc"
Also when i use
Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource(MeTable))
iam getting error
Value of type 'System.Data.DataRow' cannot be converted to 'String'.
Do i miss anything ?
Please help,
Thanks, - have look now, few changes, I did...
Don't judge me, just Upgrade me. Thanks! - Thanks for the reply,
I actually didn understand the solution ,
Do i have to change the report path to C:?
Please clarify,
Thanks, Thanks for the reply,
I actually didn understand the solution ,
Do i have to change the report path to C:?
Please clarify,
Thanks,
yes, make sure the patch is right? do you when you run the application, what happen with your report? what msg shows in it?
Don't judge me, just Upgrade me. Thanks!Thanks for the reply,
I actually didn understand the solution ,
Do i have to change the report path to C:?
Please clarify,
Thanks,
yes, make sure the patch is right? do you when you run the application, what happen with your report? what msg shows in it?
Don't judge me, just Upgrade me. Thanks!
Thanks for the reply,
Please find below the error message
An error Occured during local report processing The report definition for report'C:\Documents and Settings\Report1.rdlc'has not been specified
Please suggest a solution,
Thanks ,- Hi VB_netBeginner09,
Do you want to connect a Dataset created in code with ReportViewer? I think you can look into the following link for some information
http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/94874327-e47e-4218-8e62-1962828f2a60
You can consider posting it at Visual Studio Report Controls forum for quicker and better responses. Thanks!
Regards
Jeff Shan
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Proposed As Answer byMaDFroG20091013 Wednesday, November 11, 2009 1:15 AM
- Marked As Answer byMartin Xie - MSFTMSFT, ModeratorWednesday, November 11, 2009 5:12 AM
- I think you have not created your rdlc, Properly. have a look here just follow it:
http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/94874327-e47e-4218-8e62-1962828f2a60
Don't judge me, just Upgrade me. Thanks! - @Malange
You provided the same link as Jeff did!!! @Malange
You provided the same link as Jeff did!!!
ok. and what is the problem? Thanks to let me know.
Don't judge me, just Upgrade me. Thanks!

