The SAS Output Delivery System and reporting techniques

ODS HTML Report Outlook

Accepted Solution Solved
Reply
Contributor
Posts: 70
Accepted Solution

ODS HTML Report Outlook

[ Edited ]

Hello everyone. 

I'm looking to get a report from a dataset to have alternating row colors. 
Which would be the best to go with ? 

HTML

msoffice2k

odsTagsetsTableEditor

 


Filename output email to="jonathan@.com"
content_type="text/html"
subject="DataSet Report" Attach="/data/ETL_work/DATA_DEV/Reports/&dataset..xls";;
ods html3 file=output style=HTMLblue;
*ods msoffice2k file=output style=HTMLblue*/
/*metatext='name="viewport" content="width="device-width"'*/
/*options(pagebreak="no" );*/
*ods tagsets.Tableeditor file=output options(format_email='yes'
pagebreak="no")
style=HTMLblue;
title1 "&dataset Report";
proc odstext;
list;
item "Profile Summary for &dataset";
item "For Date of &sysdate";
item "For All &DqzDateVerTime";
end;
run;
/*proc print data=sashelp.orsales;*/
/*var Year Product_Line Product_Group Quantity Profit;*/
/*run;*/

 

proc print data=DataReport;
run;
/*ODS tagsets.excelxp close;*/

ods _all_ close;

 

 

 

I tried using this with each of the tagsets. 

Continuing to research but wondering if I'm headed in the right direction. 


Accepted Solutions
Solution
‎10-29-2015 05:12 PM
Super Contributor
Posts: 394

Re: ODS HTML Report Outlook

I think you're asking the wrong question. Alternating row colors isn't a function of the destination. You can get alternating row colors with any stylable destination. Here's how to create an HTML report with alternating row colors. If you want the report in ExcelXP format, simply substitute tagsets.excelxp for html in the ODS statement.

 

/*
 *  Assign alternating colors to the rows of a report
 */
ods html file="altcolor.html";
ods listing close;

proc report nowd data=sashelp.class
        style(header)=[background=#f0f0f0 foreground=black vjust=bottom];
    col name sex age height weight;
    define name--weight / display;
compute name;
    bg + 1;
    if mod(bg, 2) = 1 then
        call define(_row_, "style", "style={background=white}");
    else
        call define(_row_, "style", "style={background=#d1e9d1}");
endcomp;
run;

ods listing;
ods html close;

View solution in original post


All Replies
Solution
‎10-29-2015 05:12 PM
Super Contributor
Posts: 394

Re: ODS HTML Report Outlook

I think you're asking the wrong question. Alternating row colors isn't a function of the destination. You can get alternating row colors with any stylable destination. Here's how to create an HTML report with alternating row colors. If you want the report in ExcelXP format, simply substitute tagsets.excelxp for html in the ODS statement.

 

/*
 *  Assign alternating colors to the rows of a report
 */
ods html file="altcolor.html";
ods listing close;

proc report nowd data=sashelp.class
        style(header)=[background=#f0f0f0 foreground=black vjust=bottom];
    col name sex age height weight;
    define name--weight / display;
compute name;
    bg + 1;
    if mod(bg, 2) = 1 then
        call define(_row_, "style", "style={background=white}");
    else
        call define(_row_, "style", "style={background=#d1e9d1}");
endcomp;
run;

ods listing;
ods html close;
Contributor
Posts: 70

Re: ODS HTML Report Outlook

I just resolved. 

Thank you Tim this worked great much appreciated.

Post a Question
Discussion Stats
  • 2 replies
  • 406 views
  • 1 like
  • 2 in conversation