forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Printing a table

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base
View previous topic :: View next topic  
Author Message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Dec 13, 2004 2:20 pm    Post subject: Printing a table Reply with quote

just want to share a way i have found to print the contents of a table with all the data lining up as it should and with the option of having a basic grid as well - the trick to lining up the data in the printout is to use @FILL()

the code comes directly from a program that i am hoping to release very soon ... the program uses a table with 9 entries but only some of the entries i want to print ... and with the given headers

Code:
if @greater(@count(table1),0)
      list create, 10
     list add, 10, %%caption (@datetime(dd mmmm yyyy hh:nn am/pm))
     list add, 10,
     list add, 10, ----------------------------------------|-------|-----------|--------|--------|--------
     list add, 10, @fill(40,Keyword)|@fill(6,Demand) |@fill(10,Supply) |@fill(7,KEI) |@fill(7,@chr(34)Supply@chr(34)) |@fill(8,@chr(34)KEI@chr(34))       
     list add, 10, ----------------------------------------|-------|-----------|--------|--------|--------
     %i = 0
     option fieldsep, @tab()
     repeat       
        list seek, table1, %i       
        parse "%1;%2;%3;%4;%5;%6;%7;%8;%9",@item(table1)       
        list add, 10, @fill(40,%2)|@fill(6,%3) |@fill(10,%5) |@fill(7,%6) |@fill(7,%Cool |@fill(8,%9)
        list add, 10, ----------------------------------------|-------|-----------|--------|--------|--------
        %i = @succ(%i)
     until @equal(%i,@count(table1))
     list print, 10, courier, 10
     list close, 10
      option fieldsep, |
  end
 


i would recommend using a non proportional font when printing this way otherwise the data will not line up properly on the print out

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group