Solved

Visual Basic 2005 Express with Reporting service

Posted on 2010-09-11
1
406 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
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now