BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jowinniejo
Calcite | Level 5

Hi All,

 

I need to generate a all text report using ods layout and ods text and I have a paragraph that needs to be justified on both sides. I tried 'just' option in inline formatting but I still can't get the exact output.

 

The desired output will be: 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbbbbbbbbbbbbb

aaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbb

baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaffffbnnnn

 

But the current output is:

 

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzfsssssssssssssssf

afaaaaaaaaaaaaaaaaaefbbbbbbbbbbbbbbtrrrrrrrrrrrrrrrrrrrrrrr

berrrrrrrrrrrrrrrrehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhnmm

 

Any thoughts is appreciated.

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  You want "FULL" justification where the text is justified on both sides. However, if you look in the documentation for SAS Style capabilities: https://go.documentation.sas.com/?docsetId=odsug&docsetTarget=p0xi2cygmfk0wkn1ei625zq5r488.htm&docse... you'll see that JUST= or TEXTALIGN= only has Left, Right, Center or Dec.

 

  Here's the screen shot from the doc:

textalign.png

 

  So the best you can do is to post-process the text to change the justification in Word after the initial creation.

 

Cynthia

View solution in original post

8 REPLIES 8
ballardw
Super User

Code you are attempting. Some actual data of what is being written.

 

And describe what justification as it really is not exactly clear to me.

jowinniejo
Calcite | Level 5

I attached a photo below to explain the current and desired output. Hopefully this would make sense. The current output is left justified by default and the desired output is justified on both sides.

 

The code I used is:

ods escapechar="^";

ods pdf file="….\test.pdf" ;

ods layout start X=0in y=0in ;

ods region x=0.8in y=1.3in;

ods text="^{style[fontsize=12pt font_face='Arial'] text here.}";

ods layout end;

ods pdf close;

 

 

output.JPG

Cynthia_sas
SAS Super FREQ

Hi:

  You want "FULL" justification where the text is justified on both sides. However, if you look in the documentation for SAS Style capabilities: https://go.documentation.sas.com/?docsetId=odsug&docsetTarget=p0xi2cygmfk0wkn1ei625zq5r488.htm&docse... you'll see that JUST= or TEXTALIGN= only has Left, Right, Center or Dec.

 

  Here's the screen shot from the doc:

textalign.png

 

  So the best you can do is to post-process the text to change the justification in Word after the initial creation.

 

Cynthia

jowinniejo
Calcite | Level 5

Thank you Cynthia!

ballardw
Super User

You may be able to use the escapechar RAW option to insert raw PDF tags to start and end justification but you'll have to dig through the PDF documentation to find them.

Cynthia_sas
SAS Super FREQ

He'd have to insert RAW tags into RTF or HTML and then make the PDF file from the RTF or HTML output.

 

The RAW escapechar function is not supported for PDF as shown in the doc: https://go.documentation.sas.com/?docsetId=odsug&docsetTarget=p11xia2ltavr8ln17srq8vn4rnqc.htm&docse...

raw_doc.png

 

Cynthia

ballardw
Super User

@Cynthia_sas wrote:

He'd have to insert RAW tags into RTF or HTML and then make the PDF file from the RTF or HTML output.

 

The RAW escapechar function is not supported for PDF as shown in the doc: https://go.documentation.sas.com/?docsetId=odsug&docsetTarget=p11xia2ltavr8ln17srq8vn4rnqc.htm&docse...

raw_doc.png

 

Cynthia


Thanks @Cynthia_sas . My online help is throwing network errors today. I thought that might be the case but got sidetracked to figure out why my help isn't working.

jowinniejo
Calcite | Level 5

Thank you for your help!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 8 replies
  • 5477 views
  • 0 likes
  • 3 in conversation