BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
maxpgn
Fluorite | Level 6

Hi Everybody,
I would much appreciate if anyone could give me any help about this problem. I created a ODS PDF report. The report includes 2 pages: on the first one I have 2 tables (T1 and T2), side by side. On the second page, I need to print 3 graphs (G1, G2 and G3). This is my code:

 

ods _ALL_ CLOSE;

ods pdf file="Report_1.pdf" style=Normal Startpage = off NOTOC nogtitle;

options papersize=A4;
options nodate nonumber topmargin=0.003cm
bottommargin=0.03cm
leftmargin=0.003cm
rightmargin=0.003cm;

options orientation=landscape;


* First Page (T1, T2);
ods layout start height=19cm width=27cm;

*region 1 (T1);
ODS REGION x=0cm y=1cm width=13cm height=17cm;
PROC DOCUMENT NAME=DOCUMS.M07_TAB_1;
...
QUIT;

*region 2 (T2);
ODS REGION x=13.7cm y=1cm width=13cm height=17cm;
PROC DOCUMENT NAME=DOCUMS.M07_TAB_2;
...
QUIT;

ods layout end;

 

*Second page (G1, G2, G3);

ods pdf startpage=now;
* Change page orientation;
options orientation=portrait;
*Define Layout;
ods layout start height=29cm width=19cm;

*Region 1 (for G1);
ods region y=0.5cm;
ods graphics on / width=17cm height=8cm;
proc document name=DOCUMS.M07_GRAF;
replay \SGPlot#1;
run;
quit;

 

*Region 2 (for G2);
ods region y=10cm;
ods graphics on / width=17cm height=8cm;
proc document name=DOCUMS.M07_GRAF;
replay \SGPlot#2;
run;
quit;

 

*Region 3 (for G3);
ods region y=19.5cm;
ods graphics on / width=17cm height=8cm;
proc document name=DOCUMS.M07_GRAF;
replay \SGPlot#3;
run;
quit;

ods layout end;

ods pdf close;

 

This code is working perfectly, generating the pdf report Report1.pdf
This report must be included as part of a bigger report that we can call report2.pdf: to give you an idea, the two pages of Report1 will become page 11 and 12 of Report_2. The report Report_2 is quite complicated, with many changes in page orientation.
I tried to include Report_1 into Report_2 by simply including the above mentioned code in the code I use to generate Report_2 but this solution in not working because G3 is printed only partially, as if the layout would not be defined correctly by the same code.
I can generate G1, G2 amd G3 only by drastically reduce their dimensions, but this would live a lot of white space on the page.
Any idea?

I already red the topic "ODS PDF Truncated Graph"
(https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-pdf-truncated-graph/m-p/372941#M18904) but the solution offered is not appliable in my case: the code for Report_1 is woring perfectly....it's only when this code is used as part of a longer code that it freaks out.
Thank You very much for any suggestion.

1 ACCEPTED SOLUTION

Accepted Solutions
maxpgn
Fluorite | Level 6

Hi,

With some luck (and a lot of trial and error) I found a solution. It was necessary to specify

 

goptions device=SASPRTC;

 

Now all the graph are printed perfectly.

 

Thank you all anyway

 

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
You only sent partial code and no data. If your problem happens when the working code is incorporated into another process, then someone will have to look at ALL the code, with data, in order to help you figure out what is going awry. This may be the type of question that is better asked of Tech Support.

Cynthia
maxpgn
Fluorite | Level 6

Hi,

With some luck (and a lot of trial and error) I found a solution. It was necessary to specify

 

goptions device=SASPRTC;

 

Now all the graph are printed perfectly.

 

Thank you all anyway

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 729 views
  • 0 likes
  • 2 in conversation