printing a spreadsheet

Hi,

I use Reportlabs a lot at work. I have included what amounts to a timesheet
that is written to PDF. It is probably a little more complicated than you
need, but it has lots of good examples in it. I have attached it.

I typically just import the module and call the "tsLayout" method, passing
in a list of variables. If you have questions, email me directly.

Hope this helps.

Mike

printTS.py (23.6 KB)

···

-----Original Message-----
From: Jeff Peery [mailto:jeffpeery@seametrics.com]
Sent: Tuesday, January 30, 2007 2:35 PM
To: wxPython-users@lists.wxwidgets.org
Subject: RE: [wxPython-users] printing a spreadsheet

Ok, thanks.

I was reading about printing on the wxpython website and I think I would
like to use report manger... although I have no clue as to how to embed it
into my wx application... I don't suppose someone has a nice very simple
example of how to do this? I just want to create a table, then send it to a
pdf or print it... however I like report manager because in the future I may
want to create a more detailed report than just a simple table.

Thanks!

Jeff

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Monday, January 29, 2007 5:49 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] printing a spreadsheet

Jeff Peery wrote:

Hello, I'm not sure how printing images/documents works, but I have a

wx

application that uses a wx.grid and I want to printout the

spreadsheet.

Is there a canned function to do this or what are my options? Thanks.

There is the wx.lib.printout module in the library that has some table
printing abilities that may or may not meet your needs. Otherwise printing
is essentially the same as drawing, so if you can draw your data you can
print it. See the PrintFramework sample in the demo for a simple example,
and there is also a good chapter in the book about printing.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Hi Guys,
I am new with python and with wxpython.
I have a basic and general question for which I wasn't able to find an
answer.

In my app I use wxTextCtrl to "fake" a caption, given that I can more easily
read and change their values than what I could do with wxStaticText

So the syntax is:

Caption = wx.TextCtrl (panel, ID_TXT, str(rownum), size=(13,-1),
style=wx.TE_READONLY|wx.NO_BORDER))
Caption.SetBackgroundColour(panel.GetBackgroundColour())

So far so good.

Now, I thought about creating a custom class to make things cleaner:

class fakeCaption(wx.TextCtrl):
  def __init__(self, parent, id, value, size):
    wx.TextCtrl.__init__(self, parent, id, value, size,
style=wx.TE_READONLY|wx.NO_BORDER)
  
wx.TextCtrl.SetBackgroundColour(parent.GetBackgroundColour())

But this doesn't work because I am afraid this is not the right way to use
SetBackgroundColour and GetBackGroundColour

I appreciate any help.
Thanks
Giorgio

···

-----Original Message-----
From: Mike Driscoll [mailto:mdriscoll@co.marshall.ia.us]
Sent: 31 January 2007 08:37
To: 'wxPython-users@lists.wxwidgets.org'
Subject: RE: [wxPython-users] printing a spreadsheet

Hi,

I use Reportlabs a lot at work. I have included what amounts to a timesheet
that is written to PDF. It is probably a little more complicated than you
need, but it has lots of good examples in it. I have attached it.

I typically just import the module and call the "tsLayout" method, passing
in a list of variables. If you have questions, email me directly.

Hope this helps.

Mike

-----Original Message-----
From: Jeff Peery [mailto:jeffpeery@seametrics.com]
Sent: Tuesday, January 30, 2007 2:35 PM
To: wxPython-users@lists.wxwidgets.org
Subject: RE: [wxPython-users] printing a spreadsheet

Ok, thanks.

I was reading about printing on the wxpython website and I think I would
like to use report manger... although I have no clue as to how to embed it
into my wx application... I don't suppose someone has a nice very simple
example of how to do this? I just want to create a table, then send it to a
pdf or print it... however I like report manager because in the future I may
want to create a more detailed report than just a simple table.

Thanks!

Jeff

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Monday, January 29, 2007 5:49 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] printing a spreadsheet

Jeff Peery wrote:

Hello, I'm not sure how printing images/documents works, but I have a

wx

application that uses a wx.grid and I want to printout the

spreadsheet.

Is there a canned function to do this or what are my options? Thanks.

There is the wx.lib.printout module in the library that has some table
printing abilities that may or may not meet your needs. Otherwise printing
is essentially the same as drawing, so if you can draw your data you can
print it. See the PrintFramework sample in the demo for a simple example,
and there is also a good chapter in the book about printing.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Please send a new message (not a reply) when asking new questions.

Giorgio F. Gilestro wrote:

Hi Guys,
I am new with python and with wxpython.
I have a basic and general question for which I wasn't able to find an
answer.

In my app I use wxTextCtrl to "fake" a caption, given that I can more easily
read and change their values than what I could do with wxStaticText

So the syntax is:

Caption = wx.TextCtrl (panel, ID_TXT, str(rownum), size=(13,-1),
style=wx.TE_READONLY|wx.NO_BORDER))
Caption.SetBackgroundColour(panel.GetBackgroundColour())

So far so good.

Now, I thought about creating a custom class to make things cleaner:

class fakeCaption(wx.TextCtrl):
  def __init__(self, parent, id, value, size):
    wx.TextCtrl.__init__(self, parent, id, value, size,
style=wx.TE_READONLY|wx.NO_BORDER)
  
wx.TextCtrl.SetBackgroundColour(parent.GetBackgroundColour())

But this doesn't work because I am afraid this is not the right way to use
SetBackgroundColour and GetBackGroundColour

Use:
  self.SetBackgroundColour(parent.GetBackgroundColour())

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!