Cynthia,
Thanks for your answer, which is very helpful. I do have another question.
I've made a Stored Process which displays a HTML-page using the _webout filref. The HTML-page contains some inputfields for the enduser and one of those inputfields is a combobox, that contains the output destinations. I've defined a few (HTML, PDF, PDF Narrow, Micorsoft Excel, Microsoft Word, Microsoft Word Narrow). The "narrow-destinations" use a different template.
When the user clicks the 'show report' button, another stored process is invoked which contains the code for the report and uses the parameters entered by the enduser.
Another way is to use the default parameter-functionality embedded in a stored process, that is defined with EG and is used in both EG and Office and Web Report Studio.
So I have two ways in presenting parameters to the enduser. First is the webpage, second is the default parameter-functionality embedded in a stored process.
Now, here's the problem. When the report is running, a macro is used to control the ODS. But the different clients act differently when i choose a particular output. For example: when I use the web-interface and i choose to generate a Microsoft Word Narrow output, Word is opened and the document is displayed.
But when i use the Add-in, the result is an XML-document with the root-element "SASReport". I think this is the default output for WRS.
How can I fix this problem?
Raoul.
P.S. The code I use in the macor to control the ODS is like the following:
%MACRO ods_open(formaat = );
%GLOBAL _ODSDEST _ODSSTYLE _ODSSTYLESHEET _ODSOPTIONS;
OPTIONS ORIENTATION = LANDSCAPE;
/* Create some templates ... */
PROC TEMPLATE;
...
RUN;
ODS PATH RESET;
/* Add the templates to the searchpath */
ODS PATH (PREPEND) work.templat(UPDATE);
%LET formaat = %UPCASE(&formaat);
%IF &formaat = MICROSOFT EXCEL %THEN %DO;
%LET _ODSDEST = ;
%LET _ODSSTYLE = ;
%LET _ODSSTYLESHEET = ;
%LET _ODSOPTIONS = ;
DATA _NULL_;
rc = STPSRV_HEADER('Content-type', 'application/vnd.ms-excel');
rc = STPSRV_HEADER('Content-disposition', 'attachment; filename=tmp.xls');
RUN;
%END;
%ELSE %IF &formaat = MICROSOFT POWERPOINT %THEN %DO;
%LET _ODSDEST = ;
%LET _ODSSTYLE = ;
%LET _ODSSTYLESHEET = ;
%LET _ODSOPTIONS = ;
DATA _NULL_;
rc = STPSRV_HEADER('Content-type', 'application/vnd.ms-powerpoint');
rc = STPSRV_HEADER('Content-disposition', 'attachment; filename=tmp.ppt');
RUN;
%END;
%ELSE %IF &formaat = MICROSOFT WORD %THEN %DO;
%LET _ODSDEST = rtf;
%LET _ODSSTYLE = styles.rtftemp;
%LET _ODSSTYLESHEET = ;
%LET _ODSOPTIONS = ;
DATA _NULL_;
rc = STPSRV_HEADER('Content-type', 'application/msword');
rc = STPSRV_HEADER('Content-disposition', 'attachment; filename=tmp.doc');
RUN;
%END;
%ELSE %IF &formaat = MICROSOFT WORD NARROW %THEN %DO;
%LET _ODSDEST = rtf;
%LET _ODSSTYLE = styles.rtfnarrow;
%LET _ODSSTYLESHEET = ;
%LET _ODSOPTIONS = ;
DATA _NULL_;
rc = STPSRV_HEADER('Content-type', 'application/msword');
rc = STPSRV_HEADER('Content-disposition', 'attachment; filename=tmp.doc');
RUN;
%END;
%ELSE %IF &formaat = PDF %THEN %DO;
%LET _ODSDEST = pdf;
%LET _ODSSTYLE = styles.pdftemp;
%LET _ODSSTYLESHEET = ;
%LET _ODSOPTIONS = BOOKMARKGEN=NO COMPRESS=9 STARTPAGE=NO;
DATA _NULL_;
rc = STPSRV_HEADER('Content-type', 'application/pdf');
rc = STPSRV_HEADER('Content-disposition', 'attachment; filename=tmp.pdf');
RUN;
%END;
%ELSE %IF &formaat = PDF NARROW %THEN %DO;
%LET _ODSDEST = pdf;
%LET _ODSSTYLE = styles.pdfnarrow;
%LET _ODSSTYLESHEET = ;
%LET _ODSOPTIONS = BOOKMARKGEN=NO COMPRESS=9 STARTPAGE=NO;
DATA _NULL_;
rc = STPSRV_HEADER('Content-type', 'application/pdf');
rc = STPSRV_HEADER('Content-disposition', 'attachment; filename=tmp.pdf');
RUN;
%END;
%ELSE %IF &formaat = HTML %THEN %DO;
%LET _ODSOPTIONS = RS=NONE;
/************************************************************************************/
/* Code from: http://support.sas.com/kb/30/783.html */
/************************************************************************************/
ODS PATH (prepend) work.templat(update);
PROC TEMPLATE;
DEFINE TAGSET tagsets.nostyle;
PARENT = tagsets.html4;
embedded_stylesheet = no;
END;
RUN;
ODS HTML BODY = _webout stylesheet=(URL="http://.../stylesheets/mystylesheet.css");
ODS HTML CLOSE;
%LET _ODSDEST = tagsets.nostyle;
%END;
%ELSE %DO;
%LET _ODSDEST = html;
%LET _ODSSTYLE = sasweb;
%LET _ODSSTYLESHEET = ;
%END;
%stpbegin;
%MEND ods_open;
%MACRO ods_close;
%stpend;
%MEND ods_close;
... View more