BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dipanarya1
Obsidian | Level 7

Hi Team, We are trying to provide an options to generate the RTF, PDF and Excel file using STP. We are able to generate an output in RTF and in PDF format, but while trying to generate the Excel file the STP is giving the _webout related error, attached log file and below is the code snippet.

1 ACCEPTED SOLUTION

Accepted Solutions
AllanBowe
Barite | Level 11

How are you calling the STP?  From EG, a web browser, Excel?

 

If you are calling it from a web browser I'd suggest setting to `stream` output and removing the automatic `%STPBEGIN;` / `%STPEND;` macros.  This will ensure that any output sent to the `_webout` fileref will be received 'cleanly' by the client.  If downloading files then you will also have to set the http headers, eg:

 

data _null_;
  rc = stpsrv_header('Content-type','application/excel');
  rc = stpsrv_header('Content-disposition',"attachment; filename=myfile.xls");
run;

 

 

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

View solution in original post

3 REPLIES 3
dipanarya1
Obsidian | Level 7

Attached log file.

dipanarya1
Obsidian | Level 7
Please note the macro attached in first post is being called up in SAS STP.
AllanBowe
Barite | Level 11

How are you calling the STP?  From EG, a web browser, Excel?

 

If you are calling it from a web browser I'd suggest setting to `stream` output and removing the automatic `%STPBEGIN;` / `%STPEND;` macros.  This will ensure that any output sent to the `_webout` fileref will be received 'cleanly' by the client.  If downloading files then you will also have to set the http headers, eg:

 

data _null_;
  rc = stpsrv_header('Content-type','application/excel');
  rc = stpsrv_header('Content-disposition',"attachment; filename=myfile.xls");
run;

 

 

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1285 views
  • 1 like
  • 2 in conversation