?
Solved

Visual Basic 2005 Express with Reporting service

Posted on 2010-09-11
1
Medium Priority
?
420 Views
Last Modified: 2013-11-27
I have created report in SQL Server 2005  Business Intelligence Studio with parameter.  Now I am using Visual Basic 2005 Express version.

I rename the report.rdl to report.rdlc. and copied into the visual basic 2005 express project folder Then added ReportViewer control on the winform and configure it with report than i try to run report is give me error Report missing a parameter value.

So I added following code in Report Load. Then it started giving me error Datasource not defined. But when I i double click the report file I can see the datasource already defined in XML with query.


So what can be problem and how to solve it.
Dim parameters(0) As ReportParameter
    parameters(0) = New ReportParameter("InvoiceMasterID", 11)
    Me.ReportViewer1.LocalReport.SetParameters(parameters)

Open in new window

0
Comment
Question by:milindsaraswala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
milindsaraswala earned 0 total points
ID: 33653565
I got the solution for the same. I removed the parameter from the original file and put following code in the form load


Dim objDataAdapter As New SqlDataAdapter(SQL, strCN)
    Dim dsResult As New DataSet("Result")

    If Not IsNothing(objDataAdapter) Then
      '  ' Fill data into dataset
      objDataAdapter.Fill(dsResult)

      objDataAdapter.Dispose()
    End If

    Dim dataSource(0) As ReportDataSource
    dataSource(0) = New ReportDataSource("DataSource", dsResult.Tables(0))
    Me.ReportViewer1.LocalReport.DataSources.Add(dataSource(0))


    Me.ReportViewer1.RefreshReport()

Open in new window

0

Featured Post

A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question