June 18, 2018 at 6:05 am
Hello all,
I'm trying to set up proof of concept of using SSRS from Visual Basic. I'm battling to figure out how to connect to the server using SQL Server Authentication. Is I can sell SSRS then I'll use AD authentication. The code I've used so far is:Public Class frmMain
Public v_report_name As String = "TestReport"
Public v_report_server As String = "http://elnah-ict-dt006:80"
Public v_report_path As String = "/reports_SSRS/"
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'create parameter array
Dim paramlist As New List(Of Microsoft.Reporting.WinForms.ReportParameter)
'create a specific parameter required by the report
Dim param1 As New Microsoft.Reporting.WinForms.ReportParameter("ClientID")
'add values to the parameter here we use a variable that holds the parameter value
param1.Values.Add("0279")
'add parameter to array
paramlist.Add(param1)
'Set the processing mode for the ReportViewer to Remote
ReportViewer1.ProcessingMode = ProcessingMode.Remote
'use the serverreport property of the report viewer to select a report from a remote SSRS server
Me.ReportViewer1.ServerReport.ReportServerUrl = New System.Uri(v_report_server)
Me.ReportViewer1.ServerReport.ReportPath = v_report_path & v_report_name
'select where the report should be generated with the report viewer control or on the report server using the SSRS service.
Me.ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote
'add the parameterlist to the viewer
'Me.ReportViewer1.ServerReport.SetParameters(paramlist)
'Set the report parameters for the report
Dim parameters() As ReportParameter = {param1}
Me.ReportViewer1.ServerReport.SetParameters(parameters)
Me.ReportViewer1.ServerReport.ReportServerCredentials.GetType()
'ReportViewer1.ServerReport.ReportServerCredentials
Me.ReportViewer1.RefreshReport()
End Sub
End Class
Any idea how I can do this?
Cheers,
Rob
June 18, 2018 at 8:08 am
Not sure what, exactly, you are trying to do. If you establish a connection, then want to change your connection, then you'll have to re-instantiate your connection, so I'm doubtful that what you appear to want (switch authentication modes mid-session) is either plausible or realistic. Please be more specific as to your objective. One thing you mentioned is "so you can sell SSRS", which is something only Microsoft certified resellers can do, but maybe you're looking at using it as part of an SAAS solution? If that's the case, you should probably be setting up your clients as AD users to begin with and use AD authentication for the connection. That way, you can control who has access to what reports..
Steve (aka sgmunson)
Rent Servers for Income (picks and shovels strategy)
June 18, 2018 at 8:32 am
Hi Steve,
Sorry for the lack of clarity. I was about to have a meeting with a colleague and posted in a rush.
With regard to my use of the word "Sell", what I mean is to try and get buy-in from the dev team. We have a VB based system and I'm trying to convince everybody that SSRS can be used in our environment.
As far as the code goes, I've been trying to hack this together from stuff I've found on the internet. What I'm trying to achieve is to use SSRS to generate and print reports and other documents from a WinForms app instead of coding them by hand in VB. I've set up a ReportViewer control on the form and am trying to populate this from an SSRS report that I created.
Hope that makes more sense.
Cheers,
Rob
June 18, 2018 at 10:32 am
robh-938954 - Monday, June 18, 2018 8:32 AMHi Steve,Sorry for the lack of clarity. I was about to have a meeting with a colleague and posted in a rush.
With regard to my use of the word "Sell", what I mean is to try and get buy-in from the dev team. We have a VB based system and I'm trying to convince everybody that SSRS can be used in our environment.
As far as the code goes, I've been trying to hack this together from stuff I've found on the internet. What I'm trying to achieve is to use SSRS to generate and print reports and other documents from a WinForms app instead of coding them by hand in VB. I've set up a ReportViewer control on the form and am trying to populate this from an SSRS report that I created.
Hope that makes more sense.
Cheers,
Rob
Is it really essential that the reports be accessible within the application as opposed to simply being navigated to from a link provided in said application? That would save you a ton of coding....
Steve (aka sgmunson)
Rent Servers for Income (picks and shovels strategy)
June 18, 2018 at 10:49 am
Our users interact with the system through a Remote Desktop session. From there, they would need to run reports and print invoices and other documents so yes, needs to be built into the application. For now, I’m just trying to get my test report to show in the ReportViewer control. I’ve set up a dev environment on my local machine so would prefer to use SQL Authenication until I get the go ahead to set up reporting services on the live server.
June 18, 2018 at 11:07 am
June 18, 2018 at 11:50 am
Thanks Steve, I’ll have a look in the morning.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy