Hello i'm cuban and i'm doing an aplication in Visual Studio 2005. I have a problem with this code because i have an error. I want dinamically load differents reports in one page usin the reportviewer control. This is my code. please help me and tell me what's wrong here. This code i'ts for a test
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.ReportViewer1.ProcessingMode = ProcessingMode.Local
Me.ReportViewer1.LocalReport.ReportPath = "C:\Inetpub\wwwroot\pepe1\report1.rdlc"
Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("clientes", cargar()))
Me.ReportViewer1.LocalReport.Refresh()
End Sub
Function cargar() As Data.DataSet
Dim con As New SqlConnection("Data Source=(local);Initial Catalog=contenedores;Persist Security Info=True;User ID=sa")
Dim tabla As New Data.DataSet
Dim adapter As New SqlDataAdapter("select * from clientes", con)
adapter.Fill(tabla)
Return tabla End Function
when i load my page this i'ts the error on the page:
- A data source instance has not been supplied for the data source 'DataSet1_Clientes'.
If i put an Objectdatasource in my webform, this dont happen and it works good, but i want to use many reportrts (*.rdlc) files with the same webform and including parameters too. Please if you have some examples please send my this (even in C# dont matter). thanks for everething.
I'm sorry for my bad english jajajajaja. bye
please answer me to this email pepe_ballaga@yahoo.com