The SAS Output Delivery System and reporting techniques

ODS title statement with background colors and url linkage for each element in PDF

Reply
Frequent Contributor
Frequent Contributor
Posts: 133

ODS title statement with background colors and url linkage for each element in PDF

Hello all;

I am essentially using the title statement as a way to create "buttons" with white for the color and a blue background color-

What I am attempting to do is assign separate url links to each element and this is where I have problems-

The code I have is below-In the end I need to add pdf anchors but for the purposes of the code I am just including basic urls-

Thank you.

Lawrence

options ls=130 nonumber nodate nocenter;

ods pdf file='temp.pdf';

title;

ods escapechar='^';

title j=center "^{style  [borderleftwidth=2pt borderleftcolor=black borderbottomwidth=3pt borderbottomcolor=black borderrightwidth=2pt   borderrightcolor=black

bordertopwidth=3pt bordertopcolor=black  background=blue color=white url='http://www.yahoo.com' ] A } |

^{style  [borderleftwidth=2pt borderleftcolor=black borderbottomwidth=2pt borderbottomcolor=black borderrightwidth=2pt   borderrightcolor=black

bordertopwidth=2pt bordertopcolor=black  background=blue color=white  url='http://www.google.com'] B }";

data _null_;

file print;

put 'xxx';

run;

ods pdf close;

Super Contributor
Posts: 273

Re: ODS title statement with background colors and url linkage for each element in PDF

Hi LB

Find here some indication for yours buttons

next step could be the anchors   but in the title? it seems strange.

HTH

Andre

tested 9.3   but play and modify it

i have correct the syntax

options ls=250 nonumber nodate nocenter  orientation=landscape;

ods escapechar='^';

ods pdf file='d:\temp\button.pdf';

title;

title j=center

"^{style [borderleftwidth=2pt borderleftcolor=black borderbottomwidth=3pt              borderbottomcolor=black

  borderrightwidth=2pt

  borderrightcolor=black bordertopwidth=3pt bordertopcolor=black

background=blue color=white url='http://www.yahoo.com' ] A }

   

  ^{style  [borderleftwidth=2pt borderleftcolor=black borderbottomwidth=2pt 

   borderbottomcolor=black

  borderrightwidth=2pt borderrightcolor=black bordertopwidth=2pt

  bordertopcolor=black

background=blue color=white url='http://www.google.com'] B

    } ";


data _null_;

file print ods=(variables=(x(format=$20.))) ;

x= 'xxx';

put    _ods_ ;

run;

quit;

ods pdf close;




Frequent Contributor
Frequent Contributor
Posts: 133

Re: ODS title statement with background colors and url linkage for each element in PDF

Andre;

Not sure if this is one of those differences between 9.2 & 9.3 but it fails in 9.2. Thank you for your assistance.

Yes I am looking to modify a report to "mimic" buttons with url links. If need be, I can import the buttons as jpegs and then assign them url links.

Lawrence

Super Contributor
Posts: 273

Re: ODS title statement with background colors and url linkage for each element in PDF

Hi Lawrence,

Studying the outputs, i see finally that it works under 9.3.0 and 9.2.3

BUT i recognize that

with html destination  the buttons are refering to the correct hyperlinks

with pdf indeed yahoo is present twice!   and this is an error

with rtf  the hyperlinks are correct

another way to obtain your goal could be

.

title2link='http://www.ined.fr' "B";

So once again ods adaptations are not universal!

Sorry and ask for help to the sas support.

and transmit them the error we have discovered!

After, please report here about the error too.

Andre

Ask a Question
Discussion stats
  • 3 replies
  • 275 views
  • 0 likes
  • 2 in conversation