* @param string $name Name of the sheet
* @return object MoodleExcelWorksheet
*/
- function &add_worksheet($name = '') {
- /// Create the Moodle Worksheet. Returns one pointer to it
+ function add_worksheet($name = '') {
+ // Create the Moodle Worksheet. Returns one pointer to it
$ws = new MoodleExcelWorksheet ($name, $this->pear_excel_workbook, $this->latin_output);
return $ws;
}
*/
function MoodleExcelWorksheet($name, &$workbook, $latin_output=false) {
+ // Replace any characters in the name that Excel cannot cope with.
+ $name = strtr($name, '[]*/\?:', ' ');
+
if (strlen($name) > 31) {
// Excel does not seem able to cope with sheet names > 31 chars.
// With $latin_output = false, it does not cope at all.
}
function start_table($sheettitle) {
- $this->worksheet =& $this->workbook->add_worksheet($sheettitle);
+ $this->worksheet = $this->workbook->add_worksheet($sheettitle);
$this->rownum=0;
}