Hey Jack,
In your original post, you have mentioned that the report is generated by stored procedure. The code that I created for you is designed to run in a stored procedure. _webout file reference is a reserved file reference used by stored procedures to direct the output to the user's browser. You will need to open the stored procedure in your stored procedure web app to see how it works. If you don't know where the app is, ask your support team.
About HTTP headers (sorry, I refered to them as HTML headers in my original message), here is the link: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields The headers that I refered to, they change the description of content. For example, if you specify this header: (Content-type:application/msword), that will tell the browser that what is being sent, is actually a word document. You can amend HTTP headers by calling stpsrv_header function like this: (stpsrv_header(Content-type,application/msword)). HTTP headers for ms excel: stpsrv_header(Content-type,application/vnd.ms-excel).
Let me know if you have any issues with this.
Vasilij
... View more