' Gambas module file PUBLIC SUB header(bToPrint AS Boolean) PRINT #FMain.hFile, "" PRINT #FMain.hFile, "" & Application.Title & " - by " & User.Name & "" PRINT #FMain.hFile, "" END PUBLIC SUB tableheader(myColumnList AS ListBox, myQuery AS String) DIM iCount AS Integer DIM iCols AS Integer iCount = 0 iCols = myColumnList.Count PRINT #FMain.hFile, "" PRINT #FMain.hFile, " " PRINT #FMain.hFile, " " PRINT #FMain.hFile, " " PRINT #FMain.hFile, " " PRINT #FMain.hFile, " " FOR iCount = 1 TO iCols PRINT #FMain.hFile, "" PRINT #FMain.hFile, myColumnList[iCount - 1].Text PRINT #FMain.hFile, "" NEXT PRINT #FMain.hFile, " " END 'PUBLIC SUB contentline(p1 AS String, p2 AS String)' ' ' PRINT #FMain.hFile, " " ' PRINT #FMain.hFile, " " ' PRINT #FMain.hFile, " " ' PRINT #FMain.hFile, " " ' 'END PUBLIC SUB contentCounter(myResult AS Result, myFieldlist AS ListBox) 'PUBLIC SUB content(myResult AS Result, myFieldlist AS ListBox) DIM iLines AS Integer DIM iColumns AS Integer DIM iLinesTot AS Integer DIM iColumnsTot AS Integer DIM hField AS ResultField DIM sFieldname AS String iLinesTot = myResult.Count DEBUG iLinesTot & " records" iColumnsTot = myResult.Fields.Count DEBUG iColumnsTot & " fields" myResult.MoveFirst FOR iLines = 1 TO iLinesTot PRINT #FMain.hFile, " " ' FOR EACH sFieldname IN myResult.Fields[ 'WITH myResult 'FOR EACH .Fields FOR iColumns = 0 TO iColumnsTot - 1 PRINT #FMain.hFile, " " PRINT #FMain.hFile, " " NEXT TRY myResult.MoveNext IF ERROR DEBUG myResult.Index ENDIF NEXT ' FOR iLines = 1 TO iLinesTot ' ' PRINT #FMain.hFile, " " ' ' FOR iColumns = 0 TO iColumnsTot ' ' PRINT #FMain.hFile, " " ' ' NEXT ' ' PRINT #FMain.hFile, " " ' ' myResult.MoveNext ' ' NEXT END 'PUBLIC SUB contentForEach(myResult AS Result, myFieldlist AS ListBox) PUBLIC SUB content(myResult AS Result, myFieldlist AS ListBox) DIM i AS Integer DEBUG "For Each" DEBUG "check fieldlist: n, ..." DEBUG myFieldlist.Count DEBUG myFieldlist.Text ' DEBUG myFieldlist[0].Text ' FOR EACH myResult ' DEBUG myResult.Index ' telt van 0 tot 20 indien 3 velden 9 records ' DEBUG myResult[Str(myFieldlist[0].Text)] ' NEXT FOR EACH myResult PRINT #FMain.hFile, " " FOR i = 0 TO myFieldlist.Count - 1 PRINT #FMain.hFile, " " NEXT PRINT #FMain.hFile, " " NEXT END PUBLIC SUB tablefooter() PRINT #FMain.hFile, "
" PRINT #FMain.hFile, "

Result

" PRINT #FMain.hFile, "
 " PRINT #FMain.hFile, myQuery & "
" ' PRINT #FMain.hFile, myColumnList[iCount - 1].Text & "=Col" & Str(iCount) & "
" & p1 & "" & p2 & "
Data: " PRINT #FMain.hFile, myResult[Str(myResult.Fields[iColumns])] ' WITH myResult ' DEBUG .Fields[Str(myFieldlist[iColumns - 1].Text)] ' ' DEBUG hField.Result ' END WITH ' myFieldlist.Next PRINT #FMain.hFile, "
" ' 'DEBUG myResult.Fields[Field[iColumns].Name)] ' PRINT #FMain.hFile, "
" PRINT #FMain.hFile, myResult[Str(myFieldlist[i].Text)] PRINT #FMain.hFile, "
" END PUBLIC SUB footer() PRINT #FMain.hFile, "
Report prepared on " & System.Host & " @ " & CStr(Date(Now())) & " - " & CStr(Time(Now())) & "
" PRINT #FMain.hFile, "" PRINT #FMain.hFile, "" END