Your SAS programs, embedded in web apps and elsewhere

Deliverying Information Delivery Portal output as native Excel binary file

Reply
New Contributor
Posts: 4

Deliverying Information Delivery Portal output as native Excel binary file

Greetings,

I have been given the requirement of downloading a custom report as a native Excel binary file and not as a XML file.

The user selects options in SAS Information Delivery Portal to create a custom report and then this report is returned to the user as an Excel file.  The simplified code below is what I currently have.

Thanks in advance,

F

*  Begin EG generated code (do not edit this line);

*

*  Stored process registered by

*  Enterprise Guide Stored Process Manager V4.3

*

*  ====================================================================

*  Stored process name: Stored Process for DDE

*  ====================================================================

*;

*ProcessBody;

       

data null_;

rc = stpsrv_header('Content-type','application/vnd.ms-excel');

rc = stpsrv_header('Content-disposition','attachment; filename=_.xls');

run;

%let _odsdest=phtml;

%STPBEGIN;

proc print data=sashelp.class;

run;

%STPEND;

*  Begin EG generated code (do not edit this line);

;*';*";*/;quit;

*  End EG generated code (do not edit this line);

;

SAS Super FREQ
Posts: 8,744

Re: Deliverying Information Delivery Portal output as native Excel binary file

Hi:

  When you use ODS, you are creating ASCII text files (either CSV, HTML or XML) that Excel knows how to open and render. I see you are using PHTML -- this is an HTML format with very little style (and not an XML format).

  The only ways to deliver true, binary Excel files is to use PROC EXPORT or the LIBNAME engine for Excel. You might want to work with Tech Support on this question, because you would NOT use a stored process the way you are -- with ODS.

cynthia

Ask a Question
Discussion stats
  • 1 reply
  • 424 views
  • 0 likes
  • 2 in conversation