SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
SASdevAnneMarie
Barite | Level 11

Hello Experts,

 

Do you know, please how to show a text on italic characters in obj.format_text ?

My code dos'nt work :

  obj.format_text( data:  "frais forfaitaires : ", overrides: " just=left color=cx95337 font_weight=normal font_size=12pt font_style=italic");

Thank you for your help ! 

4 REPLIES 4
ballardw
Super User

I would expect to see something using Style_attr instead of override

obj.format_text(data: "your text here",
                style_attr: 'font_style=italic 
                             font_size=12pt         
                             font_weight=bold       
                             color=cxbbb2e0');    
SASdevAnneMarie
Barite | Level 11
Thank you Ballardw,

I tried both ways :
obj.format_text( data: "Dont taux de rétrocession de commission", style_attr: "font_style=italic font_size=12pt font_weight=normal color=cx95337");
obj.format_text( data: "Dont taux de rétrocession de commission", style_attr: 'font_style=italic font_size=12pt font_weight=normal color=cx95337');

The characters are not in italic, do you know please, some another option ? Thank you !
ballardw
Super User

What ODS style are you using for output? It may be that the font involved did not provide an Italic version.

 

If you could provide a small complete step to demonstrate it would help. Just enough code that shows the result that we can run.

SASdevAnneMarie
Barite | Level 11

Thank you for your mesage, Ballardw.

 

My code is :

 


%macro fichiers_publipostage_pdf_accord;
	%do i=1 %to &nb_obs_nom_prd.;

		data _NULL_;
			set ACCORD2;
			CALL SYMPUTX(COMPRESS('Produit'),Produit);
			CALL SYMPUTX(COMPRESS('Code'),Code);
			run;

		OPTION NODATE NONUMBER;
		OPTIONS PAPERSIZE=A4;
		options orientation=portrait;
		OPTIONS TOPMARGIN=.001 in BOTTOMMARGIN=.001 in LEFTMARGIN=.001 in RIGHTMARGIN=.001 in;
		ODS NORESULTS;
		ODS PDF FILE = "&Publipostage.\&Code..pdf" dpi=1800;
		ODS ESCAPECHAR = "^";

		data _NULL_;
			declare odsout obj();
			obj.layout_absolute(width:
				"8.26 in",height:"11.68 in" );
			obj.region(width:
				"18cm" ,x: "1.5cm", y:"1cm", height:"0.4cm", style_attr: "bordercolor=cx338AF");
			obj.line( style_attr: "bordercolor=cx338AFF", size:'0.8mm');
			obj.region(width:
				" 5 cm",x:"1.5cm", height:"2.2 cm",y:"1.5 cm", style_attr: "bordercolor=cx338AFF bordercolor=cx338AFF");
			obj.image(file : "&chemin.\logo_officiel.png" , overrides : " width=100pct ");
			obj.region(width:
				"8.8 cm",x:"7.5cm", height:"2.7 cm",y:"1.5 cm" ,style_attr: "bordercolor=cx338AFF");
			obj.format_text( data: "", overrides: " just=left color=cx95337 font_weight=bold font_size=5pt ");
			obj.format_text( data: "Les frais de l'assurance-vie du ", overrides: " just=left color=cx95337 font_weight=bold font_size=16pt ");
			obj.format_text( data: "", overrides: " just=left color=cx95337 font_weight=bold font_size=10pt ");
			obj.format_text( data:  "&Produit.", overrides: " just=left color=cx95337 font_weight=bold font_size=16pt ");
			obj.region(width:
				"18cm" ,height:"1 cm", x: "1.5cm", y:"3.4 cm", style_attr: "");
			obj.line(style_attr: "bordercolor=cx338AFF", size:'0.8mm');
			obj.region(width:
				"18cm" ,height:"20 cm", x: "1.5cm", y:"4.2 cm", style_attr: "");
			obj.format_text( data:  "Montant minimal de versement initial : &Montant_min_de_vers_init. ", overrides: "just=left color=cx95337 font_weight=normal font_size=12pt");
			obj.format_text( data:  "", overrides: " just=left color=cx95337 font_weight=normal font_size=12pt");
			obj.format_text( data:  "", overrides: " just=left color=cx95337 font_weight=normal font_size=12pt");
			obj.format_text( data:  "Dont taux de rétrocession de commission", overrides: "just=left color=cx95337 font_weight=normal style=italic font_size=12pt");
			obj.format_text( data:  "Dont taux de rétrocession de commission", overrides: "just=left color=cx95337 font_weight=normal style=italic font_size=12pt");
				run;

	%end;
%mend;

%fichiers_publipostage_pdf_accord;

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 888 views
  • 1 like
  • 2 in conversation