Aligning Report Text - Smalltalk
This is a discussion on Aligning Report Text - Smalltalk ; Hi,
I have integrated Ian's Report Package into my application and it
works very well. Great job Ian!
Users will not have the ability or time to make use of the Report
Editor given the nature of the data. Just ...
-
Aligning Report Text
Hi,
I have integrated Ian's Report Package into my application and it
works very well. Great job Ian!
Users will not have the ability or time to make use of the Report
Editor given the nature of the data. Just simple print or print
preview. I accomplished this by making a few minor changes to render
the report "silently" without opening the Report Editor.
My question is how to align data for a given report. First I populate
the report with column names followed by the data values which come
from a model object. Unfortunately, I have not been able to get the
model data to align with the field names.
Any suggestions?
Thanks,
Pax
-
Re: Aligning Report Text
Pax,
>I have integrated Ian's Report Package into my application and it
>works very well. Great job Ian!
Blimey! I didn't think anyone would use that package in anger. I only
really added it so that I could produce some formatted text without
getting too involved in the RichEdit control. IIRC, I never got round
to finishing it.
I'm glad you find it useful though.
>My question is how to align data for a given report. First I populate
>the report with column names followed by the data values which come
>from a model object. Unfortunately, I have not been able to get the
>model data to align with the field names.
>
>Any suggestions?
Can't the tabs do that. You can set parameters for the tab stops
programmatically - tab position, tab alignment and character used to
fill in the tab spacing.
The alignment can either be left, centre, right or decimal (decimal
points are aligned).
So, to create two columns with right aligned text you would have to
define a tab scheme (tab position, alignment, filler)
tabs
at: #myFormat
put:
((OrderedCollection new)
add: #(2 #right #space);
add: #(4 #right #space);
add: #(6 #right #space);
yourself).
and then add your data to the report document
myReport
tabStops: #myFormat
while:
[myReport appendTextAndCr: ' header1 header2'.
myReport appendTextAndCr: ' aaa 11'.
myReport appendTextAndCr: ' bbbb 2222'.
myReport appendTextAndCr: ' cccccc 33333'].
where the "spaces" in the above strings are tab characters.
Let me know if that won't do what you want and I'll see if I can work
out something else.
--
Ian
The From address is valid
-
Re: Aligning Report Text
Hi Ian,
I did notice the tab configuration but didn't give it a second look. I
think your suggestion should give me what I want and make things align
nicely. However, I will have to create a tab format for each report
class which should be straight forward.
Otherwise, I like what you have done with the package as it gives the
developer a means to view/edit/print and print preview a document from
the object model.
Again, great job!
Thanks,
Pax
Similar Threads
-
By Application Development in forum Adobe illustrator
Replies: 2
Last Post: 07-09-2007, 11:43 AM
-
By Application Development in forum Adobe Indesign
Replies: 12
Last Post: 07-02-2007, 04:40 PM
-
By Application Development in forum Adobe illustrator
Replies: 4
Last Post: 12-20-2006, 10:40 PM
-
By Application Development in forum basic.visual
Replies: 1
Last Post: 11-28-2005, 08:46 AM
-
By Application Development in forum Smalltalk
Replies: 0
Last Post: 09-22-2005, 09:19 AM