Jump to content
We've recently updated our Privacy Statement, available here ×
  • Adding a Holiday Exclusion Calendar


    Tom C
    • Features: Scheduler Version: v5.5

    Starting in JasperReports Server v5.5, the scheduler supports exclusion calendar that specifies days or times when no report should be run, even if the schedule is triggered. Currently, the only method to define a holiday calendar is through the REST API, as discussed in  Documentation » JasperReports Server Administration Guide » System Configuration » section 7.15.3 Adding a Holiday Exclusion Calendar.

    An alternative way of doing this is to create a calendar catalog file and use the import utility to load it into the repository. The following steps outline the process to add the "2014 French Holidays" into the repository qrtz_calendars table using this method:

    • At the command prompt, go to deployed JasperReports Server v5.5 root buildomatic directory (for example, “C:Jaspersoftjasperreports-server-5.5buildomatic”), and run the following export script to get the calendars content into a catalog structure directory folder:

      js-export –calendars –output-dir MyCalendars
      
    • Go to the MyCalendars directory created in the above step and create a file named “2014FrenchHolidays.xml” under MyCalendarscalendars subdirectory. This file contains the following content:

      <?xml version="1.0" encoding="UTF-8"?>
      <holiday-calendar>
          <name>2014FrenchHolidays</name>
          <description>2014 French Holidays</description>
          <timezone>GMT+01:00</timezone>
          <excludedDate>2014-01-01T00:00:00.000-08:00</excludedDate>
          <excludedDate>2014-04-18T00:00:00.000-07:00</excludedDate>
          <excludedDate>2014-04-21T00:00:00.000-07:00</excludedDate>
          <excludedDate>2014-05-01T00:00:00.000-07:00</excludedDate>
          <excludedDate>2014-05-08T00:00:00.000-07:00</excludedDate>
          <excludedDate>2014-05-29T00:00:00.000-07:00</excludedDate>
          <excludedDate>2014-06-09T00:00:00.000-07:00</excludedDate>
          <excludedDate>2014-07-14T00:00:00.000-07:00</excludedDate>
          <excludedDate>2014-08-15T00:00:00.000-07:00</excludedDate>
          <excludedDate>2014-11-01T00:00:00.000-07:00</excludedDate>
          <excludedDate>2014-11-11T00:00:00.000-08:00</excludedDate>
          <excludedDate>2014-12-24T00:00:00.000-08:00</excludedDate>
          <excludedDate>2014-12-25T00:00:00.000-08:00</excludedDate>
      </holiday-calendar>
      
    • Modify “index.xml” under MyCalendars directory, and add “<calendar>2014FrenchHolidays</calendar>” entry to ”calendars" module:

      Before:

      <export>
          <property name="pathProcessorId" value="file"/>
          <property name="jsVersion" value="5.5.0 PRO"/>
          <module id="calendars">
              <calendar>New Years Days</calendar>
          </module>
      </export>
      

      After:

      <export>
          <property name="pathProcessorId" value="file"/>
          <property name="jsVersion" value="5.5.0 PRO"/>
          <module id="calendars">
              <calendar>2014FrenchHolidays</calendar>
              <calendar>New Years Days</calendar>
          </module>
      </export>
      
    • At the command prompt, from JasperReports Server v5.5 root buildomatic directory, run import script to update repository calendars using the modified calendars catalog:

      js-import –input-dir MyCalendars –update
      
    • Now “2014 French Holidays” should become available to the JasperReports Server v5.5 job scheduler “Calendar dates to exclude” list.

      14(2).png.263fd308b14ff6633b9e0eea22d79cb3.png

    Samples.zip.


    TTC 20140210

    14(2).png.ac43a0453830e7d06045830f3b0a5489.png


    User Feedback

    Recommended Comments



    Guest
    This is now closed for further comments

×
×
  • Create New...