title: JavaScript Array with Multiple Strings for Passing Querystring to SSRS Report
body: <p>I have an application where I am trying to make the URL querystring pass to an SSRS report.</p>
  
  <p>If I just list one string, the querystring accepts the string, however, when listing to multiple strings, the querystring does not accept the strings in the JavaScript into the parameters of the report. I am showing my JavaScript code below.</p>
  
  <p>I would like to receive help structuring this JavaScript so that I could list multiple strings and have the string fill the querystring and hence the SSRS Report.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>function launchSsrsReport()
      {
          var AssignedTo = $('#linkAssignedTo').text();
          AssignedTo = AssignedTo.trim();
          var StartDateString = $('#pcDateImported').text();
          StartDateString = StartDateString.trim();
  
          var StartDate = new Date(StartDateString);
  
          var startDateUrl = StartDate.getMonth()+1  + "/" + StartDate.getDate() + "/" + StartDate.getFullYear();
          var EndDate = new Date();
          var endDateUrl = EndDate.getMonth()+1 + "/" + EndDate.getDate() + "/" + EndDate.getFullYear();
  
          //need to pass in a Status from the application
          var Status = "Pending"; //for testing only
          //var Status = ["Pending, In Process"];
          
          var qs = getJsonFromUrl();
          var url = "https://urlofwebserver/ReportServer_SQL?/ParentFolder/Subfolder/ReportFolder/Report&amp;StartDate=" + startDateUrl + "&amp;EndDate=" + endDateUrl + "&amp;AssignedTo=" + AssignedTo + "&amp;Status=" + Status + "&amp;SubmissionIds=" + qs["id"];
          window.location.href = url;
      }
  
      function getJsonFromUrl() {
          var query = location.search.substr(1);
          var result = {};
          query.split("&amp;").forEach(function (part) {
              var item = part.split("=");
              result[item[0]] = decodeURIComponent(item[1]);
          });
          return result;
      }</code></pre>
  </div>
  </div>
  </p>