Need to make data driven ssrs subscription?

spent hours on thickets this week
Mike Monday 2.00
Tuesday 2.00
Mark
Monday 3.00
Tuesday 4.00
Lucy
Monday 6.00
Tuesday 7.00
Hello how can I make a data driven subscription which go mike's info to mike only mark info to mark only like that is there any sample code vailable for situation like this sssrs data driven subscription?

Hi MarkSubedi,
Based on your description, you can create an Data-Driven subscription and send email based on the different user you have selectted in the Parameter "UserName" in the report.Before create the data_driven subscription,
please make sure your SSRS edition will support it (Enterprise, Businness Intelligence), More Details:Features Supported by the Editions of SQL Server
Data-Driven subscription indeed can do this. A data-driven subscription can provides a way to use dynamic subscription data that is retrieved from an external data source at run time. It can deliver the report to different destinations,
each of which might receive a different render format of the report and a different set of parameter values on a recurring basis. You must also have a relational table that stores the mapping between destinations(e-mail address or a file share),report settings
and parameter values.
I have tested on my local environment and we can create an subcription delivery table to include an column for the User name and another column for the User related e-mail addresses.When you creating the Data-Driven subscription,you can configure
the subscription by provide the query to this table and assign the values in the query results to special settings in the subscription. Please find the Subcription delivery table you need to create and the steps of Data-Driven subscrition configuration of
using this table.
Subcription delivery table(when you want to modify UserName and e-mail address you can just modify this table but don’t need to do modification in the Data-Driven subscription):
CREATE TABLE TableName
(UserName nvarchar(50),
Mailto nvarchar(50))
INSERT INTO TableName
('Mike','[email protected]'),
('Mark','[email protected]'),
('Lucy','[email protected]'),
Details steps of Data-Driven subscrition configuration of using this table:
Specify a data source that contains the subscription delivery table which created like above.
Specify a command or query that return the list of the user name and the e-mail addresses and then click "Validate" button  to make sure query validate successfully, click next.query that return the list of the user name and the e-main addresses
 select * from TableName
Specify delivery extension settings for Report Server Email :in the dropdown list select the "Mailto" from TableName, click next.
Specify report parameter values for Report, Check as below and the e-mail will send based on each UserName, click next.
Specify when the subscription is processed  by setting the schedule details, click Finish.
Below article for your reference about details steps of
Create Data-driven Subscription:Create Data-driven Subscription Page (Report Manager)
If you still have any question, please feel free to ask.
Regards
Vicky Liu
Vicky Liu
TechNet Community Support

Similar Messages

  • Data Driven EMail Subscription in SQL Server Reporting Services...

    Hi,
       I have a clarification in SQL Server Reporting Services Data Driven Subscription. We have a request to send an email a report based on the report parameter Site . The request is to send email For each site the report is running, email should sent to different recipients list. We have 97 different sites in the Site parameter.
       If Report is running for Site C004 the email should be sent to one recipient, if the Report is running for Site C007 , then the email should be sent to another recipient. Here we have been requested to do with Data-Driven Subscription. How to send the report as a email for each site for different Recipients using Data Driven EMail Subscription.
    Please give us a suggestion to overcome this problem.
    Thanking You...

    Hi David,
    Thanks for your comments. We understand the Data Driven subscription, but we dont know how to write query for this subscription. here is our scenario.
    There are list of sites in the table. like C004, C007, C008 etc..... in the report,
    We have Site parameter (All Sites (default), C004, C007 etc....) and also date range parameter (Start Date, End date) (which are not defaulted in the report) and other 2 parameters. Here we need to send the report to different recipients based on the site. C004 report results should be develivered to one recipient, C007 site results should be delivered to another recipient and so on....
    As we are new to Data driven subscription, can you explain how to create table that will be saving the email recipients list and the query that we are specifying in the Data Driven Subscription. Please help us to how to create the data driven subscription for the above scenarion. 
    Thanks and Regards,
    Sundarrajan.G

  • Need to make date validation to remove overlab

    I have a problem in date validation
    I will tell you the scenario
    I have department table as a master table and under this department there is some teachers.
    Eeach teacher have Start Hiring Date and End Hiring Date .
    I want to prevent to insert a new teacher with Start Hiring date or End hiring date between any period inserted before in this department .
    This means in any period there is only one hired teacher
    how can I do this validation

    Assumed that you are using ADF BC, I reproduced your use case, and tried this. you can also try it,
        CREATE TABLE test_department
        (      id      numeric(10)      not null,
             name      varchar2(50) not null,
             CONSTRAINT dpt_pk PRIMARY KEY (id)
        CREATE TABLE teachers
        (      id      numeric(10) PRIMARY KEY     ,
             dept_id      numeric(10)      not null,
              start_date date,
              end_date date,
             CONSTRAINT fk_emp  FOREIGN KEY (dept_id)
               REFERENCES test_department(id)
    insert into test_department values (1,'Math');
    insert into teachers values(1,1,to_date('1/1/2010','DD/MM/YYYY'),to_date('31/12/2010','DD/MM/YYYY'));add a validate entity method to you TeacherImpl class.
        public boolean validateTeachers()
            TestDepartmentImpl deptImpl = this.getTestDepartment(); // TestDepartment is the accessor name exposed in TeachersImpl class
            RowIterator iter = deptImpl.getTeachers(); //Teachers is the accessor name exposed in DepartmentImpl class
            boolean flag = true;
            while (iter.hasNext())
                    TeachersImpl currentTeacher = (TeachersImpl)iter.next();
                    if (!currentTeacher.getId().equals(this.getId())) //skip the current teacher from comparison
                        if (this.getStartDate().compareTo(currentTeacher.getStartDate()) >
                            0 && this.getEndDate().compareTo(currentTeacher.getEndDate())<0)
                              flag=false;
            return flag;
        }

  • Add Data driven subscription option missing in sharepoint 2013

    i have a sharepoint 2013 enterprise version with sql server 2012 standard version. And i want to add Data- driven subscriptions for a document library by selecting manage subscriptions. But in the manage subscriptions Add Data- Driven subscription option
    is missing. How can i get the options. is ther any workaround if  i am using standard version.

    Hi sppanda,
    According to your description, you want to use data driven report subscription feature with SQL Server 2012 Standard.
    In Reporting Services 2012, only SQL Server 2012 Enterprise and Business Intelligence edition support the data driven feature. So it’s expected that the Add Data- Driven subscription option is missing in your environment. In your scenario, if you want to
    use data driven subscription feature, please perform edition upgrade.
    Reference:
    Reporting Services Features
    Upgrade to a Different Edition of SQL Server 2012 (Setup)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • How to make "Data Entry Profile" field input unable or display only in CAT2

    hi ,
    I have requiremnet where I need to make "Data Entry Profile" field in the CAT2 transaction as Display only .That is for each user it should come as default one .
    The reason behind this is , user should not change this Profile and maintain an incorrect timesheet entries.
    Is there any User exit where i can do this ? 
    Let me know as this is very urgent requirement.
    Points will be definately rewarded.
    Thanks .

    Hemant,
    Got SHD0 transaction and create screen variant for that transaction there you can disable that field.
    Create Transaction variant for that transaction and assign previously created screen variant to this transaction varient. actiavte.
    Reward if it helps,
    Satish

  • How to make data base link from oracle 11g r2 to microsoft sql 2008 express

    I need to make data base link from oracle 11g r2 to microsoft sql 2008 express to make replication between then
    please help me !
    I didn't know what is the user and password in the command which create database link

    To replicate data you can ude Database Gateway for ODBC or Database Gatewy for MS SQl Server. Please use the search engine of this forum if you ant to get more details about each product.
    Some SQl Servers are set up to use Windows authentication only. In this case you won't be able to connect to the SQL Server as Windows authentication isn't supported with the gateways. You have to make sure your SQL server is supporting username and password authentication - a common user is the "sa" user. Regarding the username/password, please get in touch with your SQL Server Admin.

  • How would I implement something similar to SSRS data driven subscriptions in CRM 2015 Online?

    Requirement: Generate Report and send specific pricing information to a list of contacts based on field value.
    I'm new to CRM, but am well versed in SSRS and I'm looking to understand:
    1. Is it possible to create something like a data driven subscription in CRM?
    Everything I've looked at is from years ago, and I'm just looking for some high level directions I can pursue in order to fulfill this requirement.
    Thanks!

    Did you notice the difference between your image and theirs. Their image has a coordinate grid. This coordinate grid can be used to determine size, location of pixels, etc...
    If you add a grid, when you process the image, find the grid, then find the coordinate markings, then find the pixels in relation to these coordinate marking creating an internal buffer of the image.
    ie: have 0=white 1=black 2=grid 3=coordinate marking and make an internall representation of your image
    011002300000
    001002201000
    011102300010
    323232232323
    222222222222
    001002310000
    000102200100
    010002301000
    Just an idea, but look into the coordinate grid it may be the key to why they can process their image.
    DeltaCoder

  • How to pass the multiplevalue parameter into SSRS by data driven subscription

    Hi All,
    I create a table and show it in the SSRS by table
    EmID Name
    AA1, A
    BB1, C
    CC1, E
    And set one parameter EmID for the user to filter the record and that Parameter Accept multiple values and the type is text.
    And I create a another table for the data-driven subscription to send the report to user by email.
    EmailTitle EmID  EmailComment
    TestEmail  AA1,BB1,CC1    TestComment
    And I set the subscription and set the EmID parameter is from EmID column, then test the subscription, it failed...
    However, when I only put AA1 into the table, then the subscription works well
    EmailTitle EmID  EmailComment
    TestEmail  AA1    TestComment
    So How I can config the above table to support subscription?
    Thanks.

    Hi Bimaster,
    When specify a column for the parameter value in a data-driven subscription, it will be regarded as a single value. So when specify the value "AA1,BB1,CC1" as the parameter value, the subscription will fail.
    The work around for this issue clear the "Allow multiple values" for the report parameter, and then change the filter
    From
    Expression:[ParameterName]
    Operator   :In
    Value         :[@ParameterName]
    To
    Expression:[ParameterName]
    Operator   :In
    Value         :Split(Parameters!ParameterName.Value,",")
    In this case, we can specify a value like "AA1,BB1,CC1" from database to the data-driven subscription. I have tested it on my local host environment, it works fine.
    Regards
    Charlie Liao
    TechNet Community Support

  • SSRS Data Driven Subscription Split Report on Email

    I have a requirement to email an SSRS report to each of the individual emails referenced in the report.
    Think of it is as a mail merge wherein there are 5 persons receiving the report.The Current SSRS Report contains 5 Letters. The Email Subscription dataset is identical to the one upon which the report is based and works as expected. The problem is that currently
    it is sending the ENTIRE report to each email rather than sending only the report that corresponds to the applicable email ( I have heard this referred to as bursting the report).
    Is there some setting that I may be missing? How can this be achieved?
    Again I have Info
    Report A
    (user1 info, User 1 Email
    User2 info---------------BEING EMAILED TO ---------->        User 2 email
    User3 info User 3 email
    User4 info User 4 email
    User5 ) User 5 email
    And I want
    Report A
    (user1 info--------------BEING EMAILED TO ----------> User 1 Email
    User2 info---------------BEING EMAILED TO ----------> User 2 email
    User3 info --------------BEING EMAILED TO ----------> User 3 email
    User4 info --------------BEING EMAILED TO ----------> User 4 email
    User5 info --------------BEING EMAILED TO ----------> User 5 email

    Hi Garrett_ll,
    After testing the issue in my local environment, we can refer to the steps below to achieve your requirement:
    We should add a parameter named User in the report use User field as Available Values.
    Add a filter as below in the corresponding tablix:
    Expression: [User]
    Operator: =
    Value: [@User]
    Deploy the Report to report server.
    During the data-driven subscription, in the step 4 (Specify delivery extension settings for Report Server Email). Below “To” option, select “Get the value from the database”, then select User field.
    In the step 5, we can configure report parameter “Get the value from the database”, then select User field.
    The following article about Create a Data-Driven Subscription, you can refer to it.
    http://technet.microsoft.com/en-us/library/ms169673.aspx
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • SSRS Data Driven Subscription Done: 9 processed of 9 total; 9 errors.

    Getting this error when running a data driven subscription on SQL Server 2008R2, Server is Windows Server 2008R2. Looked at the following.
    Report takes no parameters and I can view it/export it just fine from the report server website.
    I can run the query used in the data driven query to list emails/etc.
    I verified no errors in the SSRS Execution Log Table (all rsSuccess)
    Log File from SSRS shows what looks to be proper execution
    From the SSRS box I can telnet port 25 to the smtp mail server we are using for sending emails. (below)
    Report has been running daily for ~3 monthes.
    Nothing obvious in the Event Log.
    Anyone have any other thoughts on a place to check?
    library!WindowsService_6!978!06/09/2014-14:22:30:: i INFO: Schedule 84906a6d-12c4-4910-b032-276b736c309a executed at 06/09/2014 14:22:30.
    schedule!WindowsService_6!978!06/09/2014-14:22:30:: Creating Time based subscription notification for subscription: 2b9abd3c-35ef-49b4-8706-3412620e650b
    library!WindowsService_6!978!06/09/2014-14:22:30:: i INFO: Schedule 84906a6d-12c4-4910-b032-276b736c309a execution completed at 06/09/2014 14:22:30.
    library!WindowsService_6!c74!06/09/2014-14:22:31:: i INFO: RenderForNewSession('/Transactions/facl_trans_rpt_inventory_npr')
    library!WindowsService_6!9e0!06/09/2014-14:22:31:: i INFO: RenderForNewSession('/Transactions/facl_trans_rpt_inventory_npr')
    library!WindowsService_6!c0c!06/09/2014-14:22:31:: i INFO: RenderForNewSession('/Transactions/facl_trans_rpt_inventory_npr')
    library!WindowsService_6!518!06/09/2014-14:22:31:: i INFO: RenderForNewSession('/Transactions/facl_trans_rpt_inventory_npr')
    library!WindowsService_6!cec!06/09/2014-14:22:31:: i INFO: RenderForNewSession('/Transactions/facl_trans_rpt_inventory_npr')
    library!WindowsService_6!db8!06/09/2014-14:22:31:: i INFO: RenderForNewSession('/Transactions/facl_trans_rpt_inventory_npr')
    library!WindowsService_6!a34!06/09/2014-14:22:31:: i INFO: RenderForNewSession('/Transactions/facl_trans_rpt_inventory_npr')
    library!WindowsService_6!dbc!06/09/2014-14:22:31:: i INFO: RenderForNewSession('/Transactions/facl_trans_rpt_inventory_npr')
    library!WindowsService_6!a34!06/09/2014-14:22:32:: i INFO: Initializing EnableExecutionLogging to 'True'  as specified in Server system properties.
    library!WindowsService_6!db8!06/09/2014-14:22:32:: i INFO: Initializing EnableExecutionLogging to 'True'  as specified in Server system properties.
    library!WindowsService_6!cec!06/09/2014-14:22:32:: i INFO: Initializing EnableExecutionLogging to 'True'  as specified in Server system properties.
    library!WindowsService_6!c0c!06/09/2014-14:22:32:: i INFO: Initializing EnableExecutionLogging to 'True'  as specified in Server system properties.
    library!WindowsService_6!dbc!06/09/2014-14:22:32:: i INFO: Initializing EnableExecutionLogging to 'True'  as specified in Server system properties.
    library!WindowsService_6!c74!06/09/2014-14:22:32:: i INFO: Initializing EnableExecutionLogging to 'True'  as specified in Server system properties.
    library!WindowsService_6!518!06/09/2014-14:22:32:: i INFO: Initializing EnableExecutionLogging to 'True'  as specified in Server system properties.
    library!WindowsService_6!9e0!06/09/2014-14:22:32:: i INFO: Initializing EnableExecutionLogging to 'True'  as specified in Server system properties.

    Hi,
    You can check the below blogs for troubleshooting subscriptions. Find the Schedule ID of the most recent subscription by querying the ReportServer database and search for the Schedule ID in your Trace Log to find the relative error message.
    Monitoring and Troubleshooting Subscriptions
    http://blogs.msdn.com/b/deanka/archive/2009/01/13/diagnosing-and-troubleshooting-subscriptions.aspx
    Troubleshooting Subscriptions: Part II, Using the Reporting ...
    http://blogs.msdn.com/b/deanka/archive/2010/02/16/troubleshooting-subscriptions-part-ii-using-the-report-services-trace-log-file.aspx
    Thanks.
    Tracy Cai
    TechNet Community Support

  • SSRS Data Driven Subscription - Analysis Services OLE DB Provider Not Recent Enough

    We are creating  new SSRS Data Driven Subscription. After entering the command query (which has been tested and is valid) we are getting the following error when the wizard validates the query in step 3:
    The dataset cannot be generated. An error occurred while connecting to a data source, or the query is not valid for the data source. (rsCannotPrepareQuery). The current version of Analysis Services OLE DB Provider is not recent enough to perform
    this check.
    The data source involved and the query are all working as we have reports running on this server that use this data source. We've looked into the OLE DB Provider and both the SSAS server and the SSRS server (they are on different servers) appear to have
    the same versions installed. Both the SSRS and SSAS servers are running SQL 2012 SP2.
    Any suggestions would be appreciated as I haven't had much success locating the cause.

    Hi Tymbow,
    Per my understanding that you got the error message in the step3 when creating the DataDriven Subscription, right?
    I have checked the error message and as you have mentioned that other reports which have the same connection string works fine in report server, so the issue can be cause by the query you are using in the step3 is not correct, sometimes although it
    will work in database or in the desginer, it will have some limitation in the commend query.
    Please provide the connection string you are using and also the commend query to help us better understanding of the issue.
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • Pause Issue:-- SSRS Data Driven Subscription

    I have setup SSRS data driven subscription and it run successfully without any error but something that i noticed, i wanted to know why it happened and how can we prevent?
    1. when i check status bar every 10 sec, after generating some reports, its stays at some count numbers and dont move and suddenly it will move and finish the process without any errors, why pause?
    2. if my data driven subscription run successfully for 1900 reports and fail for 100 reports, how can i manually find 100 errored report and run it manually?
    3. In the database, is there any way we can get detailed about processing or error info other than log tables in reportserver db?
    Thank you for help!

    Hi SQL—DBA,
    1. when i check status bar every 10 sec, after generating some reports, its stays at some count numbers and dont move and suddenly it will move and finish the process without any errors, why pause?
    In Reporting Services, status messages within the subscription page are updated when the subscription is scheduled to process. If the trigger never occurs, the status message will not be updated. For more information, please refer to this article:
    Monitor Reporting Services Subscriptions.
    2. if my data driven subscription run successfully for 1900 reports and fail for 100 reports, how can i manually find 100 errored report and run it manually?
    In this scenario, you can run the query to find the failed subscription information from the database which we have setup for Reporting Services. Please refer to this article:
    SSRS Failed Subscription Notifications.
    Then you can execute the code with jobstep command to find the corresponding SQL Agent Jobs for failed subscription, then execute the job to send the email again. Please refer to this article:
    Re-running SSRS subscription jobs that have failed.
    3. In the database, is there any way we can get detailed about processing or error info other than log tables in reportserver db?
    In this scenario, you can check the subscription table from the ReportServer database to find the status and error message of subscriptions. If we want to trouble subscriptions, I would like to suggest you use the Reporting Services Trace Log File. For more
    information, please refer to this article: Troubleshooting Subscriptions: Part II, Using the Reporting Services
    Trace Log File.
    If you have any question , please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • SSRS Data Driven Subscription Management Questions

    I have two questions on data driven subscriptions in SSRS 2012 Enterprise Edition
    1) Is there a limit to how many can run at a time?  The reason I am asking is that yesterday we had a very large subscription running and we had several others waiting to run,  We waited for about 8 hours before they actually ran.  There was
    plenty of resource on the Oracle database server and plenty of resource on the reporting server, I am wondering if there is a limit that I can increase to the number of jobs that can run at a given time?
    2) My second question has to do with how to stop a data driven subscription?  We tried everything from rebooting the SSRS server, to stopping the SQL Server Agent Job, to identifying the process on the database server and nothing stopped the job from
    running.  How do I do stop a job?
    Thank you

    Hi Sql Dude,
    1) Is there a limit to how many can run at a time?  The reason I am asking is that yesterday we had a very large subscription running and we had several others waiting to run, 
    We waited for about 8 hours before they actually ran.  There was plenty of resource on the Oracle database server and plenty of resource on the reporting server, I am wondering if there is a limit that I can increase to the number of
    jobs that can run at a given time?
    In Reporting Services, there is a setting in RSReportServer.config file called MaxQueueThreads. It specifies the number of threads used by the Report Server Windows service for concurrent processing of subscriptions and notifications. By default, the value
    is 0. Also you can specify the value for this setting. For more information, please refer to this article:
    MaxQueueThreads.
    2) My second question has to do with how to stop a data driven subscription? 
    We tried everything from rebooting the SSRS server, to stopping the SQL Server Agent Job, to identifying the process on the database server and nothing stopped the job from running. 
    How do I do stop a job?
    In Reporting Services, we can’t pause a subscription directly. But we can interrupt the subscription processing ahead of the processing starting or connecting to the data source successfully. In your scenario, you can disable a shared data source so that
    the data source is unavailable for the report. Or you can pause the schedule to prevent processing. For more information, please refer to this article:
    Pause Report and Subscription Processing.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • SSRS 2005 - Data Driven Subscription

    Hi ,
    On my report manager - 2005, I have one report which has only one parameter (Seller) and this is a single select parameter (NOT multiple selects)
    I want to create a data driven subscription which will send automatic Email to specified users on a weekly basis (every Friday morning)
    The only condition while sending excel formatted email is that, it should select some specific values only for this parameter "Seller"
    Example, it should send email to users only for Seller = A, B, and C and it should NOT send data for all other sellers
    Can you pl explain each step to do this ?
    Regards

    Hi UltraDev,
    If I understand correctly, you want to use data-driven subscription to send corresponding report to specific Seller. Please refer to the following steps:
    Click New Data-driven Subscription icon in the Subscriptions dialog box of the report.
    Select E-Mail option of Specify how to recipients are notified, and select “Specify a shared data source”. Next.
    Select the corresponding datasource. Next.
    Add query in the blank. It is related to the recipient. You can refer to the following code:
    Select ‘[email protected]’ as SellerAddress, ’A’ as Seller
    Union
    Select ‘[email protected]’ as SellerAddress, ’B’ as Seller
    Union
    Select ‘[email protected]’ as SellerAddress, ’C’ as Seller
    In the Step4 page, select “Get the value from the database” below “To”.
    Then, we can select the Seller field as the specify value which is only with A, B, C three values.
    In the Step5 page, we can configure the parameter values.
    After that, we can configure the schedule of the subscription.
    There is an article about how to Creating a Data-Driven Subscription, you can refer to it.
    http://technet.microsoft.com/en-us/library/ms169673(v=sql.90).aspx
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Data driven subscription using c#

    I am getting the following error "System.Web.Services.Protocols.SoapException: The required field Field is missing from the input structure. ---> Microsoft.ReportingServices.Diagnostics.Utilities.MissingElementException: The required field Field
    is missing from the input structure.
       at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.CreateSubscription(String Report, ExtensionSettings ExtensionSettings, Boolean isDataDriven, DataRetrievalPlan DataRetrievalPlan, String Description, String EventType, String MatchData,
    ParameterValueOrFieldReference[] Parameters, String& SubscriptionID)
       at Microsoft.ReportingServices.WebServer.ReportingService2005.CreateDataDrivenSubscription(String Report, ExtensionSettings ExtensionSettings, DataRetrievalPlan DataRetrievalPlan, String Description, String EventType, String MatchData, ParameterValueOrFieldReference[]
    Parameters, String& SubscriptionID)".
    Below is the code i used .
           ReportingService2005 rs = new ReportingService2005();
                rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
                //the name of the report for which the DDS is to be created
                string report = "/testDataDriven/Report1";
                string description = "Programmatic Data Driven Subscription for Windows File Share";
                //set extension as Windows File Share
                ExtensionSettings settings = new ExtensionSettings();
                settings.Extension = "Report Server Email";
                // Set the extension parameter values.
                ParameterValueOrFieldReference[] extensionParams =
                   new ParameterValueOrFieldReference[8];
                ParameterFieldReference to = new ParameterFieldReference(); // Data-driven.
                to.ParameterName = "TO";
                to.FieldAlias = "EmailAddress";
                extensionParams[0] = to;
                ParameterValue replyTo = new ParameterValue();
                replyTo.Name = "ReplyTo";
                replyTo.Value = "[email protected]";
                extensionParams[1] = replyTo;
                ParameterValue includeReport = new ParameterValue();
                includeReport.Name = "IncludeReport";
                includeReport.Value = "False";
                extensionParams[2] = includeReport;
                ParameterValue renderFormat = new ParameterValue();
                renderFormat.Name = "RenderFormat";
                renderFormat.Value = "HTML4.0";
                extensionParams[3] = renderFormat;
                ParameterValue priority = new ParameterValue();
                priority.Name = "Priority";
                priority.Value = "NORMAL";
                extensionParams[4] = priority;
                ParameterValue subject = new ParameterValue();
                subject.Name = "Subject";
                subject.Value = "Your sales report";
                extensionParams[5] = subject;
                ParameterValue comment = new ParameterValue();
                comment.Name = "Comment";
                comment.Value = "Here is the link to your report.";
                extensionParams[6] = comment;
                ParameterValue includeLink = new ParameterValue();
                includeLink.Name = "IncludeLink";
                includeLink.Value = "True";
                extensionParams[7] = includeLink;
                settings.ParameterValues = extensionParams;
                DataSource delivery = new DataSource();
                delivery.Name = "";
                DataSourceDefinition dataSourceDef = new DataSourceDefinition();
                dataSourceDef.ConnectString = "my credentials";
                dataSourceDef.CredentialRetrieval = CredentialRetrievalEnum.Store;
                dataSourceDef.Enabled = true;
                dataSourceDef.EnabledSpecified = true;
                dataSourceDef.Extension = "ORACLE";
                dataSourceDef.WindowsCredentials = false;
                dataSourceDef.ImpersonateUser = false;
                dataSourceDef.UserName = "";
                dataSourceDef.Password = "";
                delivery.Item = dataSourceDef;
                //we will have to declare the list of parameter(s) the report requires
                //in this report there is only one parameter named “Sales Order Number”
                //create fields list which is comprising of only one field in this report
                Field[] fieldlist = new Field[2];
                fieldlist[0] = new Field();
                fieldlist[0].Name = "REF_MONTH";
                fieldlist[0].Alias = "REF_MONTH";
                fieldlist[1] = new Field();
                fieldlist[1].Name = "MTSO_ID";
                fieldlist[1].Alias = "MTSO_ID";
                //create data set
                DataSetDefinition dataSetDefinition = new DataSetDefinition();
                dataSetDefinition.AccentSensitivitySpecified = false;
                dataSetDefinition.CaseSensitivitySpecified = false;
                dataSetDefinition.KanatypeSensitivitySpecified = false;
                dataSetDefinition.WidthSensitivitySpecified = false;
                dataSetDefinition.Fields = fieldlist;
                QueryDefinition queryDefition = new QueryDefinition();
                queryDefition.CommandText = "SELECT  REF_MONTH FROM  REFERRAL_TRN_DETAILS1";
                queryDefition.CommandType = "Text";
                queryDefition.Timeout = 1000;
                queryDefition.TimeoutSpecified = true;
                dataSetDefinition.Query = queryDefition;
                DataSetDefinition results = new DataSetDefinition();
                bool changed;
                string[] paramNames;
                results = rs.PrepareQuery(delivery, dataSetDefinition, out changed, out paramNames);
                DataRetrievalPlan dataRetrieval = new DataRetrievalPlan();
                dataRetrieval.DataSet = results;
                dataRetrieval.Item = dataSourceDef;
                // Set the event type and match data for the delivery.
                string eventType = "TimedSubscription";
                string matchData = @"<ScheduleDefinition>";
                matchData += @"<StartDateTime>2003-04-14T19:15:00-07:00</StartDateTime><WeeklyRecurrence><WeeksInterval>1</WeeksInterval>";
                matchData += @"<DaysOfWeek>";
                matchData += @"<Monday>True</Monday><Tuesday>True</Tuesday><Wednesday>True</Wednesday><Thursday>True</Thursday><Friday>True</Friday>";
                matchData += @"</DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>";
                // Set the report parameter values.
                ParameterValueOrFieldReference[] parameters = new ParameterValueOrFieldReference[2];
                ParameterFieldReference empID = new ParameterFieldReference(); // Data-driven.
                empID.ParameterName = "val";
                empID.FieldAlias = "REF_MONTH";
                parameters[0] = empID;
                ParameterValue reportYear = new ParameterValue();
                reportYear.Name = "val";
                reportYear.Value = "112013";
                parameters[1] = reportYear;
                string subscriptionID = rs.CreateDataDrivenSubscription
                (report, settings, dataRetrieval, description, eventType, matchData, parameters);
    i have one report parameter val, ineed to pass value from the query result.
    santosh

    Hi Santosh,
    Based on your error message, it's has issue in the parameters arguments when you call the createDataDrivenSubscription() function. we suggest you to check your parameters argument to createDataDrivenSubscriptio() function. Mostly it's the issue of the
    Parameters. You are passing a ParameterFieldReference array object called parameters. The web service is very strict with the FieldAlias property. It need the fieldAlias have to EXACTLY MATCH a field in the data set that
    is part of the data retrieval plan, otherwise it will throw the exception above. So please pay attention to the white space or lower/higher cap issue. Also we suggest you use functions like Trim() to make fieldAlias fit the field in dataset.
    Reference:
    The required field Field is
    missing from the input structure.
    Best Regards,
    Simon Hou

Maybe you are looking for