ImportCSVtoExcelBuffer(VAR VfilFile : File;VAR RrecExcelBufferTemp : TEMPORARY Record "Excel Buffer";VchrSeperator : Char;VchrQualifier RrecExcelBufferTemp.RESET; RrecExcelBufferTemp.DELETEALL; LintRowCount :=1; LintColumnCount :=1; VfilFile.TEXTMODE(FALSE); VfilFile.SEEK(0); WHILE LintFileCount <= VfilFile.LEN DO BEGIN LintFileCount+=1; VfilFile.READ(LchrReadInChar); CASE LchrReadInChar OF VchrSeperator: BEGIN RrecExcelBufferTemp.INIT; RrecExcelBufferTemp."Row No." := LintRowCount; RrecExcelBufferTemp."Column No." := LintColumnCount; RrecExcelBufferTemp."Cell Value as Text" := LtxtReadInText; RrecExcelBufferTemp.INSERT; LintColumnCount +=1; LtxtReadInText :=''; END; VchrQualifier: BEGIN END; VchrLineBreak: BEGIN RrecExcelBufferTemp.INIT; RrecExcelBufferTemp."Row No." := LintRowCount; RrecExcelBufferTemp."Column No." := LintColumnCount; RrecExcelBufferTemp."Cell Value as Text" := LtxtReadInText; RrecExcelBufferTemp.INSERT; LintRowCount +=1; LintColumnCount :=1; LtxtReadInText :=''; END; ELSE BEGIN IF (LchrReadInChar >=32) AND (LchrReadInChar <=126) THEN LtxtReadInText := LtxtReadInText + FORMAT(LchrReadInChar); END; END; END; CreateHeader(RrecExcelBufferTemp); EXIT(LintRowCount-1);
Comments
This is getting really urgent now.
Hope someone can help :-k