Hi! .o/
I'm implementing some changes into an existing report that I currently produce.
The report is produced weekly and reports data down to customer level. If a customer was not on the report last week it should appear in the colour red, if it was removed from the report 14 days ago (or less) and has reappeared again it will appear in orange. All other entries should appear in a black test.
I was fine at this point and with the report being in HTML I simpily built up the HTML output in the datasteps before calling using the ODS statements.
However the guy in the business who is using the report would like the data to have different coloured cell backgrounds and not change the colour of the text.
I've tried using compute after to change the background colour of the cells with each change in the account number, but this doesn't work for me. The code is:
When I run this I get the following warning:
Now the report uses the fault totals as the grouping variables. This is for the output purposes to make the report easier to read. So I can't really change the order by and group by variables.
I suppose my straight forward question is can compute after be used with a keyword that basically says process the code block after each row produced? If not any suggestions?
Many thanks.
I'm implementing some changes into an existing report that I currently produce.
The report is produced weekly and reports data down to customer level. If a customer was not on the report last week it should appear in the colour red, if it was removed from the report 14 days ago (or less) and has reappeared again it will appear in orange. All other entries should appear in a black test.
I was fine at this point and with the report being in HTML I simpily built up the HTML output in the datasteps before calling using the ODS statements.
However the guy in the business who is using the report would like the data to have different coloured cell backgrounds and not change the colour of the text.
I've tried using compute after to change the background colour of the cells with each change in the account number, but this doesn't work for me. The code is:
Code:
ods html file="t:\james\reports\sas\format_test.html";
proc report data=rwork.plus_3_trucks_detail nowd;
columns total_faults total_trucks account_no account_name
address html_detail;
define total_faults / group descending 'Total Faults';
define total_trucks / group descending 'Number of Truck Rolls';
define account_no / display 'Account Number';
define account_name / display 'Account Name';
define address / display 'Address';
define html_detail / display 'Link to Details';
compute after account_no;
if out_type='New' then
call define('_col_','style','style=(background=red foreground=white)');
if out_type='Back' then
call define('_col_','style','style=(background=grey foreground=white)');
if out_type='Norm' then
call define('_col_','style','style=(background=white foreground=black)');
endcomp;
run;
ods html close;
When I run this I get the following warning:
Code:
ERROR: You can only BREAK on GROUPing and ORDERing variables.
NOTE: Groups are not created because the usage of account_no is DISPLAY.
NOTE: There were 204 observations read from the data set RWORK.PLUS_3_TRUCKS_DETAIL.
NOTE: PROCEDURE REPORT used:
real time 0.57 seconds
cpu time 0.07 seconds
Now the report uses the fault totals as the grouping variables. This is for the output purposes to make the report easier to read. So I can't really change the order by and group by variables.
I suppose my straight forward question is can compute after be used with a keyword that basically says process the code block after each row produced? If not any suggestions?
Many thanks.