BookmarkSubscribeRSS Feed
Stephane
Quartz | Level 8
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
5 REPLIES 5
Vince_SAS
Rhodochrosite | Level 12
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
Cynthia_sas
SAS Super FREQ
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
Stephane
Quartz | Level 8
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
Cynthia_sas
SAS Super FREQ
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
GregElmore
Calcite | Level 5

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 1473 views
  • 0 likes
  • 4 in conversation