Overwritten data in foreach

Jun 23, 2011 at 11:02 AM

Hi everyone,

I'm getting a weird output in my xls file. I don't know if it is a bug or if i'm doing it wrong. I've search the internet for this issue but found nothing.
So the problem is, i'm generating a spreedsheet from a database dump: some headers output first :


->setCellValue(numToAlpha($colI).'3', get_string('attempt','scorm'))
            ->setCellValue(numToAlpha($colI + 1).'3', get_string('started','scorm'))
            ->setCellValue(numToAlpha($colI + 2).'3', get_string('last','scorm'))
            ->setCellValue(numToAlpha($colI + 3).'3', get_string('score','scorm'));

This is done in a foreach loop. Then i do this (still in the same foreach loop):


->setCellValue(numToAlpha($colI).'1', get_string('title','scorm')." : ".$scorm->name);

Whenever i try to put this line, it seems to be overwriting the previous lines. In any case, i get no data output for the previous lines. But the last line is indeed generated.


I wonder what is the problem with this ? Same thing happens using mergeCells, row 3 never appears !


Would be great if someone could help me with this !