Jump to content

_WordDocPrint


autoitxp
 Share

Recommended Posts

Hi how i can print all results once this code is randomly open up print pages and this not real good help!!

func _getdataprint()
If Not  _SQlite_Query (-1, "SELECT * FROM " & " " & $mytable & " " & " Where print = 'CHECKED' ;", $hQueryss)  = $SQLITE_OK Then _
_GUICtrlStatusBarSetText($StatusBar ,_SQLite_ErrMsg (), 2)

While _SQLite_FetchData ($hQueryss, $aRow) = $SQLITE_OK 
 
$oWordApp = _WordCreate (@ScriptDir & "\Test.doc")
$oDoc = _WordDocGetCollection ($oWordApp, 0)
$oDoc.Range.Text = StringFormat(" %-10s  %-10s  %-10s  %-10s ", $aRow[0], $aRow[1], $aRow[2], $aRow[3],$aRow[4],$aRow[5],$aRow[6], $aRow[7] , $aRow[8]) & @CR
_WordDocPrint ($oDoc)
_WordQuit ($oWordApp, 0)

WEnd

If Not  _SQLite_QueryFinalize ($hQuerys)  = $SQLITE_OK Then _
_GUICtrlStatusBarSetText($StatusBar ,_SQLite_ErrMsg (), 2)    
EndFunc

Regards
Sim
Edited by autoitxp
Link to comment
Share on other sites

ok i want to printout _SQLite_GetTable2d results but its not actually working

how i can get _SQLite_Display2DResult($aResult) for $oDoc.Range.Text

func _getdataprint()

$iRval = _SQLite_GetTable2d (-1, "SELECT id, date, amount, voucher, description, posted_by, autherized_by, company  FROM " & " " & $mytable & " " & " Where print = 'CHECKED';" , $aResult, $iRows, $iColumns)

If $iRval = $SQLITE_OK Then
  _SQLite_Display2DResult($aResult)
$oWordApp = _WordCreate (@ScriptDir & "\Test.doc")
$oDoc = _WordDocGetCollection ($oWordApp, 0)
$oDoc.Range.Text =  _SQLite_Display2DResult($aResult)
_WordDocPrint ($oDoc)
_WordQuit ($oWordApp, 0)

EndIf
EndFunc
Edited by autoitxp
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...