[reportlab-users] Re: SimpleDocTemplate stripping internal wh itespace??

Schollnick, Benjamin reportlab-users@reportlab.com
Mon, 23 Feb 2004 08:22:48 -0500


> Have you read the manuals and did you look at the examples?

I have gone through the manuals, I am still digesting the examples...
As I mentioned, I have up to this point, only been using DrawString commands
on the canvas....  So I am using this project as a excuse to force myself to
learn the rest of the functionality in Reportlab....

So I am attempting to force myself to use the higher level constructs
while creating this report...

> I suppose what you really want is a tabular layout.

True, it would probably be a better fit...

The major issue, is that for the tabular layout...  (Via the Table user
method)
I do not know how many values there will be.  

But I can work around that....

> (using fixed-width fonts smells a bit like a report from the 
> early 70ies).

Well, this is a first draft >g<  But seriously....

My intention is to offer at least two styles of reports, and I thought it
would be
nice to have a style that was easy to read, yet easy to cut and paste...
(I am not sure that a PDF table would copy and paste well...)

		xxxxx		:	123123
		yyyy yyy yy : 	23406
		ttt t t tttt: 	990 092 

Is a little easier to read than:

		xxxxx	: 123123
		yyyy yyy yy : 23406
		ttt t t tttt: 990 092 

That's all....  I'll double check with the preformatted format....  I just
thought it was a little strange that the parser would be stripping the white
space inside a string....

			- Benjamin
> 
> Henning
> 
> > From: "Schollnick, Benjamin" <Benjamin.Schollnick@usa.xerox.com>
> > To: "'reportlab-users@reportlab.com'" 
> <reportlab-users@reportlab.com>
> > Subject: [reportlab-users] SimpleDocTemplate stripping internal
> whitespace??
> > Reply-To: reportlab-users@reportlab.com
> >
> > Folks,
> >
> > I have run into a issue, that I can't explain....
> >
> > I use the follow routine, for Canvas.DrawString, without any
> > problems...
> >
> > def format_lines    ( fieldname, data, fieldname_width=15, 
> data_width=20):
> >     """
> >         Reformat the data into a string.
> >         Simply a "Macro", to reduce duplication.
> >
> >         Inputs -
> >             FieldName   - Name of the field that is to be 
> reformated.
> >             data        - The actual stored data.
> >
> >         Outputs -
> >             fieldname = "This is the fieldname"
> >             data      = "This is the data."
> >             "This is the fie: This is the "
> >
> >         Example:
> >
> >     """
> >     fmt = '  %-' + str(fieldname_width) + 's: %-' + 
> str(data_width) + 's'
> >     return fmt % (fieldname, data)
> >
> >
> > Now since I decided to use SimpleDocTemplate, it is appearing that
> > the
> > internal whitespace is being removed...
> >
> > i.e.
> >
> > Version : 1.7h
> >
> > Is there a simple way to have it not filter the internal white
> > space?
> >
> >         Contents.append (Paragraph ( format_lines    ( entry[1],
> > data[entry[2]],
> >                                                       
> fieldname_width=25,
> > data_width=20),
> >                                      normal ) )
> >
> >
> > - Ben
> 
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>