@Override
  public void initializeReport(BaseActionForm dynaForm) {
    super.initializeReport();
    errorFound = false;

    lowerDateRange = dynaForm.getString("lowerDateRange");
    upperDateRange = dynaForm.getString("upperDateRange");

    if (GenericValidator.isBlankOrNull(lowerDateRange)) {
      errorFound = true;
      ErrorMessages msgs = new ErrorMessages();
      msgs.setMsgLine1(StringUtil.getMessageForKey("report.error.message.noPrintableItems"));
      errorMsgs.add(msgs);
    }

    if (GenericValidator.isBlankOrNull(upperDateRange)) {
      upperDateRange = lowerDateRange;
    }

    try {
      lowDate = DateUtil.convertStringDateToSqlDate(lowerDateRange);
      highDate = DateUtil.convertStringDateToSqlDate(upperDateRange);
    } catch (LIMSRuntimeException re) {
      errorFound = true;
      ErrorMessages msgs = new ErrorMessages();
      msgs.setMsgLine1(StringUtil.getMessageForKey("report.error.message.date.format"));
      errorMsgs.add(msgs);
    }

    createReportParameters();

    initializeReportItems();

    setTestMapForAllTests();

    setAnalysisForDateRange();

    setTestAggregates();
  }
  private List<Result> createResultFromAnalysisItem(
      AnalysisItem analysisItem, AnalysisService analysisService, NoteService noteService) {

    ResultSaveBean bean = ResultSaveBeanAdapter.fromAnalysisItem(analysisItem);
    ResultSaveService resultSaveService =
        new ResultSaveService(analysisService.getAnalysis(), currentUserId);
    List<Result> results = resultSaveService.createResultsFromTestResultItem(bean, deletableList);
    if (analysisService.patientReportHasBeenDone() && resultSaveService.isUpdatedResult()) {
      analysisService.getAnalysis().setCorrectedSincePatientReport(true);
      noteUpdateList.add(
          noteService.createSavableNote(
              NoteType.EXTERNAL,
              StringUtil.getMessageForKey("note.corrected.result"),
              RESULT_SUBJECT,
              currentUserId));
    }
    return results;
  }
  private void createNeededNotes(AnalysisItem analysisItem, NoteService noteService) {
    if (analysisItem.getIsRejected()) {
      Note note =
          noteService.createSavableNote(
              NoteType.INTERNAL,
              StringUtil.getMessageForKey("validation.note.retest"),
              RESULT_SUBJECT,
              currentUserId);
      noteUpdateList.add(note);
    }

    if (!GenericValidator.isBlankOrNull(analysisItem.getNote())) {
      NoteType noteType = analysisItem.getIsAccepted() ? NoteType.EXTERNAL : NoteType.INTERNAL;
      Note note =
          noteService.createSavableNote(
              noteType, analysisItem.getNote(), RESULT_SUBJECT, currentUserId);
      noteUpdateList.add(note);
    }
  }
 protected String getReportNameForParameterPage() {
   return StringUtil.getMessageForKey("reports.label.project.export")
       + " "
       + StringUtil.getContextualMessageForKey("sample.collectionDate");
 }
 @Override
 protected String getObjectName() {
   return StringUtil.getMessageForKey("note.note");
 }