'Pass parameter to SSRS report

I trying to generate report from SSRS Server in EXCEL format. I use the following code:

Add-Type -AssemblyName "Microsoft.ReportViewer.WinForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
$reportViewer = New-Object Microsoft.Reporting.WinForms.ReportViewer

$reportViewer.ProcessingMode = "Remote"

$reportViewer.ServerReport.ReportServerUrl = "http://Server//ReportServer"

$reportViewer.ServerReport.ReportPath = "/Report"

#required variables for rendering
$mimeType = $null
$encoding = $null
$extension = $null
$streamids = $null
$warnings = $null


#export to Excel
$excelFile = "C:\Test List.xls"
$bytes = $reportViewer.ServerReport.Render("Excel", $null, 
                  [ref] $mimeType, 
                  [ref] $encoding, 
            [ref] $extension, 
            [ref] $streamids, 
            [ref] $warnings)
$fileStream = New-Object System.IO.FileStream($excelFile, [System.IO.FileMode]::OpenOrCreate)
$fileStream.Write($bytes, 0, $bytes.Length)
$fileStream.Close()

#open the generated excel document
$excel = New-Object -comObject Excel.Application
$excel.visible = $true
$excel.Workbooks.Open($excelFile) | Out-Null

But I get an error -

This report requires a default or user-defined value for the report parameter 'Date'. To run or subscribe to this report, you must provide a parameter value

Can u tell me please, how to pass parameter?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source