Hi,
This is my first time using printer commands and I'm having trouble printing the row, column text from a grid.
It overprints all the columns on each row. (prints each columns text over the previous one)
Any help will be appreciated.
Jim
This is my first time using printer commands and I'm having trouble printing the row, column text from a grid.
It overprints all the columns on each row. (prints each columns text over the previous one)
Code:
Local R as Long, C as Long ERRCLEAR XPrint Attach Choose If Err = 0 And Len(XPrint$) > 0 Then XPrint Color RGB(0, 0 ,0) ' Black For R = 1 To 50 W! = 0 For C = 1 To 8 XPrint MLG_Get(HWND_FORM1_Grid1, R, C); 'print text from grid location r, c and stay on same line W! = W! + SendMessage (HWND_FORM1_Grid1, %MLG_GETCOLWIDTH, C, 0) 'compute next x position XPrint Get Pos To x!, y! 'get the y value XPrint Set Pos (W!, y!) 'set the x and y position to print next column Next C XPrint 'drop to next line If MLG_Get(HWND_FORM1_Grid1,R + 1,1) = "" Then Exit For 'if no text in next line then exit the loop Next R XPrint FormFeed XPrint Close End If
Jim
Comment