- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
I'm sending an automatic email using SAS with ODS html where I add the text using proc odstext.
In the email I'm trying to insert an indented paragraph, however without any success. Here's a sample of what I have:
proc odstext;
p "<font face='Arial' size='2'>What I have. </font>';
run;
Result: What I have.
proc odstext;
p "<font face='Arial' size='2' Ind = "1.25cm" >What I want. </font>';
run;
Expected result: What I want. (with 1.25 cm indentation)
The code above with ind option does not return errors but it also doesn't indent the paragraph. Is it possible to indent paragraphs here?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is IND= a valid HTML style, or are you making up syntax as you go?
Something like style='margin:1.25cm' should work.
Also your quotes are wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Chris.
Thank you for your answer.
I'm making up the syntax, but as I said it runs without errors but also it doesn't indent.
Tried with your suggestion and it's not indenting. I've tried with the following syntax:
proc odstext;
p "<font face='Arial' size='2' style="margin:1.25cm">What I want. </font>';
run;
Don't know if it is the correct syntax.
The quotes are ok, you can start with "" and then use '' in the parameters or start with '' and use "" in the parameters.
Thanks,
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can you please share the code you used?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
1. Do not make up and invent syntax, that's bonkers. Read the documentation
2. Your quotes are unbalanced
3. This works:
proc odstext;
p "<font face='Arial' size='2'>What I have. </font>";
p "<font face='Arial' size='2' style='margin:1.25cm; color:red'>What I have. </font>";
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
I just made the code to give clues about what I was looking for.
Anyway, using the code you shared and using also the color option, the indentation is still not working however the color works. Don't know why this happens.
I'm using the proc odstext inside a macro, maybe that's why it's not working.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
As illustrated in the posted example, the code DOES work to do an indent. The question is when you use the code, where does it NOT work. Have you tested the code as standalone ODS HTML code without using email? Does it work there? When you test it using email, does it work there when the email is opened? Do you have errors in the log? How are you sending the mail - -with the HTML in the body of the mail text or with the HTML file as an attachment. In my experience, sometimes HTML is prohibited by mail systems and formatting and links can be lost. I seriously doubt it is your macro program that is causing the issues, but you have not provided any concrete examples. I recommend trying the simplest example without macro and to a standalone HTML file without email and see whether that works for you. Then go forward from there.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The macro language is mostly a text generator, so I doubt that's the reason. On top of all of @Cynthia_sas 's recommendations (especially: to isolate a problem, start small, and add the required features until the issue is triggered), I'd advise you to look at your quotes, since you were convinced they were balanced. Also examine your log report carefully.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
Thank you both for your answers.
What I meant is that the code is not working for my purpose, that doesn't mean that is not working as a stand alone. As I also said, I tried to use the color option and it worked just fine in the email.
The email is being sent correctly, there are no errors while running or in the log and the quotes are ok, maybe they're not ok when I created the piece of code to exemplify here. If I use the code sent by Chris it writes the paragraph in red however is not intending. But the indentation is just a small detail in the email, the process is running and the email is being sent, it is just a matter of looking better.
I really appreciate your thoughts and time spent in this topic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The HTML generated is the same when using the HTML destination, regardless of whether the body is a file or an email :
<div class="l paragraph"><font face="Arial" size="2">What I have. </font></div>
<div class="l paragraph"><font face="Arial" size="2" style="margin:1.25cm; color:red">What I have. </font></div>
So it looks like Outlook is a defective HTML renderer, which will surprise ... no one.
You need to search which parts of HTML (CSS really) Outlook renders correctly, or if worse comes to worse you can also always add non-breaking spaces.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Chris.
I'll take a look.