BookmarkSubscribeRSS Feed
tparvaiz
Obsidian | Level 7

Hi,

I am trying to put a logo and 2 graphs (Barline/Plot and GChart) on a single PDF file... my issue is with the PDF output, both graphs are showing up okay on HTML view...

Issue 1) When I run the below code my first graph, Barline/Plot shows only Barline graph and not the plot...second graph, using GChart, looks okay... my logo do not appear as well... I've also attached my log chunk for your reference that shows some issues related to ActiveX control.

Issue 2) when I run the same code with  goptions reset=all; then my Barline/Plot shows fine but it distrots my second chat and still I don't get my logo

Issue 3) when I use ODS layout with options reset=all; only then I get to see my logo as well as my barline/GChart, but still my second chart is distorted (removing formatting)

Please advice

Here are my log chunks

23       

24         /***************Initiating**************/

25         options nodate nocenter orientation=PORTRAIT LEFTMARGIN=0.1in RIGHTMARGIN=0.1in

25       ! font=arial;

26         ODS PDF FILE="\\ServerName\file.pdf"

26       ! contents=no UNIFORM startpage=never;

WARNING: Unsupported device 'ACTIVEX' for PDF destination. Using device 'ACTXIMG'.

NOTE: Writing ODS PDF output to DISK destination

      "\\servername\file.pdf", printer "PDF".

............

............

45         /******************Graph 1************************/

47         ods pdf text= '^S={font_size=20pt}';

48       

49         SYMBOL1 INTERPOL=JOIN HEIGHT=3pt VALUE=DOT CV=CX370000 CO=MAROON LINE=1 WIDTH=2

49       ! CI=CXA60000;

50         PATTERN1 COLOR=CXBCBC78;

51         Legend1   FRAME LABEL=(FONT='Arial/Bold' justify=center 'Volumes') value=(' ') ;

52         Legend2   FRAME LABEL=(FONT='Arial/Bold' justify=center 'Time') value =(' ');

53         Axis1     STYLE=3    WIDTH=1    MINOR=NONE LABEL=(angle=90 rotate=0 FONT='Arial/Bold'

53       ! justify=center 'Axis1');

54       

55         Axis2 value=(angle=45 rotate=0) LABEL=(FONT='Arial/Bold' justify=center '

55       ! Days');

56         Axis3     STYLE=1    WIDTH=1    MINOR=NONE LABEL=(angle=-90 rotate=0 FONT='Arial/Bold'

56       ! justify=center 'Time') ;

57         TITLE;

58       

59         ods pdf text= "^S={just=center font=('Arial',14PT,Bold)} Title

59       ! ";

60         PROC GBARLINE DATA=WORK.table1;

61              BAR  DAY_DATE /     discrete SUMVAR=VOLUME

62              TYPE=SUM CLIPREF FRAME SUM COUTLINE=BLACK  RAXIS=AXIS1     MAXIS=AXIS2     HREF=0     CREF=BLACK;

63              PLOT / SUMVAR=HLD_T     TYPE=SUM   AXIS=AXIS3   ;

64         format volume comma10.0;

65         format HLD_T comma10.0;

66         *format DAY_DATE Date5.;

67         RUN;

NOTE: ActiveX Control not available, defaulting to DEV=JAVAIMG.

68         Quit;

This version of the applet does not support Plot chart

Element Exception: Plot Name: Plot

Element Exception: Plot Name: Interpolation

3 The SAS System

Element Exception: Plot Name: Marker

Element Exception: Plot Name: Line

Element Exception: Legend Name: Legend

Here is my code

/***************Initiating**************/

options nodate nocenter orientation=PORTRAIT LEFTMARGIN=0.1in RIGHTMARGIN=0.1in font=arial;

ODS PDF FILE="\\ServerName\file.pdf" contents=no UNIFORM startpage=never;

*goptions reset=all;

ods escapechar='^';

title1 j=right height=10pt '^S={preimage="\\ServerName\Logo.JPG"}';

ods pdf text= "^S={just=center font=('Arial',16PT,Bold)} Main Title";

footnote1 j=right height=8pt font=arial "DATE: &current_worddate";

*ODS layout start columns=2;

*ODS region height=5in;

goptions vsize=4 in;

/******************Graph 1************************/

ods pdf text= '^S={font_size=20pt}';

SYMBOL1 INTERPOL=JOIN HEIGHT=3pt VALUE=DOT CV=CX370000 CO=MAROON LINE=1 WIDTH=2 CI=CXA60000;

PATTERN1 COLOR=CXBCBC78;

Legend1    FRAME LABEL=(FONT='Arial/Bold' justify=center 'Volumes') value=(' ') ;

Legend2    FRAME LABEL=(FONT='Arial/Bold' justify=center 'Time') value =(' ');

Axis1 STYLE=3    WIDTH=1    MINOR=NONE LABEL=(angle=90 rotate=0 FONT='Arial/Bold' justify=center 'Axis1');

Axis2 value=(angle=45 rotate=0) LABEL=(FONT='Arial/Bold' justify=center 'Days');

Axis3 STYLE=1    WIDTH=1    MINOR=NONE LABEL=(angle=-90 rotate=0 FONT='Arial/Bold' justify=center 'Time') ;

TITLE;

ods pdf text= "^S={just=center font=('Arial',14PT,Bold)} Title";

PROC GBARLINE DATA=WORK.Table1;

     BAR  DAY_DATE /     discrete SUMVAR=VOLUME

     TYPE=SUM CLIPREF FRAME SUM COUTLINE=BLACK  RAXIS=AXIS1     MAXIS=AXIS2     HREF=0     CREF=BLACK;

     PLOT / SUMVAR=HLD_T     TYPE=SUM   AXIS=AXIS3   ;

format volume comma10.0;

format HLD_T comma10.0;

*format DAY_DATE Date5.;

RUN;

Quit;

/******************Graph 2************************/

*ODS region height=5in;

ods pdf startpage=now;

ods pdf text= "^S={just=center font=('Arial',14PT,Bold)} Title Graph2";

Axis1 STYLE=1    WIDTH=1    MINOR=NONE LABEL=(angle=90 rotate=0 FONT='Arial/Bold' justify=center 'Level');

Axis2      value=(angle=45 rotate=0) LABEL=(FONT='Arial/Bold' justify=center 'Days');

Axis3 STYLE=1    WIDTH=1    LABEL=( FONT='Arial'   "Category");

PROC GCHART DATA=Table2;

BLOCK DAY_DATE / DISCRETE sumvar=VOLUME SUBGROUP=CATEGORY GROUP=CATEGORY NOLEGEND

RAXIS=AXIS1

     MAXIS=AXIS2

     GAXIS=AXIS3;

format volume comma10.0;

RUN;

Quit;

*ODS Layout end;

ODS PDF close;

6 REPLIES 6
ballardw
Super User

In what way is your second graph distorted under your scenario 3? What formatting is removed?

Try renaming the AXIS statements for the second graph as AXIS4 through AXIS6 and modify the references to match and see if that changes anything.

tparvaiz
Obsidian | Level 7

Hi ballardw,

I've tried to rename the Axis statement but it didn't worked...

Graph after goptions reset all.gif

ThanksGraph without goptions reset all.gif

ballardw
Super User

Since your axis labels don't quite match what appears in the AXIS statements there's something else going on.

I would suggest running PROC GOPTIONS AXIS;RUN; to see what your actual axis definitions are after each graph.

tparvaiz
Obsidian | Level 7

My Axis seems to be fine... I changed the code a bit when I posted here but used actual graphs, that might be causing the confusion...

Here are my sample tables... you may try to run it @ your end to see if you can replicate the same errors...

WORK.Table1

DAY_DATE VOLUMES     HLD_T

13JUL20123117.0880611.205
14JUL201249133.9660314.795
15JUL201254229.8846485.685
16JUL20125907.4418189.259
17JUL20128073.7117237.856
18JUL20127466.1819417.815
19JUL20122962.3824940.939
20JUL201291108.1033741.663
21JUL2012780.0722946.739
22JUL201288595.7550545.277
23JUL20121266.9205842.247
24JUL20124870.9730442.638
25JUL20121244.885747.485
26JUL20121041189.276746.082

work.table2

CATEGORYDAY_DATEVOLUME
CAT A13-Jul-12706311
CAT A14-Jul-12426349
CAT A15-Jul-12854943
CAT A16-Jul-12627984
CAT A17-Jul-12198392
CAT A18-Jul-12784285
CAT A19-Jul-12647874
CAT A20-Jul-12531749
CAT A21-Jul-12170458
CAT A22-Jul-12224900
CAT A23-Jul-12190787
CAT A24-Jul-12685354
CAT A25-Jul-12879807
CAT A26-Jul-12554154
CAT B13-Jul-12658663
CAT B14-Jul-12495575
CAT B15-Jul-12160814
CAT B16-Jul-12312830
CAT B17-Jul-12174802
CAT B18-Jul-12850810
CAT B19-Jul-12521259
CAT B20-Jul-122519
CAT B21-Jul-12129043
CAT B22-Jul-12831783
CAT B23-Jul-12890345
CAT B24-Jul-12819952
CAT B25-Jul-12590249
CAT B26-Jul-12161178
CAT C13-Jul-12601218
CAT C14-Jul-12504453
CAT C15-Jul-12202749
CAT C16-Jul-12989501
CAT C17-Jul-12726660
CAT C18-Jul-12311525
CAT C19-Jul-1278606
CAT C20-Jul-12674555
CAT C21-Jul-12915889
CAT C22-Jul-12876933
CAT C23-Jul-12267730
CAT C24-Jul-12859607
CAT C25-Jul-12957563
CAT C26-Jul-12500939
Cynthia_sas
SAS Super FREQ

Hi:

  If you have an urgent or immediate need, your best resource is to open a track with Tech Support. Look for the links in the forum system that say "Submit a problem report", in order to open a track with Tech Support. (There should be a link at the bottom of the viewing page).

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 795 views
  • 1 like
  • 3 in conversation