DATA Step, Macro, Functions and more

obj.format_cell

Reply
Regular Contributor
Posts: 199

obj.format_cell

When the user clicks on "Click here for updates" I would like a new window to open up to www.sas.com.
The table looks correct, however, no link is being created.
Thank you.

data _null_;
dcl odsout obj();
obj.table_start(name: "Stock",
overrides: "width=80pct");
obj.row_start();
obj.format_cell(data: "News",
column_span: 2,
overrides: "backgroundcolor=BIGB color=white font_size=14pt font_weight=bold");
obj.row_end();
obj.row_start();
obj.format_cell(data: "Data released",
overrides: "just=left font_weight=bold color=GRB");
obj.format_cell(data: "5/07/2010",
overrides: "just=left font_weight=bold color=black");
obj.row_end();
obj.row_start();
obj.format_cell(data: "Planned data release date",
overrides: "just=left font_weight=bold color=GRB");
obj.format_cell(data: "6/07/2010",
overrides: "just=left font_weight=bold color=black");
obj.row_end();
obj.row_start();
obj.format_cell(data: "Click here for Updates",
file: "http://www.sas.com",
overrides: "just=left font_weight=bold color=GRB");
obj.format_cell(data: "6/07/2010",
overrides: "just=left font_weight=bold color=black");
obj.row_end();
run;
SAS Super FREQ
Posts: 8,866

Re: obj.format_cell

Hi:
Well, if you were doing the report in PROC REPORT, the style override would be:
[pre]
style(header)={url='http://www.sas.com' foreground=purple background=pink}
[/pre]

However, I'm not sure that URL= will work with these data step objects, though. If you CAN use FILE: as the right argument, for setting a cell URL, I'm not sure that it will work with the FORMAT_CELL method.

You might also want to check in the pre-production documentation. The pre-production documentation is here:
http://support.sas.com/rnd/base/datastep/dsobject/Power_to_show_documentation.pdf

In the documentation, I also note that there is an OBJECT.HREF method as shown here:
[pre]
obj.href(data: “SAS Home page”,
file: “http://www.sas.com/index.html”);
[/pre]

So, it seems like your FILE: might be OK if you used a different method than OBJ.FORMAT_CELL

Since the ODS DATA step object is still pre-production, you might want to check with Tech Support on this question. If they don't know the answer, they can work with the developers to get you the answer.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 150 views
  • 0 likes
  • 2 in conversation