| Chapter 5 Calendar Templates and Parameters |
To make a calendar using XLCalendar, you must select a calendar template file. The calendar template file is a Microsoft Excel workbook that defines the layouts, formats and styles of the calendar. For example, in the calendar template file, you can define the column width and row height, input title or description, set the font, size, color or borders, and insert pictures. Based on the calendar template file, XLCalendar will put date, holidays and others into the calendar.
XLCalendar supports a monthly calendar and a yearly calendar. The monthly calendar is a calendar on multiple worksheets, each month per worksheet. The yearly calendar is a calendar that has full year on one worksheet.
To make a monthly calendar, you need to create a worksheet for one month in the calendar template file. The format of the worksheet is the same as the format in the calendar. XLCalendar will copy the template worksheet to 12 worksheets, one worksheet for one month, and add the calendar information of one month into each worksheet.
The worksheet for monthly calendar in the calendar template:
To make a yearly calendar, you need to create a worksheet for one year in the calendar template file. The format of the worksheet is the same as the format in the calendar. XLCalendar will add the calendar information of one year into the worksheet.
In the worksheet for a yearly calendar, you should select a layout of months. XLCalendar supports 1x12 months, 2x6 months, 3x4 months, 4x3 months, 6x2 months and 12x1 months.
The worksheet for yearly calendar in the calendar template:
For each calendar template file, there are some parameters to tell XLCalendar how to output the calendar. The parameter file contains the parameters for a calendar template. The calendar parameter file has an ".ini" extension, is located in the same directory as the template file, and has the same base name as the template file.
The parameters for monthly calendar:
Output Monthly Calendar: This parameter indicates whether XLCalendar will output the monthly calendar. Checked indicates outputting a monthly calendar. Unchecked indicates not outputting a monthly calendar.
Sheet Name: This parameter identifies the worksheet for a monthly calendar in the calendar template file. It is the name of the worksheet.
First Day of Week: This parameter specifies the first day of the week. A week can start on Sunday or Monday.
First Cell of Day: This parameter specifies the position where the day of the month will be inserted. You just need to identify the first cell for the day. XLCalendar will compute the positions for each day.
Col Interval of Day: This parameter specifies the number of columns between two days.
Row Interval of Day: This parameter specifies the number of rows between two days or two weeks.
Output Name of Weekday: This parameter indicates whether XLCalendar will output the name of the weekday. Checked indicates outputting the name of weekday. Unchecked indicates not outputting the name of the weekday.
First Cell of Weekday: This parameter specifies the position where the name of the weekday will be inserted. You just need to identify the first cell for the weekdays. XLCalendar will compute the positions for each weekday.
Weekday Name: This parameter specifies the weekday name. You can select the names you want. For example, you can use "Sunday, Monday, Tuesday...", or "Sun, Mon, Tue..."
Output Month: This parameter indicates whether XLCalendar will output the month. Checked indicates outputting the month. Unchecked indicates not outputting the month.
First Cell of Month: This parameter specifies the position where the month will be inserted. You just need to identify the cell for January. XLCalendar will compute the positions for each month.
Month Name: This parameter specifies the month name. You can select the names you want. For example, you can use "January, February, March...", or "Jan, Feb, Mar..."
Output Year: This parameter indicates whether XLCalendar will output the year. Checked indicates outputting the year. Unchecked indicates not outputting the year.
First Cell of Year: This parameter specifies the position where the year will be inserted.
Output Holiday: This parameter indicates whether XLCalendar will output the holidays. Checked indicates outputting the holidays. Unchecked indicates not outputting the holidays.
First Cell of Holiday: This parameter specifies the position where the name of holiday will be inserted.
Multiple Holidays on the Same Day: This parameter specifies how to process holidays when there are multiple holidays on the same day. For example, you can choose "overwrite holiday with the last holiday", or "put holidays into the next row or column".
Holiday File: This parameter specifies the holiday file that contains the holidays you want to insert into the calendar. If you select "(Template)", XLCalendar will get holidays from the parameter file. Otherwise it gets holidays from the file you selected.
The parameters for yearly calendar:
Output Yearly Calendar: This parameter indicates whether XLCalendar will output the yearly calendar. Checked indicates outputting yearly calendar. Unchecked indicates not outputting a yearly calendar.
Sheet Name: This parameter identifies the worksheet for yearly calendar in the calendar template file. It is the name of the worksheet.
First Day of Week: This parameter specifies the first day of the week. A week can start on Sunday or Monday.
First Cell of Day: This parameter specifies the position where the day of the month will be inserted. You just need to identify the first cell of the day. XLCalendar will compute the positions for each day.
Col Interval of Day: This parameter specifies the number of columns between two days.
Row Interval of Day: This parameter specifies the number of rows between two days or two weeks.
Layout of Months: This parameter specifies the layout of months. For example, 2x6 months, 3x4 months or 4x3 months.
Col Interval of Month: This parameter specifies the number of columns between two months.
Row Interval of Month: This parameter specifies the number of rows between two months.
Output Name of Weekday: This parameter indicates whether XLCalendar will output the name of the weekday. Checked indicates outputting the name of the weekday. Unchecked indicates not outputting the name of the weekday.
First Cell of Weekday: This parameter specifies the position where the name of the weekday will be inserted. You just need to identify the first cell for the weekdays. XLCalendar will compute the positions for each weekday.
Weekday Name: This parameter specifies the weekday name. You can select the names you want. For example, "Sunday, Monday, Tuesday...", or "Sun, Mon, Tue..."
Output Month: This parameter indicates whether XLCalendar will output the month. Checked indicates outputting the month. Unchecked indicates not outputting the month.
First Cell of Month: This parameter specifies the position where the month will be inserted. You just need to identify the cell for January. XLCalendar will compute the positions for each month.
Month Name: This parameter specifies the month name. You can select the names you want. For example, "January, February, March...", or "Jan, Feb, Mar..."
Output Year: This parameter indicates whether XLCalendar will output the year. Checked indicates outputting the year. Unchecked indicates not outputting the year.
First Cell of Year: This parameter specifies the position where the year will be inserted.
Output Holiday: This parameter indicates whether XLCalendar will output the holidays. Checked indicates outputting the holidays. Unchecked indicates not outputting the holidays.
First Cell of Holiday: This parameter specifies the position where the name of holiday will be inserted.
Multiple Holidays on the Same Day: This parameter specifies how to process holidays when there are multiple holidays on the same day. For example, overwrite holiday with the last holiday, put holidays into the next row or column.
Holiday File: This parameter specifies the holiday file that contains the holidays you want to insert into the calendar. If you select "(Template)", XLCalendar will get holidays from the parameter file. Or else, it gets holidays from the file you selected.