param(
[string]$cFilename="PreBill-2026-",[string]$cPROPERTYKEY="0", [string]$cBILLNO
)

#Specify variables and pass parameters and specify format of report PDF (to keep things simple)
$url = "http://ocsql23/ReportServer/Pages/ReportViewer.aspx?/GATCSReports/TAXBILL_PREBILL&ReportSvr=ocsql23&ReportDB=DY2025&PROPERTYKEY="+$cPROPERTYKEY+"&rs:Format=PDF"

$webclient = New-Object System.Net.WebClient
$webclient.UseDefaultCredentials = $TRUE

$file = "d:\tco\gatcs\create_pdf\prebill_pdf\"+$cFilename+$cBILLNO+".pdf"
$webclient.DownloadFile($url,$file)
