The SAS Output Delivery System and reporting techniques

how to insert custom contents in HTMLPANEL markup

Reply
N/A
Posts: 0

how to insert custom contents in HTMLPANEL markup

Hi,

I am using the HTMLPANEL markup and i would like to populate one of the cells with a simple put statement (not with a proc).

Here is my idea :
ods tagsets.htmlpanel event=row_panel(start);
ods tagsets.htmlpanel event=column_panel(start);

data _null_ ;
file print ;
put "" ;
run;


goptions xpixels=240 ypixels=240;
proc gchart data=sashelp.class;
pie age / sumvar=weight;
run;
quit;

ods tagsets.htmlpanel event=column_panel(finish);

it works but the data _null_ generate an ugly formated cell ... is there a way to prevent it ?

BR,

Greg
SAS Super FREQ
Posts: 939

Re: how to insert custom contents in HTMLPANEL markup

Posted in reply to deleted_user
The contents of the PUT statement appear as an icon in the post. Were you trying to put string data into the cell?

Thanks!
DanH
SAS Super FREQ
Posts: 8,863

Re: how to insert custom contents in HTMLPANEL markup

Posted in reply to deleted_user
Hi:
Do you want to just write text with your PUT statement. There are 2 different ways to write text so that it doesn't look "ugly" -- what you're seeing is the "batch" form of output when you use the "older" FILE PRINT insstead of the "newer" FILE PRINT ODS. The two methods are:
-- use FILE PRINT ODS (which puts the text into a table)
-- create a SAS dataset with your TEXT and then use PROC REPORT or PROC PRINT and turn off the interior table lines with STYLE overrides

There is a third method, but it involves using the experimental interface between the Data Step and ODS and is described here:
http://www2.sas.com/proceedings/sugi28/022-28.pdf
http://support.sas.com/rnd/base/datastep/dsobject/

At any rate, the program below illustrates the first two methods with HTMLPANEL.

cynthia
[pre]
ODS tagsets.htmlpanel nogtitle style=sasweb
path='c:\temp\' (url=none)
body="Jabberwocky.html"
options( panelcolumns='2' doc='help'
panelborder='2'
panelrows='2'
embedded_titles='Yes'
bylabels='no');

ods escapechar='^';

ODS tagsets.htmlpanel event=row_panel(start);

goptions device=actximg;

proc gchart data=sashelp.shoes;
where region in ('Asia', 'Canada', 'Pacific');
title 'Casual Shoes';
where also product contains 'Casual';
vbar region / sumvar=sales type=mean name='csl';
run;
quit;
run;

title 'Comment';
data _null_;
length Jabberwocky $1000;
file print ods;
Jabberwocky = 'Twas brillig and the slithy toves';
put _ods_;
Jabberwocky = 'Did gyre and gimble in the wabe';
put _ods_;
Jabberwocky = 'All mimsy were the borogroves';
put _ods_;
Jabberwocky = 'And the mome raths outgrabe';
put _ods_;
Jabberwocky = '--- by Lewis Carroll';
put _ods_;
run;

ODS tagsets.htmlpanel event=row_panel(finish);

ODS tagsets.htmlpanel event=row_panel(start);


proc gchart data=sashelp.shoes;
where region in ('Asia', 'Canada', 'Pacific');
title 'Shoes for Women';
where also product contains 'Women';
vbar region / sumvar=sales type=mean name='fem';
run;
quit;
run;


data Jabber;
length Jabberwocky $1000;
Jabberwocky = 'Twas brillig and the slithy toves';
lineord = 1; output;
Jabberwocky = 'Did gyre and gimble in the wabe';
lineord = 2; output;
Jabberwocky = 'All mimsy were the borogroves';
lineord = 3; output;
Jabberwocky = 'And the mome raths outgrabe';
lineord = 4; output;
Jabberwocky = '--- by Lewis Carroll';
lineord = 5; output;
Jabberwocky = ' ';
lineord = 6; output;
Jabberwocky = 'Really, the most sensible ^n shoes for people ^n are shoes with '||
'very good ^n arch support ^n and sturdy heels. More stuff. More stuff. '||
'more and more and more. Twinkle twinkle little star. Supercalifragilisticexpealidocious '||
'is a favorite word of my favorite nanny.';
lineord=7; output;
run;

proc report data=Jabber nowd noheader
style(report)={rules=none frame=void cellspacing=0 cellpadding=0};
title 'Jabberwocky';
column lineord Jabberwocky;
define lineord / order noprint;
define Jabberwocky / style(column)={just=left font_weight=bold} ;
run;

ODS tagsets.htmlpanel event=row_panel(finish);

ODS tagsets.htmlpanel close;

[/pre]
Ask a Question
Discussion stats
  • 2 replies
  • 182 views
  • 0 likes
  • 3 in conversation