Last post Mar 07, 2012 06:44 AM by karim_mdsaidul
Mar 12, 2008 04:43 PM|rbav73|LINK
I am new to the ReportViewer control and I think I'm trying to do something that cannot be done. The page itself is very simple, just a form with a control:
<form id="form1" runat="server">
</body>I created a Dataset but canceled out of the configuration wizard and just added a DataTable with some columns. In the code behind on my page I have the following:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Set the processing mode for the ReportViewer to Local
rvCapacityPlanning.ProcessingMode = ProcessingMode.Local
Dim rep As LocalReport = rvCapacityPlanning.LocalReport
rep.ReportPath = "rptCapacityPlanning.rdlc"
Dim rds As New ReportDataSource
rds.DataSourceId = "ObjectDataSource1"
Dim EmployeeData As EmployeeData = GetSalesData()
'Create a report data source for the sales order data
Dim dsCapacityPlanning As New ReportDataSource
dsCapacityPlanning.Name = "EmployeeData_Data"
dsCapacityPlanning.Value = EmployeeData.Tables("Data")
Private Function GetSalesData()
Dim ds As New EmployeeData
Dim oConn As New SqlConnection(GetConnectionString)
Dim oCmd As New SqlCommand
Dim iYear As Integer = 2008
Dim sITCostCenter As String = ""
Dim sWebUser As String = "a76211"
.Connection = oConn
.CommandType = CommandType.StoredProcedure
.CommandText = "sp_getProjectHoursByOrgByProjByEmployee"
.Parameters.Add("@rptYear", SqlDbType.Int).Value = iYear
.Parameters.Add("@ITCostCenter", SqlDbType.VarChar).Value = sITCostCenter
.Parameters.Add("@webuser", SqlDbType.VarChar).Value = sWebUser
Dim salesOrderAdapter As New SqlDataAdapter(oCmd)
When I try to run the report I get the following error:'A data source instance has not been supplied for the data source 'DataSet1_DataTable1'.I've been trying to re-do this all day and I just keep running into roadblocks. The name of the DataSet, the one
stored in App_Code, is also called EmployeeData. Hoping someone has some input on this.TIA, N
Mar 15, 2009 11:24 AM|vishal_123|LINK
I am stuck with same problem. Could let me know how you solved your problem,
Mar 07, 2012 06:44 AM|karim_mdsaidul|LINK