Hello, Thank you for your quick reaction. My code: for info, the field name, title, etc are nick name (not the real). Thank you for your support Andre <cfset FormatRows = StructNew() > <cfset FormatRows.verticalalignment = "vertical_center" > <cfset frg_comment = StructNew()> <cfset frg_comment.anchor = "4,8,6,11"> <cfset cellFormat = StructNew() > <cfset cellFormat.fgcolor = "light_orange" > <!--- Creation of the first sheet ---> <cfset s = SpreadsheetNew("Sheet 1")> <cfset SpreadsheetSetCellValue(s, "Title", 1, 1) > <cfset SpreadsheetSetCellValue(s, LSDateFormat(now(), "dd/mm/yyyy"), 1, 2) > <cfset SpreadsheetSetCellValue(s, "Value of test.", 1, 3) > <cfset SpreadsheetSetCellValue(s, "All descriptions of what is expected in tables and column.", 1, 4) > <!--- Formatting... ---> <cfset ListWidthCol = "50,25,50,80" > <cfset col = 1 > <cfloop list="#ListWidthCol#" index="widthcol"> <cfset SpreadsheetSetColumnWidth(s,col,widthcol)> <cfset col = col + 1 > </cfloop> <cfset SpreadsheetFormatColumn(s, {textwrap=true}, 4)> <cfset spreadsheetFormatRow(s, {bold="true"}, 2)> <cfset spreadsheetFormatRow(s, {bold="true", fgColor="grey_25_percent"}, 8)> <cfset SpreadsheetFormatCellRange (s, {bottomborder='thin',leftborder='thin',rightborder='thin',topborder='thin', alignment="left"}, 8,1, 9,4 ) > <!--- Create and fill the page "New sheet" ---> <cfset SpreadsheetCreateSheet (s, "New sheet")> <cfset SpreadsheetSetActiveSheet(s, "New sheet")> <cfset curRow = 1 > <cfset headerText = "" > <cfset headerText = ListAppend(headerText, "Title 1") > <cfset headerText = ListAppend(headerText, "Title 2") > <cfset headerText = ListAppend(headerText, "Title 3") > <cfset headerText = ListAppend(headerText, "Title 4") > <cfset headerText = ListAppend(headerText, "Title 5") > <cfset SpreadsheetAddRow(s, headerText)> <cfset spreadsheetFormatRow(s, {bold="true"}, curRow)> <cfif ResultQuery.recordcount gt 0 > <cfset curRow = curRow + 1> <cfloop query="ResultQuery" > <cfset SpreadsheetSetCellValue(s, "#ResultQuery.Field1#", curRow, 1)> <cfset SpreadsheetSetCellValue(s, "#ResultQuery.Field2#", curRow, 2)> <cfset SpreadsheetSetCellValue(s, "#ResultQuery.Field3#", curRow, 3)> <cfset SpreadsheetSetCellValue(s, "#ResultQuery.Field4#", curRow, 4)> <cfset SpreadsheetSetCellValue(s, "#ResultQuery.Field5#", curRow, 5)> <cfif ResultQuery.fg_Error eq 1 > <cfset frg_comment.comment = "The length of this text is too long.#chr(10)##chr(13)##chr(10)##chr(13)#current length:" & #ResultQuery.Length#> <cfset SpreadsheetSetCellComment(s, frg_comment, curRow, 5)> <cfset SpreadsheetFormatcell( s, cellFormat, curRow, 5 ) > </cfif> <cfset curRow = curRow + 1> </cfloop> </cfif> <cfset SpreadsheetFormatColumn(s, {textwrap=true}, 4)> <cfset SpreadsheetFormatColumn(s, {textwrap=true}, 5)> <cfset SpreadsheetFormatColumn(s, {alignment="center"},1)> <cfset SpreadsheetFormatColumn(s, {alignment="center"},2)> <cfset SpreadsheetFormatColumn(s, {alignment="left"},3)> <cfset SpreadsheetFormatRows(s, cellFormat,"1-" & curRow-1) > <cfset SpreadsheetFormatCellRange (s, {bottomborder='thin',leftborder='thin',rightborder='thin',topborder='thin'}, 1,1, curRow - 1,5 ) > <!--- Create and fill the page "Sheet 3" ---> <cfset SpreadsheetCreateSheet (s, "Sheet 3")> <cfset SpreadsheetSetActiveSheet(s, "Sheet 3")> <cfset curRow = 1 > <cfset headerText = "" > <cfset headerText = ListAppend(headerText, "Field 1") > <cfset headerText = ListAppend(headerText, "Field 2") > <cfset headerText = ListAppend(headerText, "Field 3") > <!--- The complete page come orange (value coming from the previous sheet) ---> <cfif ResultQuery2.recordcount gt 0 > <cfset curRow = curRow + 1> <cfloop query="ResultQuery2" > <cfset SpreadsheetSetCellValue(s, "#ResultQuery2.Field 1#", curRow, 1)> <cfset SpreadsheetSetCellValue(s, "#ResultQuery2.Field 2#", curRow, 2)> <cfset SpreadsheetSetCellValue(s, "#ResultQuery2.Field 3#", curRow, 3)> <cfset curRow = curRow + 1> </cfloop> </cfif> <cfset SpreadsheetFormatRows(s, formatRows,"1-" & curRow-1) > <cfset SpreadsheetFormatCellRange (s, {bottomborder='thin',leftborder='thin',rightborder='thin',topborder='thin'}, 1,1, curRow - 1,5 ) > ... <!--- Rest of the code --->
... View more