Sunday, February 19, 2012

CreateSubscription

I am trying to use the article at
http://msdn2.microsoft.com/en-US/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.createsubscription.aspx
to create a subscription.
When I try to run the page I receive the following error message:
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30311: Value of type 'ExtensionSettings' cannot be
converted to 'com.mysite4now.sql332reporting.ExtensionSettings'.
Source Error:
Line 61:
Line 62: Try
Line 63: rs.CreateSubscription(report, extSettings, desc,
eventType, matchData, Nothing)
Line 64:
Line 65: Catch e As SoapException
HERE IS MY CODE
Imports System
Imports System.Web.Services.Protocols
Imports com.mysite4now.sql332reporting
Partial Class CreateSub
Inherits System.Web.UI.Page
Public Shared Sub Main()
Dim rs As New ReportingService2005()
rs.Credentials = New System.Net.NetworkCredential("TonyStoker",
"01271972")
Dim report As String = "/PAData/Student Information/Student Listing
Report"
Dim desc As String = "Send email to anyone@.microsoft.com"
Dim eventType As String = "TimedSubscription"
Dim scheduleXml As String = "<ScheduleDefinition><StartDateTime>2006-02-24T09:00:00-08:00</StartDateTime><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Monday>True</Monday></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
Dim extensionParams() As ParameterValue
extensionParams(0) = New ParameterValue
extensionParams(0).Name = "TO"
extensionParams(0).Value = "tonystoker@.comcast.net"
extensionParams(1) = New ParameterValue
extensionParams(1).Name = "ReplyTo"
extensionParams(1).Value = "reporting@.adventure-works.com"
extensionParams(2) = New ParameterValue
extensionParams(2).Name = "IncludeReport"
extensionParams(2).Value = "True"
extensionParams(3) = New ParameterValue
extensionParams(3).Name = "RenderFormat"
extensionParams(3).Value = "MHTML"
extensionParams(4) = New ParameterValue
extensionParams(4).Name = "Subject"
extensionParams(4).Value = "@.ReportName was executed at
@.ExecutionTime"
extensionParams(5) = New ParameterValue
extensionParams(5).Name = "Comment"
extensionParams(5).Value = "Here is your daily sales report for
Michael."
extensionParams(6) = New ParameterValue
extensionParams(6).Name = "IncludeLink"
extensionParams(6).Value = "True"
extensionParams(7) = New ParameterValue
extensionParams(7).Name = "Priority"
extensionParams(7).Value = "NORMAL"
Dim matchData As String = scheduleXml
Dim extSettings As New ExtensionSettings()
extSettings.ParameterValues = extensionParams
extSettings.Extension = "Report Server Email"
Try
rs.CreateSubscription(report, extSettings, desc, eventType,
matchData, Nothing)
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml.ToString())
End Try
End Sub 'Main
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Main()
End Sub
End ClassI did make a change but still not working:
New Code is:
Public Shared Sub Main()
Dim rs As New ReportingService2005()
rs.Credentials = New System.Net.NetworkCredential("TonyStoker",
"01271972")
Dim report As String = "/TestTrack/Group Status Report"
Dim desc As String = "Send email to anyone@.microsoft.com"
Dim eventType As String = "TimedSubscription"
Dim scheduleXml As String ="<ScheduleDefinition><StartDateTime>2006-02-24T09:00:00-08:00</StartDateTime><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Monday>True</Monday></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
Dim extensionParams(8) As ParameterValue
extensionParams(0) = New ParameterValue
extensionParams(0).Name = "TO"
extensionParams(0).Value = "tonystoker@.comcast.net"
extensionParams(1) = New ParameterValue
extensionParams(1).Name = "ReplyTo"
extensionParams(1).Value = "reporting@.adventure-works.com"
extensionParams(2) = New ParameterValue
extensionParams(2).Name = "IncludeReport"
extensionParams(2).Value = "True"
extensionParams(3) = New ParameterValue
extensionParams(3).Name = "RenderFormat"
extensionParams(3).Value = "PDF"
extensionParams(4) = New ParameterValue
extensionParams(4).Name = "Subject"
extensionParams(4).Value = "@.ReportName was executed at
@.ExecutionTime"
extensionParams(5) = New ParameterValue
extensionParams(5).Name = "Comment"
extensionParams(5).Value = "Here is your daily sales report for
Michael."
extensionParams(6) = New ParameterValue
extensionParams(6).Name = "IncludeLink"
extensionParams(6).Value = "True"
extensionParams(7) = New ParameterValue
extensionParams(7).Name = "Priority"
extensionParams(7).Value = "NORMAL"
Dim matchData As String = scheduleXml
Dim extSettings As New ExtensionSettings()
extSettings.ParameterValues = extensionParams
extSettings.Extension = "Report Server Email"
Try
rs.CreateSubscription(report, extSettings, desc, eventType,
matchData, Nothing)
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml.ToString())
End Try
End Sub 'Main
"Tony" wrote:
> I am trying to use the article at
> http://msdn2.microsoft.com/en-US/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.createsubscription.aspx
> to create a subscription.
> When I try to run the page I receive the following error message:
> Compilation Error
> Description: An error occurred during the compilation of a resource required
> to service this request. Please review the following specific error details
> and modify your source code appropriately.
>
> Compiler Error Message: BC30311: Value of type 'ExtensionSettings' cannot be
> converted to 'com.mysite4now.sql332reporting.ExtensionSettings'.
> Source Error:
>
> Line 61:
> Line 62: Try
> Line 63: rs.CreateSubscription(report, extSettings, desc,
> eventType, matchData, Nothing)
> Line 64:
> Line 65: Catch e As SoapException
>
> HERE IS MY CODE
> Imports System
> Imports System.Web.Services.Protocols
> Imports com.mysite4now.sql332reporting
>
> Partial Class CreateSub
> Inherits System.Web.UI.Page
> Public Shared Sub Main()
> Dim rs As New ReportingService2005()
> rs.Credentials = New System.Net.NetworkCredential("TonyStoker",
> "01271972")
> Dim report As String = "/PAData/Student Information/Student Listing
> Report"
> Dim desc As String = "Send email to anyone@.microsoft.com"
> Dim eventType As String = "TimedSubscription"
> Dim scheduleXml As String => "<ScheduleDefinition><StartDateTime>2006-02-24T09:00:00-08:00</StartDateTime><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Monday>True</Monday></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>"
> Dim extensionParams() As ParameterValue
> extensionParams(0) = New ParameterValue
> extensionParams(0).Name = "TO"
> extensionParams(0).Value = "tonystoker@.comcast.net"
> extensionParams(1) = New ParameterValue
> extensionParams(1).Name = "ReplyTo"
> extensionParams(1).Value = "reporting@.adventure-works.com"
> extensionParams(2) = New ParameterValue
> extensionParams(2).Name = "IncludeReport"
> extensionParams(2).Value = "True"
> extensionParams(3) = New ParameterValue
> extensionParams(3).Name = "RenderFormat"
> extensionParams(3).Value = "MHTML"
> extensionParams(4) = New ParameterValue
> extensionParams(4).Name = "Subject"
> extensionParams(4).Value = "@.ReportName was executed at
> @.ExecutionTime"
> extensionParams(5) = New ParameterValue
> extensionParams(5).Name = "Comment"
> extensionParams(5).Value = "Here is your daily sales report for
> Michael."
> extensionParams(6) = New ParameterValue
> extensionParams(6).Name = "IncludeLink"
> extensionParams(6).Value = "True"
> extensionParams(7) = New ParameterValue
> extensionParams(7).Name = "Priority"
> extensionParams(7).Value = "NORMAL"
>
> Dim matchData As String = scheduleXml
> Dim extSettings As New ExtensionSettings()
> extSettings.ParameterValues = extensionParams
> extSettings.Extension = "Report Server Email"
> Try
> rs.CreateSubscription(report, extSettings, desc, eventType,
> matchData, Nothing)
> Catch e As SoapException
> Console.WriteLine(e.Detail.InnerXml.ToString())
> End Try
> End Sub 'Main
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
> Main()
> End Sub
> End Class
>

No comments:

Post a Comment