CORE-POS/IS4C — pull request #336 by flathat (2014-04-16 06:38:37+00:00)
Title: FannieReportPage header counter

This should be the only commit involved in this request and if it isn't I hope you can restrict changes in upstream master to this if you accept them.
6f6d15b7164b1de2156c09430bb8a0e6913f8290

This began as an addition of a separate index/counter for when $report_headers is two dimensional, replacing the re-purposing of $multi_counter. I also changed some other things, mostly to make the html, csv and xls outputs, especially numbers in them, more consistent or suitable for the type of report.

I will later commit a version of StoreSummaryReport.php (based on StoreSummaryReportAlt.php) that extends this and obsoletes, and removes, FannieReportPage2.php.

The original commit message is below:

1. $header_index for pointing to two-dimensional $report_headers
instead of using $multi_count
I've initialized this for each report in multi-report mode but
don't have a report that uses both multiple header sets and multiple
reports to test it with.

2. Put out $report_description as-is if it is in HTML tags,
otherwise prefix HTML line-break as before.

3. assign_headers() as a placeholder for $report_headers assignment in
multi-report-mode as alternative to doing it in calculate_footers()
I've re-coded GeneralDayReport.php to test this, but don't plan
to commit that version.

4. Increment $multi-counter for xls multi-reports

5. Use strip_tags() on csv and xls report bodies.

6. Right-alignment of numbers a bit more robust:
o embedded commas OK
o spaces after leading $
o spaces before trailing %
uses preg_match, with exhaustive notes.
On a page with 1,000 rows with 7 uses of preg_match in each row
preg_match was 7/1000 sec faster than the less-robust string
operations.

7. Remove $,%,',' from xls numbers

8. Improve xls header handling

9. Moved un-formatting for csv into excelFormat().
Also used on xls, but not certain this is wanted.

10. In drawPage() restricted output of JS and CSS extras to HTML reports.