RS.exe subscribe report with parameters

Let me teach you a trick to program in .Net and in general. It sounds simple, all you need to do is pass functions what they expect. Let me give you a simple example.

With this code I've got a similar error to you:

enter image description here

CS7036 There is no argument given that corresponds to the required formal parameter 'fileName' of 'FileInfo.FileInfo(string)'

The squiggle red line tells you where the problem is. If I type the opening bracket it will give me a tooltip with what it expects:

enter image description here

Ok it needs a string, so I declare a string and give it to the function as it expects:

enter image description here

So the problem you have is because you are not giving the CreateSubscription function the parameters it expects.

Argument not specified for parameter 'Parameters' of 'Public Function CreateSubscription

To fix it provide all the mandatory parameters to the ReportingService2005.CreateSubscription Method:

public static void Main()
   {
      ReportingService2005 rs = new ReportingService2005();
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

      string report = "/SampleReports/Employee Sales Summary";
      string desc = "Send email to [email protected]";
      string eventType = "TimedSubscription";
      string scheduleXml = @"<ScheduleDefinition><StartDateTime>2003-02-24T09:00:00-08:00</StartDateTime><WeeklyRecurrence><WeeksInterval>1</WeeksInterval><DaysOfWeek><Monday>True</Monday></DaysOfWeek></WeeklyRecurrence></ScheduleDefinition>";

      ParameterValue[] extensionParams = new ParameterValue[8];

      extensionParams[0] = new ParameterValue();
      extensionParams[0].Name = "TO";
      extensionParams[0].Value = "[email protected]";

      extensionParams[1] = new ParameterValue();
      extensionParams[1].Name = "ReplyTo";
      extensionParams[1].Value = "[email protected]";

      ParameterValue parameter = new ParameterValue();
      parameter.Name = "EmpID";
      parameter.Value = "38";

      ParameterValue[] parameters = new ParameterValue[1];
      parameters[0] = parameter;

      string matchData = scheduleXml;
      ExtensionSettings extSettings = new ExtensionSettings();
      extSettings.ParameterValues = extensionParams;
      extSettings.Extension = "Report Server Email";

      try
      {
         rs.CreateSubscription(report, extSettings, desc, eventType, matchData, parameters);
      }

      catch (SoapException e)
      {
         Console.WriteLine(e.Detail.InnerXml.ToString());
      }
   }