BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bheinsius
Lapis Lazuli | Level 10

hi,

i have a stored process that i call from the web.

the stored process is created in EG and also deployed from EG.

the stored process generates a fancy pdf document with ods layout stuff applied.

when i call the stored process from a browser with US locale, the papersize is set to letter (see my previous question at https://communities.sas.com/message/180880#180880) causing the content to run off the pdf page.

i need to force papersize A4.

the obvious solution would be to set options papersize=a4 in my EG project, but i already did this and it doesn't work.

i think this is because when the stored process is deployed from EG, %stpbegin is inserted before all my code causing the ods pdf stream to already be opened with the letter papersize before my options papersize=a4 has the chance of altering it.

i can get it to work by manually editing the stored process source code and inserting the options papersize=a4 statement before the %stpbegin macro but i am not allowed to do that in our environment.

is there another way to dictate the papersize option in this scenario?

i would rather not deploy the stored process without the %stpbegin macro and code my own ods pdf statements.

thanks,

Bart

1 ACCEPTED SOLUTION

Accepted Solutions
bheinsius
Lapis Lazuli | Level 10

_PRINTOPTIONS worked.

after some error checking, %stpbegin submits:

  %if (%qcmpres(&_STPERROR) eq 0) %then %do;

    options &_PRINTOPTIONS;

  %end;

i added a hidden parameter to the Stored Process with name "_printoptions" and default value "papapersize=a4" and now the pdf comes out in A4 regardless of browser locale.

View solution in original post

2 REPLIES 2
ballardw
Super User

What options are you passing to the %stpbegin macro? If I read the macro correctly it looks like you can send print options via the parameter _PRINTOPTIONS and it looks like PAPERSIZE should be accepted though I can't tell immediately what the syntax would be.

bheinsius
Lapis Lazuli | Level 10

_PRINTOPTIONS worked.

after some error checking, %stpbegin submits:

  %if (%qcmpres(&_STPERROR) eq 0) %then %do;

    options &_PRINTOPTIONS;

  %end;

i added a hidden parameter to the Stored Process with name "_printoptions" and default value "papapersize=a4" and now the pdf comes out in A4 regardless of browser locale.

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
  • 2 replies
  • 1057 views
  • 3 likes
  • 2 in conversation