[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1166
  • Last Modified:

Microsoft report builder and Microsoft Visual Studio .Net report viewer control

We are in the process of rewriting some reports that we currently have in a Windows desktop application.  Right now we call a 3rd party application that produces the reports and then we show them in a 3rd party report viewer.  These are all called from a .Net Windows application.  We like to get rid of both of these 3rd party programs as they are outdated.  I've been reading up on the Report Viewer control which is already in my .Net toolbox and Microsoft Report Builder.  Can someone give me the definition of both and do I have to have both.  I've taken just the viewer control and placed it on a form and hooked it to a database.  From there I was able to select which fields I wanted to see and it produced output in that control on the form.  Is that all I need for writing reports or do I need to build the report first in Builder and then display it in the viewer.  If that's the case, can I pass parameters from .Net to builder inside my desktop application and then display on a form in that app that has a viewer control.  I've also read about the SSRS reporting service.  We'd like to be able to produce and view reports from .Net without every having to leave the application and go somewhere else to build and view.  Everything I've done up to this point has been with flat files so this is new thinking to me.

  • 3
  • 2
1 Solution
All you have to do is build the SP to get the info that you need for the report
then pass the parameter name to the report and then have to the report build itself.
Here are some resources that should get you started on viewing reports and passing parameters




Imports Microsoft.Reporting.WinForms

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, _
                           ByVal e As System.EventArgs) _
                           Handles MyBase.Load

        'Set the processing mode for the ReportViewer to Remote
        reportViewer1.ProcessingMode = ProcessingMode.Remote

        Dim serverReport As ServerReport
        serverReport = reportViewer1.ServerReport

        'Get a reference to the default credentials
        Dim credentials As System.Net.ICredentials
        credentials = System.Net.CredentialCache.DefaultCredentials

        'Get a reference to the report server credentials
        Dim rsCredentials As ReportServerCredentials
        rsCredentials = serverReport.ReportServerCredentials

        'Set the credentials for the server report
        rsCredentials.NetworkCredentials = credentials

        'Set the report server URL and report path
        serverReport.ReportServerUrl = _
           New Uri("http://<Server Name>/reportserver")
        serverReport.ReportPath = _
           "/AdventureWorks Sample Reports/Sales Order Detail"

        'Create the sales order number report parameter
        Dim salesOrderNumber As New ReportParameter()
        salesOrderNumber.Name = "SalesOrderNumber"

        'Set the report parameters for the report
        Dim parameters() As ReportParameter = {salesOrderNumber}

        'Refresh the report
    End Sub

End Class

Open in new window

pmac38CDSAuthor Commented:
planocz...could you give me a little more detail on your answer?  SP?  Pass parameter name to report??  Then report builds itself?

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

SP = Stored Procedure
parameter  like    MyFirstPara as a name (build this in the SP)
The report you just create with the new SP.
pmac38CDSAuthor Commented:
So this is all done in viewer and the builder is not needed?
The builder is needed.
Either the report builder or and Visual Studio with BIDS.
You need the build to create the report from the SP and then it has to be deployed to the server so the user can run and view it.

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now