BookmarkSubscribeRSS Feed
DavidPhillips2
Rhodochrosite | Level 12

I am trying to send the contents of a URL portlet to a PDF and I am running into a number of bugs in 9.2.

Is there a way to use ods regions to display pdf text and then graphs side by side without having a page in-between?  I found a way to display the graphs side by side but it causes a page break.

Proc Report Does not seem to have odd formatting in pdf format however proc tabulate with multiple group columns does.  I converted my tabular displays over to proc report.

4 REPLIES 4
DavidPhillips2
Rhodochrosite | Level 12

I am trying to follow page 3 of

http://support.sas.com/resources/papers/proceedings14/SAS330-2014.pdf

I have a basic output statement

ods layout gridded columns=2 column_gutter=0in advance=bygroup;

     ods region;

          proc gchart data=enrollment;                                                                                                      

          vbar location /                                                                                                      

          sumvar=students_enrolled

          legend=legend1 outside=sum                                                                                                       

          run;                                                                                                                                   

          quit;

     ods region;

          proc gchart data=enrollment;                                                                                                      

          vbar location /                                                                                                      

          sumvar=students_enrolled

          legend=legend1 outside=sum                                                                                                       

          run;                                                                                                                                   

          quit;

ods layout end;

and get ERROR: REGION= found but no LAYOUT open for the destination.

It acts liked gridded is not available in SAS 9.2.  Am I doing something basic wrong here or is gridded not available in 9.2?

DavidPhillips2
Rhodochrosite | Level 12

I looked at

ods pdf;

  ods layout start;

  ods region x=0pct y=0pct width=50pct ;

  proc print data=sashelp.class;

  run;

  ods region x=50pct y=0pct width=50pct;

  proc means data=sashelp.class;

  run;

  ods layout end;

  ods pdf close;

Presenting more than one plot on a page using SAS ODS PDF | TechnologyTales.com

I can create multiple rows by using multiple layout commands.


For headings

ods escapechar='^';

ods pdf text="^S={font=('Arial',13pt,bold) just=center}MyHeadingText";

This article shows how to remove the boarder created around pdf text

45762 - How to remove the borders around the text generated by ODS PDF TEXT=


proc template;
  define style styles.mystyle;
  parent=styles.normalprinter;
  class usertext from usertext /
  bordertopcolor=white
  borderbottomcolor=white
  borderleftcolor=white
  borderrightcolor=white
  just=c;
  end;
run;

options nodate nonumber ;
title;
ods pdf file="ods_pdf_text.pdf" style=styles.mystyle notoc startpage=no;

DavidPhillips2
Rhodochrosite | Level 12

Oddly the below code produces a text line on the first line of one page.  Then the two gcharts are displayed side by side on the next.  I tried adding height to the regions but it does not take effect in SAS 9.2.  The gridded feature is documented as a 9.2 feature but appears to be broken in 9.2.

           

ods pdf style=styles.pdfStyle startpage=no;

ods escapechar='^';

ods layout start;

ods region width=100pct x=0pct;                                                                              

ods pdf text="^S={font=('Arial',13pt,bold) just=center}mytitle

ods layout end;

ods layout start;

ods region x=0pct y=0pct width=50pct;

            /*gchart1*/

ods region x=50pct width=50pct;

            /*gchart2*/

ods layout end;

I also found that when I created a sgpanel that takes up more than one page in a pdf that the sgpanel does not show up.



Start page is supposed to handle this.

https://support.sas.com/resources/papers/proceedings09/043-2009.pdf


"STARTPAGE= The STARTPAGE= option is another easy option that controls the placement of output. The syntax is simple. In the ODS statement, type STARTPAGE=YES|NO|NOW to invoke the option. Let’s go through all three options and explain how each of them works. The first option—YES—is the default. Invoking STARTPAGE=YES inserts a new page at the beginning of each procedure. It’s basically the normal behavior you see when you don’t set the option. When a procedure's output is laid out, a new page will be invoked at the end. The second option is NO. When you invoke STARTPAGE=NO, this means there will be no page insertions before each procedure. A new page will occur only when the current page is filled. The third option is NOW. This option forces the immediate insertion of a new page into the output."

DavidPhillips2
Rhodochrosite | Level 12

I found that I can display a long Sgpanel if I remove ‘layout’ from around it.

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