Your SAS programs, embedded in web apps and elsewhere

STP to have a PDF

Reply
Contributor
Posts: 73

STP to have a PDF

all,

I'm working on a STP that should generate a PDF with the options orientation=landscape papersize=legal;papersize=legal;

With an execution on SAS that works perfectly.

I created the STP based on that program and I get a portrait orientation. I don't understand why.

Is it possible with a STP ?
Do I need an another option ?
Do I need to delete the %stpbegin; step in order to replace it by a stpsrv_header() line ? (not sure I understandd that but I could try)


I'm working with EGUIDE 4.1, Windows BI platform. I must use the workspace server.

I declared these parameters

_RESULT = PACKAGE_TO_REQUESTER;
_ODSDEST = PDF;
_ODSSTYLE = printer;

and I use that

ODS NOPTITLE;
FILENAME EGPDFX TEMP;
options orientation=landscape papersize=legal;
ODS PDF (ID=EGPDFX) FILE=EGPDFX ;

proc tabulate ...

;*';*";*/;quit;run;
ODS _ALL_ CLOSE;

Help... Message was edited by: Stephane
SAS Super FREQ
Posts: 304

Re: STP to have a PDF

If you're using STPBEGIN/END you are likely getting multiple ODS statements.

Set OPTIONS MPRINT and examine the log to see.

Generally speaking, if you want to use STPBEGIN/END, you should not supply your own ODS statements.

Vince DelGobbo
SAS R&D
SAS Super FREQ
Posts: 8,864

Re: STP to have a PDF

Hi:
You might want to work with Tech Support. There used to be some issues with EG and orientation for PDF, as explained in this Tech Support note:
http://support.sas.com/kb/4/781.html

I am not sure why your code has the FILENAME statement and the overrides to _ODSDEST and the other reserved macro variables. Also, I don't think you really need to set _RESULT. And, I'm curious about why you would even set a parameter like _RESULT with a prompt. I would have expected to see something like this for your SP code:
[pre]
*ProcesBody;

%let _ODSDEST = PDF;
%let _ODSSTYLE = printer;
%let _odsoptions = NOTOC;

options orientation=landscape papersize=legal;

%stpbegin;

ODS NOPTITLE;

proc tabulate data=sashelp.prdsale f=comma6.;
class country region division product;
var actual predict;
table country*region all,
division*product*actual*(sum n);
run;

%stpend;
[/pre]

When I ran the above code, AS A STORED PROCESS, in EG 4.3, I got landscape results returned to my EG session (using the Workspace server). I turned off the PDF bookmarks with NOTOC, in order to verify that the returned results were landscape mode.

That's why I'd recommend working with Tech Support. Your code does not look like it has been fully converted to a stored process and your reserved macro variables do not seem to be set correctly.

cynthia
Contributor
Posts: 73

Re: STP to have a PDF

Posted in reply to Cynthia_sas
Great. Thank you.

I create the program with eg and choose the pdf output in the option. This is why I have the filename.
Because I execute it with the web stored process interface I add the parameter to have the pdf output. Otherwise it does not work.

Do you have a better solution that simplify my work ? If I elaborate a stp with a process flow in eg , do I unclick all the output in the options and add the macro parameters like you ? Message was edited by: Stephane
SAS Super FREQ
Posts: 8,864

Re: STP to have a PDF

If you are creating your stored process in EG, I do not understand why the %STPBEGIN/%STPEND are not being inserted into your code. There might be something about your implementation of EG that is making the Stored Process Wizard generate incorrect code. I would recommend that you work with SAS Tech Support on this matter.

cynthia
N/A
Posts: 1

Re: STP to have a PDF

Posted in reply to Cynthia_sas

I'm having a similar issue.  I have a stored process that I'd like to render back to the html client.  With the option _ODSDEST=PDF, the orientation is always portrait when sent back to the client, even though the options orientation=landscape is set.  If I save the pdf to a file using ods pdf file=<...>, the orientation is landscape.  Is there anyway to set the orientation to landscape when streaming the results back to the client?

Thanks

Greg

Ask a Question
Discussion stats
  • 5 replies
  • 431 views
  • 0 likes
  • 4 in conversation