Monday, April 25, 2011

Accessing SSRS throught Web Services

Hi,

This is a simple article explaining how to run reports off SQL server through WebServices.
Please take a look at the example and Ask questions if necessary. It is truly a simple process.

Imports System.IO Imports WEBWMS.ReportExecutionService   Public Class ReportingServices     Dim rsExec As New WEBWMS.ReportExecutionService.ReportExecutionService       Public Sub GenReport(ByVal FolderName As String, ByVal ReportName As String, ByVal ReportParameters As ParameterValue())         ' setup report connection         Dim deviceInfo As String = Nothing         Dim extension As String = [String].Empty         Dim mimeType As String = [String].Empty         Dim encoding As String = [String].Empty         Dim warnings As Warning() = Nothing         Dim streamIDs As String() = Nothing         Dim historyId As String = Nothing         Dim ExecHeader As New ExecutionHeader         Dim TrustUserHeader As New TrustedUserHeader         Dim Results As [Byte]() = Nothing         Dim ExecInfo As ExecutionInfo = New ExecutionInfo         Dim ServInfo As ServerInfoHeader = New ServerInfoHeader           My.User.InitializeWithWindowsUser()         rsExec.ExecutionHeaderValue = ExecHeader         rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials         rsExec.Url = "http://Wedge/reportserver/reportexecution2005.asmx"         ' pass parameters         rsExec.LoadReport("/" & FolderName & "/" & ReportName, historyId)         If ReportParameters.Count = 0 Then         Else             rsExec.SetExecutionParameters(ReportParameters, "en-us")         End If         ' get pdf of report          Results = rsExec.Render("PDF", deviceInfo, extension, mimeType, encoding, warnings, streamIDs)         PrintReport(Results)     End Sub       Private Sub PrintReport(ByVal Data As Byte())         Dim Path As String = "C:\Temp\Reference" & Date.Now.Millisecond.ToString & ".PDF"         Dim LabelFile As FileStream = New FileStream(Path, FileMode.Create)         LabelFile.Write(Data, 0, Data.Length)         LabelFile.Close()         RawPrinterHelper.SendFileToPrinter(My.Settings.UserLaserPrinter, Path)     End Sub End Class 

Friday, February 11, 2011

Load Operation Get User failed silvelright ria services


This post is only for users using windows authentication for silverlight and having issues.

ok first. make sure your webconfig file is similar to the one below.


Make sure on IIS that the only authentication scheme you have selected is
Windows authentication for you application and the site it is contained withing. This is because WCF and RIA doesn't support multiple authentication schemes within the same site.

Next for your application in IIS

Make sure that the default document is setup to point to the aspx page that your application created when published. Once that is setup browse to your site like this. http://Sitename/Application name if you don't browse to the site like that you might receive the same error. I had hell getting this setup and I hope this makes it easier for other users that have came across this same issue.

Please feel free to leave comments or add to this Post other steps that can deviate from the frustration in deploying your new silverlight app.