Beispiel #1
0
  def on_print( self, event ):
    data = []
    for i,r in enumerate(self.records):
      line = []
      for j in range(self.NF):
        line.append( self.fmt_field(r,j) )
      data.append( line )
    prt = PrintTable(self.parent)
    prt.data = data
    prt.left_margin = 0.5
    #prt.top_margin = 1
    prt.set_column = [0.8, 1.0, 3.0, 2.5, 1.0, 1.0, 0.8]
    prt.label = ["Invoice","Date Done","Customer","Description","Amount", "Date Due", "Status"]
    prt.SetColAlignment(4, wx.ALIGN_RIGHT)
    prt.SetLandscape()
    prt.SetHeader( "Invoice List Report", size = 30 )
    prt.SetFooter("Date: ", type = "Date", align=wx.ALIGN_RIGHT, indent = -2, colour = wx.NamedColour('BLUE'))
    #prt.SetRowSpacing( 10,10 )
    prt.Preview() # Print()

    red = wx.NamedColour('RED')
    blue = wx.NamedColour('BLUE')
    for i,r in enumerate(data):
      if r[6] == ST_OVERDUE:
        for j in range(self.NF):
          prt.SetCellText( i,j, red )
          prt.SetCellColour( i,j, (255,200,200))
      elif r[6] == ST_PENDING:
        for j in range(self.NF):
          prt.SetCellText( i, j, blue )
          prt.SetCellColour( i,j, (200,200,255))

    return
 def onprint(self, evt):
     data = []
     data.append(["Salutation", "First Name", "Last Name", "Profession"])
     for k in self.personList:
         data.append([k['salutation'], k['fname'], k['lname'],
                      k['profession']])
     prt = PrintTable(self.parent)
     prt.data = data[1:]
     prt.left_margin = .2
     prt.set_column = [2, 2, 2, 2]
     prt.label = data[0]
     prt.top_margin = 1
     prt.SetLandscape()
     prt.SetHeader("Person List Report", size=30)
     prt.SetFooter("Page No", colour=wx.NamedColour('RED'), type="Num")
     prt.SetRowSpacing(10, 10)
     prt.Print()
Beispiel #3
0
 def __init__(self, parent, num_regions=1):
     PrintTable.__init__(self, parent)
     self.num_regions = num_regions