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.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2564 views
  • 3 likes
  • 2 in conversation