1. For Total row, I made a simple but this works, I tried to limit my row number and show the issue. If you look at the picture, you see the Total (red rectangle) = SUM of some above and another cell (black rectangle).
And the code:
select 'dbr.title', 'REPORT by DAY: 2014-07-31';
select 'dbr.crosstab.col', 'Mon 28/07';
select 'dbr.crosstab.col', 'Tue 29/07';
select 'dbr.crosstab.col', 'Wed 30/07';
select 'dbr.crosstab.col', 'Thu 31/07';
select 'dbr.column.filter', 'Company', 'select';
select 'dbr.column.filter', 'BU', 'select';
select 'dbr.column.filter', 'Center', 'select';
select 'dbr.column.filter', 'Dept', 'select';
select 'dbr.hidecolumn', 'Center', 'Dept';
select 'dbr.hdr', 'Company';
select 'dbr.summary.text', 'Company', 'Total';
select 'dbr.crosstab', 'WDate', 'Sale';
select 'dbr.crosstab.title', 'Total';
select 'dbr.sum', 'Sale', 'Week_Sales', 'Month_Sales', 'Week_GP', 'Month_GP', 'Week_Target', 'Month_Target';
select 'dbr.summary.options', 'skip_single_line_summary';
select 'dbr.hidecolumn', 'Wcolor', 'Mcolor', 'WeekDate';
select 'dbr.calc', 'target_week_percent', '([Week_Sales]/[Week_Target]*100)';
select 'dbr.calc', 'gp_week_percent', '([Week_GP]/[Week_Sales]*100)';
select 'dbr.calc', 'target_month_percent', '([Month_Sales]/[Month_Target]*100)';
select 'dbr.calc', 'gp_month_percent', '([Month_GP]/[Month_Sales]*100)';
select 'dbr.calc', 'week_diff', '([Week_Sales]-[Week_Target])';
select 'dbr.calc', 'month_diff', '([Month_Sales]-[Month_Target])';
select 'dbr.column.title', 'target_week_percent', '%Target';
select 'dbr.column.title', 'target_month_percent', '%Target';
select 'dbr.column.title', 'gp_week_percent', '%GP';
select 'dbr.column.title', 'gp_month_percent', '%GP';
select 'dbr.column.title', 'week_diff', 'Diff';
select 'dbr.column.title', 'month_diff', 'Diff';
select 'dbr.footerstyle', 'background-color: #F7F2E0;font-weight: normal;color:#0101DF;';
select 'dbr.colstyle', 'Week_Target', '[background-color: #CCEEFF;font-weight: bold;]%.0f';
select 'dbr.colstyle', 'Month_Target', '[background-color: #CCEEFF;font-weight: bold;]%.0f';
select 'dbr.colstyle', 'Week_Sales', '[background-color: yellow;font-weight: bold;] %.0f';
select 'dbr.colstyle', 'Month_Sales', '[background-color: yellow;font-weight: bold;] %.0f';
select 'dbr.colstyle', 'Week_GP', '[color: green]%.0f; ;[color: red;]%.0f';
select 'dbr.colstyle', 'Month_GP', '[color: green]%.0f; ;[color: red;]%.0f';
select 'dbr.colstyle', 'gp_week_percent', '[color: green]%.2f; ;[color: red;]%.2f';
select 'dbr.colstyle', 'gp_month_percent', '[color: green]%.2f; ;[color: red;]%.2f';
select 'dbr.colstyle', 'week_diff', '[color: green]%.0f; ;[color: red;]%.0f';
select 'dbr.colstyle', 'month_diff', '[color: green]%.0f; ;[color: red;]%.0f';
select 'dbr.cellclass', 'target_week_percent', '[Wcolor]';
select 'dbr.cellclass', 'target_month_percent', '[Mcolor]';
select 'dbr.colstyle', 'Sale', '%.0f';
select 'F1' as 'Company[Company]', 'L1' as 'BU[BU]', '' as 'Center[Center]', '' as 'Dept[Dept]', 'Mon 28/07' as 'Date[WDate]', cast('2014-07-28' as date) as 'W[WeekDate]', 2977.171800 as '[Sale]', 60191.758400 as 'Sales[Week_Sales]', 14712.903300 as 'Target[Week_Target]', null as 'week_diff', null as 'target_week_percent', -4118.393300 as 'GP[Week_GP]', null as 'gp_week_percent', 12752.909100 as 'Sales[Month_Sales]', 53560.000000 as 'Target[Month_Target]', null as 'month_diff', null as 'target_month_percent', -4118.393300 as 'GP[Month_GP]', null as 'gp_month_percent', 'text_green' as '[Wcolor]', 'text_red' as '[Mcolor]'
union all
select 'F1', 'L1', '', '', 'Thu 31/07', cast('2014-07-31' as date), 2914.951100, 60191.758400, 14712.903300, null, null, -4118.393300, null, 12752.909100, 53560.000000, null, null, -4118.393300, null, 'text_green', 'text_red'
union all
select 'F1', 'L1', '', '', 'Tue 29/07', cast('2014-07-29' as date), 1576.298700, 60191.758400, 14712.903300, null, null, -4118.393300, null, 12752.909100, 53560.000000, null, null, -4118.393300, null, 'text_green', 'text_red'
union all
select 'F1', 'L1', '', '', 'Wed 30/07', cast('2014-07-30' as date), 5284.487600, 60191.758400, 14712.903300, null, null, -4118.393300, null, 12752.909100, 53560.000000, null, null, -4118.393300, null, 'text_green', 'text_red'
union all
select 'HO', 'Others', '', '', null, null, null, null, 24885.592200, null, null, null, null, null, 20052.622200, null, null, null, null, 'text_red', 'text_red'
union all
select 'M1', 'M1', '', '', null, null, null, 16931.224600, 3525.806400, null, null, 16931.224600, null, null, 14800.000000, null, null, 16931.224600, null, 'text_green', 'text_red'
union all
select 'Internal', 'F1', '', '', null, null, null, -11.872000, null, null, null, 0.015600, null, null, null, null, null, 0.015600, null, 'text_red', 'text_red'
union all
select 'Internal', 'F2', '', '', 'Thu 31/07', cast('2014-07-31' as date), -949.872700, -13195.606600, null, null, null, 338.956300, null, -1286.745500, null, null, null, 338.956300, null, 'text_red', 'text_red'
union all
select 'Internal', 'F2', '', '', 'Tue 29/07', cast('2014-07-29' as date), -336.872800, -13195.606600, null, null, null, 338.956300, null, -1286.745500, null, null, null, 338.956300, null, 'text_red', 'text_red'
union all
select 'Internal', 'F3', '', '', 'Mon 28/07', cast('2014-07-28' as date), -108.250000, -674.611500, null, null, null, -668.461200, null, -530.361500, null, null, null, -668.461200, null, 'text_red', 'text_red'
union all
select 'Internal', 'F3', '', '', 'Thu 31/07', cast('2014-07-31' as date), -422.111500, -674.611500, null, null, null, -668.461200, null, -530.361500, null, null, null, -668.461200, null, 'text_red', 'text_red';
2. I create a dbr.purehtml and put some buttons into a table to make they look like a grid.
select 'dbr.purehtml', '<table class="wrapper_table" style="width: 100%;"><tr><td align="center">';
select 'dbr.report', 'sp_DBR_INV_Item_Details', 'new_window', 'inDate=(inDate)', 'inStatus=(inStatus)';
select 'dbr.button', 'Over 120 Days';
select '1';
select 'dbr.purehtml', '</td><td align="center">';
-- another button
select 'dbr.purehtml', '</td></tr></table>';
3. I'll appreciate very much if it becomes and option or easy configuration.
Thanks,