Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am trying to make a simple report in vb.net

I have done the following
I have a form with a report viewer (I have removed all the code from it - two lines)

I have a report which has a text box "Hello world"
I call the report as follows from my startup form
dim objFrm as new frmViewer
objfrm.ReportViewer.localreport.reportpath= "report1.rdlc"
objfrm.ReportViewer.refreshreport()
objfrm.showdialog


The report works fine.

I then add a table (tablix) to the report and bind it to an existing datasource. I have checked that this data source works (and I have deleted and readded it a couple of times)
I have added one field to the table [Client] - this appears in the drop down selection box

Now when I run the report I get the following error:
A data source instance has not been supplied for the data source "dataset1"

No matter what I do I can not get the report to now run.

Any help would be much appreciated

Regards
Ants
Posted
Updated 5-Jan-11 17:33pm
v2
Comments
strogg 6-Jan-11 12:49pm    
Let me know how exactly are you supplying the datasource to the report. Are you using ReportViewer.LocalReport.DataSources.Add()? Or you're using a binding source generated by the designer - some details would be helpful
Ants Hurdley 6-Jan-11 13:31pm    
Hi
My Goal is to use the code to attach the datasource - by doing exactly what you have written ie .... Datasources.add etc..
http://www.codeproject.com/Questions/143095/rdlc-Report-Error-during-lkocal-processing.aspx?caid=2_143095#cmtAdd2_143095
But at this stage I am just trying to get it to go in the simplest example.

So when I attach the table it prompts me and walks me through creating a dataset etc.. to add to the report. I have also tested that this Dataset does work. and that the connection to my SQL server works.

Thanks

1 solution

If you wish to manually set the data source, check my answer to this post
http://www.codeproject.com/Answers/128840/Using-data-in-DataTables-in-Microsoft-Report-Viewe.aspx#answer1

I've explained it there.
I've also made a small example project which you can download here
http://www.yourfilelink.com/get.php?fid=598973

Just remember to remove the designer generated data-bindings (data table & binding source) after you pick a report in the report viewer control
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900