The SAS Output Delivery System and reporting techniques

How to make different font size in the different Link stament?

Reply
Frequent Contributor
Frequent Contributor
Posts: 81

How to make different font size in the different Link stament?

HI ,

Here is a sample codiing.

I have two line statements.

what I need is the first line statment to be different font size from the below line statment  and the font to be bold'

Is it possible to have differnet line statments to be different font attributes?

thanks very much for your help in advance

ods listing close;
ods pdf file ='c:\temp\test.pdf';

 

proc report data=sashelp.class nowd;

  column age name height weight;

  define age / order;


  compute after _page_/

    style={font_size=14pt font_face=Arial foreground=cyan

           font_weight=bold just=l};

    line ' I want this line font size and need to bold';
    line ' I want this line with different font size and non bold font';

  endcomp;

run;

ods _all_ close;

Thanks

regards

Tony.

SAS Super FREQ
Posts: 706

Re: How to make different font size in the different Link stament?

Have a look at the Inline formatting supported by ODS, SAS(R) 9.4 Output Delivery System: User's Guide, Third Edition

Here is some sample code

ods escapechar='^';
proc report data=sashelp.class nowd;
 
column age name height weight;
  define age / order;

 
compute after _page_/

   
style={

     just=l};
    length line1 line2 $ 256;
    line1 =
'^{style [font_weight=bold]I want this line font size and need to bold}';
    len1 = length(line1);
   
line line1 $varying256. len1;
    line2 = '^{style [font_size=14pt foreground=cyan]I want this line with different font size and non bold font}';
    len2 = length(line2);
   
line line2 $varying256. len2;

 
endcomp;
run;
Frequent Contributor
Frequent Contributor
Posts: 81

Re: How to make different font size in the different Link stament?

Hi Bruno

Thanks very much for getting back so soon, I really appreciate  but I couldn't get what I  expect. 

I am runnng SAS 8.2.

When I run this code, I get the folloiwng output for Line statment.

                                                                  ^{style [font_weight=bold]I want this line font size and need to bold}
                                                   ^{style [font_size=14pt foreground=cyan]I want this line with different font size and non bold font}

Thanks

SAS Super FREQ
Posts: 706

Re: How to make different font size in the different Link stament?

Well I do not remember whether the Inline formatting was already available with SAS8.2 you might find some user group papers talking about this subject.

Have a look here SAS Technical Support Services and Policies you are using a really old version it would make sense to go for a newer version.

SAS Super FREQ
Posts: 8,820

Re: How to make different font size in the different Link stament?

Hi,

  ODS ESCAPECHAR was available in late version 8, but the syntax was different. Instead of what Bruno used in his code with a "function-like" style override using ODS ESCAPECHAR and in-line formatting, the original syntax was a bit different. For one thing, it wasn't like a function call and for another, you couldn't nest style overrides. But I have many examples of the original style ODS ESCAPECHAR in this 2007 Global Forum paper on ESCAPECHAR: http://www2.sas.com/proceedings/forum2007/099-2007.pdf, which has comparisons to the "new" syntax. So you can work backwards from the new to the original syntax.

cynthia

Ask a Question
Discussion stats
  • 4 replies
  • 487 views
  • 0 likes
  • 3 in conversation