Databases Reference
In-Depth Information
pvIncludeRpt.Value = “true”;
extset.ParameterValues[1] = pvIncludeRpt;
localhost_RS.ParameterValue pvRenderFormat = new
localhost_RS.ParameterValue();
pvRenderFormat.Name = “RenderFormat”;
pvRenderFormat.Value = this.cboRenderFormat.Text;
extset.ParameterValues[2] = pvRenderFormat;
localhost_RS.ParameterValue pvPriority = new localhost_RS.ParameterValue();
pvPriority.Name = “Priority”;
pvPriority.Value = “NORMAL”;
extset.ParameterValues[3] = pvPriority;
localhost_RS.ParameterValue pvSubject = new localhost_RS.ParameterValue();
pvSubject.Name = “Subject”;
pvSubject.Value = “@ReportName was executed at @ExtensionTime”;
extset.ParameterValues[4] = pvSubject;
The report you are using doesn't require any parameters, so you have everything necessary to actually
create the subscription. Call this method by passing Nothing in place of a Parameters array.
VB
'-- Create the Subscription (no report parameters in last arg)
rs.CreateSubscription(Me.cboReport.Text, _
extset, _
Me.txtDescription.Text, _
“TimedSubscription”, _
sched.ScheduleID, _
Nothing)
C#
//-- Create the Subscription (no report parameters in last arg)
rs.CreateSubscription(this.cboReport.Text,
extset,
this.txtDescription.Text,
“TimedSubscription”,
scheduleItem.ScheduleID,
null);
Now let's look at the entire routine put together. Here's all of the Add Subscription button-click event
code in both VB and C#:
VB
Private Sub btnAddSubscription_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Handles btnAddSubscription.Click
'-- Get selected schedule
Dim sched As localhost_RS.Schedule
Dim iSchedCounter As Int16
For Each sched In rs.ListSchedules
Search WWH ::




Custom Search