Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3670226
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:20:19+00:00 2026-05-19T02:20:19+00:00

I have a report already setup on the ReportServer. And its subscription as well.

  • 0

I have a report already setup on the ReportServer. And its subscription as well. What I’m trying to do is add the ParameterValue “CC” and some email addresses then send the email out. It doesn’t seem to work.

My code:

Dim emailReader As SqlDataReader = selCount.ExecuteReader
Dim emailsTest As List(Of String) = New List(Of String)
emailsTest.Add("test1@pen.com")
emailsTest.Add("test2@pen.com")
emailsTest.Add("test3@pen.com")
emailsTest.Add("test4@pen.com")
If emailReader.HasRows() Then 'checks to see if there any quotes in query

    For Each subscrp As rs.Subscription In subscr
        Dim allValues = subscrp.DeliverySettings.ParameterValues
        Dim allValuesList As List(Of ReportTriggerTemplate1.rs.ParameterValueOrFieldReference) = allValues.ToList()
        Dim CCParameter As ReportTriggerTemplate1.rs.ParameterValue = New ReportTriggerTemplate1.rs.ParameterValue()
        CCParameter.Name = "CC"
        CCParameter.Value = String.Empty
        allValuesList.Add(CCParameter)
        Dim toValue = CType(allValuesList.Item(7), ReportTriggerTemplate1.rs.ParameterValue)

        For Each testEmail As String In emailsTest
            Dim ownerEmail As String = testEmail
            If toValue.Value.Contains(ownerEmail) Then
                'skip
            ElseIf toValue.Value = String.Empty Then
                toValue.Value += ownerEmail
            Else
                toValue.Value += "; " & ownerEmail
            End If
        Next
        subscrp.DeliverySettings.ParameterValues = allValuesList.ToArray()
        Dim hello As String = "hi"
        tr.FireEvent(EventType, subscrp.SubscriptionID) 'forces subscription to be sent
    Next

What I’m adding to toValue.Value doesn’t seem to be adding to the report’s CC subscription field at all. So what am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:20:20+00:00Added an answer on May 19, 2026 at 2:20 am

    http://msdn.microsoft.com/en-us/library/ms154020%28v=SQL.100%29.aspx

    http://msdn.microsoft.com/en-us/library/reportservice2005.reportingservice2005.getsubscriptionproperties.aspx

    http://msdn.microsoft.com/en-us/library/reportservice2005.reportingservice2005.setsubscriptionproperties%28v=SQL.105%29.aspx

     Try
            tr = New rs.ReportingService2005
            Dim extSettings As ExtensionSettings = Nothing
            Dim desc As String = Nothing
            Dim active As ActiveState = Nothing
            Dim status As String = Nothing
            Dim matchData As String = Nothing
            Dim values As ParameterValue() = Nothing
            Dim extensionParams As ParameterValueOrFieldReference() = Nothing
    
            Dim mainLogin As System.Net.NetworkCredential = New System.Net.NetworkCredential("ADUser", "Password", "NetworkName")
            If mainLogin Is Nothing Then
                tr.Credentials = System.Net.CredentialCache.DefaultCredentials
            Else
                tr.Credentials = mainLogin
            End If
    

    ‘skip to relevant code

            For Each subscrp As rs.Subscription In subscr
    
                    Dim allValues = subscrp.DeliverySettings.ParameterValues
                    Dim allValuesList As List(Of ReportTriggerTemplate1.rs.ParameterValueOrFieldReference) = allValues.ToList()
    
                    If CType(allValuesList.Item(0), ReportTriggerTemplate1.rs.ParameterValue).Value = "test@pen.com" Then
                        Dim subsID = subscrp.SubscriptionID
                        'important code just below
                        tr.GetSubscriptionProperties(subsID, extSettings, desc, active, status, EventType, matchData, extensionParams)
    
                        ''''add change to CC here
                        Dim extSettingsList As List(Of ReportTriggerTemplate1.rs.ParameterValueOrFieldReference) = extSettings.ParameterValues.ToList()
                        If CType(extSettingsList.Item(1), ReportTriggerTemplate1.rs.ParameterValue).Name = "CC" Then
                            If CType(extSettingsList.Item(1), ReportTriggerTemplate1.rs.ParameterValue).Value = String.Empty Then
                                CType(extSettingsList.Item(1), ReportTriggerTemplate1.rs.ParameterValue).Value = emailsTest.Item(0) & ";" & emailsTest.Item(1)
                            Else
                                CType(extSettingsList.Item(1), ReportTriggerTemplate1.rs.ParameterValue).Value += ";" & emailsTest.Item(0) & ";" & emailsTest.Item(1)
                            End If
                        Else
                            Dim CCParameter As ReportTriggerTemplate1.rs.ParameterValue = New ReportTriggerTemplate1.rs.ParameterValue()
                            CCParameter.Name = "CC"
                            CCParameter.Value = emailsTest.Item(0) & ";" & emailsTest.Item(1)
                            extSettingsList.Insert(1, CCParameter)
                            extSettings.ParameterValues = extSettingsList.ToArray
                        End If
                        'important code just below
                        tr.SetSubscriptionProperties(subsID, extSettings, desc, EventType, matchData, extensionParams)
    
                        tr.FireEvent(EventType, subscrp.SubscriptionID) 'forces subscription to be sent
    
                    Else
    
    
                    End If
    
             Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already created a report using list of data from my database. i
I have a report in SSRS 2005 that's based on a query that's similar
I have a report that uses a TChart that I am maintaining. One of
I have a report in SQL Server Reporting Services (SSRS) that I'd like to
I have a report in MS Access where the underlying data in the tables
I have a report that renders data returned from a stored procedure. Using profiler
I have a report that is used by a windows service and a form
I have two report parameters that were set up automatically when I created their
I have crystal report and I need to convert it to text file. Currently
I have a report that I created with Crystal Reports 2008. This report uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.