public void delete() {
   ReportService rs = Context.getService(ReportService.class);
   for (ReportDesign rd : rs.getAllReportDesigns(false)) {
     if ("ChemotherapyDailyPatientList.xls_".equals(rd.getName())
         || "ChemotherapyDailyTreatmentSummary.xls_".equals(rd.getName())) {
       rs.purgeReportDesign(rd);
     }
   }
   h.purgeReportDefinition("ONC-Chemotherapy Daily Expected Patient List");
 }
コード例 #2
0
  /** Tests that the Report and associated ReportDesigns are successfully saved */
  @Test
  public void shouldSetupReport() throws Exception {
    List<ReportDefinition> l = getReportDefinitionService().getDefinitions(getReportName(), true);
    Assert.assertEquals(0, l.size());

    ReportDefinition reportDefinition = setupReport();
    Assert.assertEquals(getReportName(), reportDefinition.getName());

    ReportService rs = Context.getService(ReportService.class);
    List<ReportDesign> designs = rs.getReportDesigns(reportDefinition, null, false);

    Assert.assertEquals(getReportDesignNames().size(), designs.size());
    int numMatches = 0;
    for (ReportDesign rd : designs) {
      if (getReportDesignNames().contains(rd.getName())) {
        numMatches++;
      }
    }
    Assert.assertEquals(getReportDesignNames().size(), numMatches);
  }