<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Download PDF created by ODS in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Download-PDF-created-by-ODS/m-p/547219#M22596</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have a datastep that opens _WEBOUT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _NULL_;
  set webOutput;
  file _WEBOUT;
  put l;
run;&lt;/PRE&gt;
&lt;P&gt;In the "data webOutput(keep = l);" Step i create HTML which has serveral dropdown-menues and a button on the top of the page. The rest of the page is an iframe which has a table, generated by an proc tabulate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now i want to export this table to PDF. So i created in a macro an ods-statement, that creates a pdf:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;		  	ods pdf file='/mypdf.pdf';
		  	%proc_tabulate_code;
		  	ods pdf close;	&lt;/PRE&gt;
&lt;P&gt;But how can i forward the PDF to the browser? I have found some examples - e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
rc = stpsrv_header('Content-type','application/pdf');
rc =
stpsrv_header('Content-disposition','attachment; filename=temp.pdf');
run;

ods listing close;

ods PDF  body=_webout ;

proc print data=sashelp.class;
run;

ODS PDF  CLOSE;&lt;/PRE&gt;
&lt;P&gt;But always the PDF is shown on the HTML-Page or in the STP-Log as Binary-Code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Already clear why (the PDF is written to _webout - and _webout is already open) - But how can i close _webout? Or what other &lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;possibilities exists?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Thank you very much&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Kind regards&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;George&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Mar 2019 14:47:04 GMT</pubDate>
    <dc:creator>sorosch</dc:creator>
    <dc:date>2019-03-29T14:47:04Z</dc:date>
    <item>
      <title>Download PDF created by ODS</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Download-PDF-created-by-ODS/m-p/547219#M22596</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have a datastep that opens _WEBOUT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _NULL_;
  set webOutput;
  file _WEBOUT;
  put l;
run;&lt;/PRE&gt;
&lt;P&gt;In the "data webOutput(keep = l);" Step i create HTML which has serveral dropdown-menues and a button on the top of the page. The rest of the page is an iframe which has a table, generated by an proc tabulate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now i want to export this table to PDF. So i created in a macro an ods-statement, that creates a pdf:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;		  	ods pdf file='/mypdf.pdf';
		  	%proc_tabulate_code;
		  	ods pdf close;	&lt;/PRE&gt;
&lt;P&gt;But how can i forward the PDF to the browser? I have found some examples - e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
rc = stpsrv_header('Content-type','application/pdf');
rc =
stpsrv_header('Content-disposition','attachment; filename=temp.pdf');
run;

ods listing close;

ods PDF  body=_webout ;

proc print data=sashelp.class;
run;

ODS PDF  CLOSE;&lt;/PRE&gt;
&lt;P&gt;But always the PDF is shown on the HTML-Page or in the STP-Log as Binary-Code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Already clear why (the PDF is written to _webout - and _webout is already open) - But how can i close _webout? Or what other &lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;possibilities exists?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Thank you very much&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Kind regards&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;George&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 14:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Download-PDF-created-by-ODS/m-p/547219#M22596</guid>
      <dc:creator>sorosch</dc:creator>
      <dc:date>2019-03-29T14:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Download PDF created by ODS</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Download-PDF-created-by-ODS/m-p/547336#M22600</link>
      <description>Hi:&lt;BR /&gt;  If this is a stored process question or a SAS/IntrNet question, then you might want to post the question in the Stored Process Community &lt;A href="https://communities.sas.com/t5/SAS-Stored-Processes/bd-p/sas_stored_processes" target="_blank"&gt;https://communities.sas.com/t5/SAS-Stored-Processes/bd-p/sas_stored_processes&lt;/A&gt; or open a track with Tech Support.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Fri, 29 Mar 2019 21:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Download-PDF-created-by-ODS/m-p/547336#M22600</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-03-29T21:09:30Z</dc:date>
    </item>
  </channel>
</rss>

