print-out templating help requested.

Hello All.
  I want to thank this NG for all the vital help they've provided me in the
past! I couldn't have gotten this far without your quick help and insight,
so for that I should start off with a sincere 'Thank You'!

  I am making a program for my wife's store. She has many deposit forms to
fill out for the bank, and it's ridiculous that she has been writing these
forms by hand, and computing the values by print-out calculator, while her
notebook PC is so close by doing nothing more than playing her iTunes music.

  So, what I'd like to do is make a program which records the 'deposits'
coming in throughout the day, and then print them automatically .

  The amount of frustration she goes thru at the end of the day shouldn't
really happen. I've gotten the routines to record in-coming checks
indivually, and cash as a lump-sum won't be hard. (I use MySQL as the
back-end) . I'd like to make a printing sub-system.

  I've only experienced printing today with the example from the Wiki
(htmlEasy Printing). I think that I can fudge with font-sizes and spaces /
tabs / CR, LFs such that I can get the numbers to print in the appropriate
spaces on the deposit form.What I'd like to know is this:
   * Is there any way I can specify the exact position of text on paper from
the margin?
   * But what I'd really like to do is have a 'template' for the bank form
so that if she switches banks again, or we need to deposit multi-accounts in
different banks, the new template can be made, without adjusting any of the
code of my program.

Thanks so much in advance!!!!
Dave
Stamford, CT, USA.

  Can anyone give me some pointers or direction for this? I would be very
appreciative of some help!

S. D. Rose wrote:

  I've only experienced printing today with the example from the Wiki
(htmlEasy Printing). I think that I can fudge with font-sizes and spaces /
tabs / CR, LFs such that I can get the numbers to print in the appropriate
spaces on the deposit form.What I'd like to know is this:
   * Is there any way I can specify the exact position of text on paper from
the margin?

not with htmlEasyPrinting. By design, html is supposed to be specifying content, and not exact layout. Yes, ti can be kludged to be close, but I wouldn't try that.

You can, however, print stuff exactly where you want it with a wx.PrinterDC. You then get only the basic DC calls: DC.DrawText, etc., but you can specify where stuff goes.

The trick is that DCs work in pixel coordinates, and printers have different resolutions, so you have to do some trickery with querying the PrinterDC for resolution, then adjusting your coords (or maybe using SetUserScale) accordingly. This can be kind of a pain. However, particularly if you're only trying to support one printer, it shouldn't be too hard.

I'm sorry I can't point you to any examples at the moment, but they are out there.

   * But what I'd really like to do is have a 'template' for the bank form
so that if she switches banks again, or we need to deposit multi-accounts in
different banks, the new template can be made, without adjusting any of the
code of my program.

That's a good idea, but I suspect you'll have to roll your own. You needs sound pretty specific. You might want to check out Dabo's report framework, it uses XML templates, and generates PDF (I think) there was a discussion of it on this list recently.

IF you do roll your own, I suggest that you resist the temptation to use XML or something like that. Just specify your template in Python.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

[snip]

I've only experienced printing today with the example from the Wiki
(htmlEasy Printing). I think that I can fudge with font-sizes and spaces /
tabs / CR, LFs such that I can get the numbers to print in the appropriate
spaces on the deposit form.What I'd like to know is this:
  * Is there any way I can specify the exact position of text on paper from
the margin?
  * But what I'd really like to do is have a 'template' for the bank form
so that if she switches banks again, or we need to deposit multi-accounts in
different banks, the new template can be made, without adjusting any of the
code of my program.

One way of doing this is to use ReportLab. With PDF documents it is possible
to specify exact locations. I use a moderately simple script to generate forms,
each rectangular area having an assigned name and coordinates. These data fields
can later be populated with the appropriate data. You can either 'hide' the
perimeters of the areas -- if you're printing on preprinted forms -- or show them
if you're trying to generate your own forms.

Sorry, never used htmlEasy.

HTH--

   -frank

···

On Wed, 28 Dec 2005, S. D. Rose wrote:

Hi,

S. D. Rose wrote:

Hello All.
I want to thank this NG for all the vital help they've provided me in the
past! I couldn't have gotten this far without your quick help and insight,
so for that I should start off with a sincere 'Thank You'!

I am making a program for my wife's store. She has many deposit forms to
fill out for the bank, and it's ridiculous that she has been writing these
forms by hand, and computing the values by print-out calculator, while her
notebook PC is so close by doing nothing more than playing her iTunes music.

So, what I'd like to do is make a program which records the 'deposits'
coming in throughout the day, and then print them automatically .

The amount of frustration she goes thru at the end of the day shouldn't
really happen. I've gotten the routines to record in-coming checks
indivually, and cash as a lump-sum won't be hard. (I use MySQL as the
back-end) . I'd like to make a printing sub-system.

I've only experienced printing today with the example from the Wiki
(htmlEasy Printing). I think that I can fudge with font-sizes and spaces /
tabs / CR, LFs such that I can get the numbers to print in the appropriate
spaces on the deposit form.What I'd like to know is this:
  * Is there any way I can specify the exact position of text on paper from
the margin?
  * But what I'd really like to do is have a 'template' for the bank form
so that if she switches banks again, or we need to deposit multi-accounts in
different banks, the new template can be made, without adjusting any of the
code of my program.

For something like this I would use a report generator. I use for some time one called Report Manager (http://reportman.sourceforge.net/). As your data is in a database you just connect to it define an appropriate SQL select on the data and layout it out with the Layout designer to create the report layout, then you call the command line tool from within your wxPython program.

See you
Werner

···

Thanks so much in advance!!!!
Dave
Stamford, CT, USA.

Can anyone give me some pointers or direction for this? I would be very
appreciative of some help!

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