Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2800

Use RESTFUL call to export webi report to CSV

$
0
0

Hi

 

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

 

 

Thanks


Viewing all articles
Browse latest Browse all 2800

Trending Articles