BookmarkSubscribeRSS Feed
DonH
Lapis Lazuli | Level 10
This is an ODS (SAS 9.2) question that is specific to the Stored Process server but am asking it here since it is more about ODS that BI/EBI.

I have a set of stored processes that stream HTML back to the user's browser, but also create pdf and rtf versions of the reports that are available via the replay program.

I want to use the preimage style attribute to insert an image into title line 1. However for the HTML destination the name/path for the image has to be the web accessible path on the web server to the image since ODS is generating an img tag. However for the PDF and RTF destinations, the name/path for the image has to be the physical location on the SAS Compute Server.

I can put the images on both servers, but I don't see how to specify different values in a single title statement. Someone told me that inline formatting in 9.2 might be able to do this.

Any/all input/help/advice is appreciated.
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi, Don:
We showed destination-specific syntax similar to this in the ODS: The Basics and Beyond book:
[pre]
ods html path='.'(url=none)
file='kermitrocks2.html' style=sasweb;
ods rtf file='bigbirdrocks2.rtf';

title '^{DEST [HTML] ^{style Kermit the Frog Rocks }}'
'^{DEST [RTF] ^{style[fontsize=20pt]Big Bird Rocks }}';

proc print data=sashelp.class(obs=3);
run;

ods _all_ close;
[/pre]

And, when you run this...the HTML file title has Kermit rocking in purple and the RTF file has Big Bird rocking in 20pt.

But, when I try this
[pre]
ods html path='.'(url=none)
file='kermitrocks3.html' style=sasweb;
ods tagsets.rtf file='bigbirdrocks3_new.rtf';
ods rtf file='bigbirdrocks3_orig.rtf';

title '^{DEST [HTML] ^{style[preimage="kermit2.jpg"] Kermit the Frog Rocks }}'
'^{DEST [RTF] ^{style[preimage="c:\temp\bigbird.jpg"] Big Bird Rocks }}';

proc print data=sashelp.class(obs=3);
run;

ods _all_ close;
[/pre]

I only get Kermit's picture in the HTML file. The image for Big Bird is not showing up in the "original" RTF file. However, in 9.2, I do get Big Bird's picture showing in the TAGSETS.RTF output file.

So you (sort of) have a solution for HTML and RTF if you use TAGSETS.RTF.

I ran out of Sesame Street characters to test with... but the new style syntax did not work for me for PDF, although the old style syntax did work for PDF.
[pre]
ods pdf file='bigbirdrocks_oldstyle.pdf';

title '^S={preimage="c:\temp\bigbird.jpg"} Big Bird Rocks';

proc print data=sashelp.class(obs=3);
run;

ods _all_ close;

[/pre]

I think that's because I remember something about {DEST} only working for markup destinations (like RTF and HTML). Even though this note:
http://support.sas.com/kb/37/077.html implies that the capability will work for PDF, the example they show in the full code tab only shows HTML and RTF.

You might want to check with Tech Support on this. I'm wondering whether there's a CSS way to specify the image or some other workaround. I suppose that having 3 separate invocations with 3 separate TITLE statements isn't going to work for your program design???

cynthia
DonH
Lapis Lazuli | Level 10
Thanks Cynthia.

I get different results that you did. For me (in 9.2), ods rtf seems to work and ods tagsets.rtf does not.

And if I try PDF, it includes the text for all three in the title.

I will ask TS to comment on/update the KB article to include a working example for 9.2 that includes rtf, pdf and html.
Cynthia_sas
SAS Super FREQ
Hi, Don:
Very odd, indeed. I was also running SAS 9.2 -- non-Platform. See my log. And, I realized that I never put a DEST[tagsets,rtf] in my code and I still -do- get big bird's pix in the TAGSETS.RTF file. But, when I use THIS title statement:
[pre]

title '^{DEST [HTML] ^{style[preimage="kermit2.jpg"] Kermit the Frog Rocks }}'
'^{DEST [RTF] ^{style[preimage="c:\temp\bigbird.jpg"] Big Bird Rocks }}'
'^{DEST [TAGSETS.RTF] ^{style[preimage="c:\temp\mackintosh_rose.jpg"] Big Bird Rocks }}'
;
[/pre]

Then I -do- get the mackintosh_rose pix in the TAGSETS.RTF file (and still nothing in the ODS RTF file). I wonder whether there's some difference in what you have on your server???? Or, I wonder whether your &_ODSDEST is somehow being changed???

cynthia
[pre]
1725 ods html path='.'(url=none)
1726 file='kermitrocks3.html' style=sasweb;
NOTE: Writing HTML Body file: kermitrocks3.html
1727 ods tagsets.rtf file='bigbirdrocks3_new.rtf';
NOTE: Writing TAGSETS.RTF Body file: bigbirdrocks3_new.rtf
1728 ods rtf file='bigbirdrocks3_orig.rtf';
NOTE: Writing RTF Body file: bigbirdrocks3_orig.rtf
1729
1730 %put -- my version is: &sysvlong4;
-- my version is: 9.02.02M2P09012009
1731
1732 title '^{DEST [HTML] ^{style[preimage="kermit2.jpg"] Kermit the Frog Rocks }}'
1733 '^{DEST [RTF] ^{style[preimage="c:\temp\bigbird.jpg"] Big Bird Rocks }}';
1734
1735 proc print data=sashelp.class(obs=3);
1736 run;

NOTE: PROCEDURE PRINT used (Total process time):
real time 2.53 seconds
cpu time 0.07 seconds

NOTE: There were 3 observations read from the data set SASHELP.CLASS.

1737
1738 ods _all_ close;

[/pre]

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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