|
|
MSSQL
Started by jswanson at 08-14-2006 10:37 AM. Topic has 3 replies.
 
 
|
|
Sort Posts:
|
|
|
|
08-14-2006, 10:37 AM
|
jswanson
Joined on 08-14-2006
Posts 4
|
Accessing Reporting Services via web service
|
|
|
|
|
Is there a way to access Reporting Services via the web service? Are there some special account privleges I need?
I can use Visual Studio to deploy reports to my local server but this doesn't seem to work against the wh4l server.
Thanks!
|
|
|
|
|
Report
|
|
|
|
08-26-2006, 12:56 PM
|
jswanson
Joined on 08-14-2006
Posts 4
|
Re: Accessing Reporting Services via web service
|
|
|
|
|
The code bellow demonstrates how to call the WH4L Reporting servers from ASP.NET using the ReportViewer control. If you are having any troubles with this technique send me a message. Good Luck!!
public partial class SecureReportViewer : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) { ReportViewerControl.ServerReport.ReportPath = Request["ReportPath"].ToString(); // name of your report including folder ReportViewerControl.ServerReport.ReportServerUrl = new Uri(ConfigurationSettings.AppSettings["ReportServerUrl"].ToString()); // path to the WH4L reporting server
// this will setup the user credentials to use with RS ReportViewerControl.ServerReport.ReportServerCredentials = new WH4LReportServerCredentials(null); } }
public class WH4LReportServerCredentials : IReportServerCredentials { public WH4LReportServerCredentials(Cookie authCookie) { }
public WindowsIdentity ImpersonationUser { get { return null; // Use default identity. } }
public ICredentials NetworkCredentials { get { return new NetworkCredential("user", "pwd"); // use your wh4l RS account here } }
public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority) { authCookie = null; user = ""; password = ""; authority = null;
return false; // Do NOT use forms credentials to authenticate. } }
|
|
|
|
|
Report
|
|
|
|
03-19-2007, 11:36 AM
|
JPaul
Joined on 03-20-2007
Posts 3
|
Re: Accessing Reporting Services via web service
|
|
|
|
|
|
How would i go about doing this in vb? I get the following error when I try to run my code (see below).
Error: Compiler Error Message: BC30002: Type 'IReportServerCredentials' is not defined.
Code:
Imports Microsoft.VisualBasic
Imports Microsoft.Reporting.WebForms
Imports System.Security.Principal
'Imports com.mysite4now.sql332reporting
Imports com.mysite4now.sqlreport01
Public Class ReportViewer
Inherits System.Web.UI.Page
Implements IReportServerCredentials
Private mUserName As String
Private mPassword As String
Private mDomain As String
Public Sub New(ByVal UserName As String, ByVal Password As String, ByVal Domain As String)
mUserName = UserName
mPassword = Password
mDomain = Domain
End Sub
Public Function GetFormsCredentials(ByRef authCookie As System.Net.Cookie, ByRef userName As String, ByRef password As String, ByRef authority As String) As Boolean Implements Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials
Return Nothing
End Function
Public ReadOnly Property ImpersonationUser() As System.Security.Principal.WindowsIdentity Implements Microsoft.Reporting.WebForms.IReportServerCredentials.ImpersonationUser
Get
Return Nothing
End Get
End Property
Public ReadOnly Property NetworkCredentials() As System.Net.ICredentials Implements Microsoft.Reporting.WebForms.IReportServerCredentials.NetworkCredentials
Get
Return New Net.NetworkCredential(mUserName, mPassword, mDomain)
End Get
End Property
End Class
|
|
|
|
|
Report
|
|
|
|
04-02-2007, 3:17 AM
|
Geoff
Joined on 04-02-2007
Posts 1
|
Re: Accessing Reporting Services via web service
|
|
|
|
|
Put a reference to Microsoft.Reportviewer.Webforms in the application.
|
|
|
|
|
Report
|
|
|
|
|
Webhost4life Fo... » Database Relate... » MSSQL » Accessing Reporting Services via web service
|
|
|
|