The SAS Output Delivery System and reporting techniques

ODF PDF/RTF Inline formatting with long lines causing problems

Reply
Contributor
Posts: 57

ODF PDF/RTF Inline formatting with long lines causing problems

[ Edited ]

I am trying to create a very basic report using inline formatting (I'm aware and know how to use proc report but I want to explore inline formatting since the end result will need to be more like a mail merge document with SAS than an actual report):

Here is my code:

options pagesize=max;
OPTIONS LINESIZE = 256;
options orientation=landscape;
ods pdf file="d:\old\test.pdf" startpage=never style=minimal ;
ods escapechar='^';

data testthis2;
file print;
set allfreq;
length x $2000;
call symput('n', table);
x=catt('^{style[font_face=Calibri font_weight=bold just=left font_size=12pt color=purple]', strip(column_value2), '}');
put x;
run;
  
ods pdf close;

When I run this code, the the document is produced, but if column_value2 exceeds a certain number of characters, including the inline formatting statements, its to "break" the output and instead of seeing my formatting, the long lins end up displaying the line format.  The shorter lines display fine with the formatting.  For example, one long line in my test dataset contains the text "The quick brown fox jumped over the lazy dogs" in the variable column_value2, but it displays as follows in the report:

^{style[font_face=Calibri font_weight=bold just=left font_size=12pt color=purple]The quick brown fox jumped over the lazy dogs}


Rather than the puple-formatted words "The quick brown fox jumped over the lazy dogs."

I'm fairly certain this may have something to do with the linesize or pagesize as after messing with these options, I was able to get more values form the variable to display correctly.  Any ideas who I can solve this or what is causing the problem?

Thanks.

 

Respected Advisor
Posts: 4,646

Re: ODF PDF/RTF Inline formatting with long lines causing problems

I ran this:

 

options pagesize=max;
OPTIONS LINESIZE = 256;
options orientation=landscape;
ods pdf file="&sasforum\reports\test pdf.pdf" startpage=never style=minimal ;
ods escapechar='^';

data _null_;
file print;
length x $2000;
column_value2 = "The quick brown fox jumped over the lazy dogs";
x=catt('^{style[font_face=Calibri font_weight=bold just=left font_size=12pt color=purple]', strip(column_value2), '}');
put x;
run;
  
ods pdf close;

and got the intended output file. I am using SAS version 9.4

PG
Ask a Question
Discussion stats
  • 1 reply
  • 123 views
  • 0 likes
  • 2 in conversation