diff --git a/matlab/reports/@report_series/writeSeriesForTable.m b/matlab/reports/@report_series/writeSeriesForTable.m index a0e78310d6bf06eddbee41b0577c8edb5cf55df7..edda0b0b131e6499c68354ffde8f48711e680702 100644 --- a/matlab/reports/@report_series/writeSeriesForTable.m +++ b/matlab/reports/@report_series/writeSeriesForTable.m @@ -1,5 +1,5 @@ -function o = writeSeriesForTable(o, fid, dates, precision) -%function o = writeSeriesForTable(o, fid, dates, precision) +function o = writeSeriesForTable(o, fid, dates, precision, ncols) +%function o = writeSeriesForTable(o, fid, dates, precision, ncols) % Write Table Row % % INPUTS @@ -7,6 +7,7 @@ function o = writeSeriesForTable(o, fid, dates, precision) % fid [int] file id % dates [dates] dates for report_series slice % precision [float] precision with which to print the data +% ncols [int] total number of columns in table % % % OUTPUTS @@ -69,6 +70,9 @@ if ~isempty(o.tableRowColor) end if ~isempty(o.tableSubSectionHeader) fprintf(fid, '%s', o.tableSubSectionHeader); + for i=1:ncols-1 + fprintf(fid, ' &'); + end fprintf(fid, '\\\\%%\n'); return; end diff --git a/matlab/reports/@report_table/writeTableFile.m b/matlab/reports/@report_table/writeTableFile.m index 5721583d872e13934f5d39db2cc46d3792c0a10b..575402ea1e37b86580f91d69b90488af1f0d1228 100644 --- a/matlab/reports/@report_table/writeTableFile.m +++ b/matlab/reports/@report_table/writeTableFile.m @@ -170,7 +170,7 @@ fprintf(fid, '%%\n'); % Write Report_Table Data for i=1:ne - o.series{i}.writeSeriesForTable(fid, o.range, o.precision); + o.series{i}.writeSeriesForTable(fid, o.range, o.precision, ncols); if o.showHlines fprintf(fid, '\\hline\n'); end diff --git a/tests/reporting/AnnualTable.m b/tests/reporting/AnnualTable.m index b29abd5ef81d47e3503ec45321eefafa8fcd6f45..fb78267f2f37fe3342e4a78f3ddd4e01f16946cc 100644 --- a/tests/reporting/AnnualTable.m +++ b/tests/reporting/AnnualTable.m @@ -20,6 +20,8 @@ shortNames = {'US', 'EU', 'JA', 'EA6', 'LA6', 'RC6'}; longNames = {'Coca Cola', 'Kinder Bueno', 'Pizza', ... 'Vegetarianism Is Good', 'OS X', 'Dothraki'}; +rep = rep.addSeries('tableSubSectionHeader', 'A group', ... + 'tableRowColor', 'red!22'); for i=1:length(shortNames) db_a = db_a.tex_rename([seriesRootName shortNames{i}], longNames{i}); rep = rep.addSeries('data', db_a{[seriesRootName shortNames{i}]});