Skip to Content
Former Member
Jun 25, 2016 at 12:11 AM

Use RESTFUL call to export webi report to CSV file



I have a Powershell script that connects to BO server to export webi report to PDF and Excel file, the export for both are successful. What is the mime type to use to export the report to CSV? I tried using "text/CSV" but that caused error

Here is the code snippet

$headers = @{ "X-SAP-LogonToken" = $logonToken ; "Accept" = "text/csv" ; "X-SAP-PVL" = $contentLocale }

Invoke-webrequest -Method Get -Uri $documentUrl -Headers $headers -OutFile $rptfile

Here is the runtime error message

Invoke-webrequest : RWS 00058 Not acceptable, (RWS 00058)

At C:\temp\abc.ps1:118 char:5

+ Invoke-webrequest -Method Get -Uri $documentUrl -Headers $headers -OutFile $ ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException

+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand