Opened 12 years ago

Closed 12 years ago

#458 closed enhancement (fixed)

Sample count report should be refactored to use week codes with leading 0

Reported by: olle Owned by: olle
Priority: minor Milestone: Reggie v2.11
Component: net.sf.basedb.reggie Keywords:
Cc:

Description

Sample count report should be refactored to use week codes with leading 0, i.e. '01', '02', ... '09', '10', '11', instead of '1', '2', ... '9', '10', '11', since the former allows sorting, where the result for strings is identical to the one for numbers.

Caution: Leading zeroes may cause problems when parsing strings in some programming languages like JavaScript, where the values by default will be treated as octal numbers, producing the expected results for all values except '08' and '09', which are undefined.

Change History (4)

comment:1 by olle, 12 years ago

Status: newassigned

Ticket accepted.

comment:2 by olle, 12 years ago

Traceability note:

  • The report generator was introduced in Ticket #339 (Report generator). It included a sample count report.
  • The sample count report was updated in Ticket #419 (Allow user to select resolution in sample count report), Ticket #420 (Sample count report should have two columns for summed data), and Ticket #421 (Sample count report does not always handle all views correctly).

comment:3 by olle, 12 years ago

Design update:

  1. JSP script samplereportgenerator in reggie/resources/ should be updated in functions addDataRowsToTable(report, reportTable) snd createSortedPeriodArray(report, numberOfColumns) to add a leading zero to the week code if needed.
  2. Servlet SampleReportServlet in reggie/src/net/sf/basedb/reggie/servlet/ should be updated in private method String getCurrentPeriod(Date currentDate, String viewType) to add a leading zero to the week code if needed.

comment:4 by olle, 12 years ago

Resolution: fixed
Status: assignedclosed

(In [1812]) Fixes #458. Sample count report has been refactored to use week codes with leading 0 internally (no change should be visible in created report).

Note: See TracTickets for help on using tickets.