print hilited lines of tablefield

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
haribo
Posts: 23
Joined: Fri Jun 29, 2007 8:04 pm

print hilited lines of tablefield

Post by haribo » Sun Jul 22, 2007 8:25 pm

hi,
i have a tablefield with data from database, i want select line 5- 10 or line 20- 50 , print Printcommand with selectedLines or hilitedLines dont work. need a howto
Ralle

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Mon Jul 23, 2007 7:50 am

Hi Ralle,

You're going to have to explicitly combine the data yourself. Here's something to get you started:

Code: Select all

on mouseUp
  -- get the comma-separated list of the hilited lines
  put the hilitedLines of field "MyTable" into tHilitedLines
  -- append the text of the hilited lines to a new variable
  repeat for each item tLineNumber in tHilitedLines
    put line tLineNumber of field "MyTable" & return after tSelectedData
  end repeat
  -- remove the trailing return
  delete char -1 of tSelectedData
  -- now ask the user for the printing information
  revShowPrintDialog true, true
  revPrintText tSelectedData
end mouseUp
Also important to note is that the 'print' command is meant for printing the contents of cards, not individual fields or a chunk of text. The following commands are your friends for text printing: 'revShowPrintDialog', 'revPrintText', revPrintField'.

Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

haribo
Posts: 23
Joined: Fri Jun 29, 2007 8:04 pm

Post by haribo » Mon Jul 23, 2007 7:40 pm

works fine, thanks
Ralle

Post Reply