[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] How to relate the length of a string to the amountof space used
- Subject: Re: [sqr-users] How to relate the length of a string to the amountof space used
- From: Eric Dimick Eastman <erice@ontko.com>
- Date: Wed, 09 Mar 2005 13:56:30 -0500
- Delivery-date: Wed, 09 Mar 2005 13:57:02 -0500
- In-reply-to: <200503091806.j29I63GW010359@webmail2.magma.ca>
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
- References: 198.103.143.130-1050209112928@magma.ca<200503091806.j29I63GW010359@webmail2.magma.ca>
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;rv:1.7.3) Gecko/20040910
Kevin,
As I posted about a week ago, I wrote an SQR library that handles this and many
other situations. I
have not made it publicly available on our website since I may decide to sell
something some day,
but I am willing to give away copies (that you can use forever) to a few people
to help them solve
their problems.
You would be able to replace
"print $title () wrap #wrap 4 keep-top"
with
"do wrap($title, #wrap, 0, 0)"
and it will handle the proportional font.
Hope this helps,
Eric
Kevin Laroche wrote:
> Hi Brio users
> I use the columns feature to set printing positions for labels in a report.
> I am trying to have column titles in a report automatically wrapped
> if they are too long by storing the label and the space available to print
>it in an
> array called headers. It works but
> the titles wrap well before the line marking the start of the next column.
> I think this is because, for a proportional font, you may need
> less than 20 spaces to print 20 letters.
> How can I relate the length of a string to the space required to print it?
>
>
> create-array
> name=headers
> size={max_rows}
> field=titles:char !labels go here
> field=wrap:number !this is supposed to be the amount of space available
>to print
>
> ~more code here
> let #i = 2
> while #i <= {no_columns}
> !--- this line is supposed to yield the amount of space available to print
> let headers.wrap(#i - 1) = col.umn(#i) - col.umn(#i - 1) - 1
> !--where the col array is the numeric values of the columns I have set up
> let $label = headers.titles(#i)
> let #wrap = headers.wrap(#i - 1)
> let #i = #i + 1
> end-while
>
> ~more code here, another while loop
> !time to print the labels
> use-column #i
> let $title = headers.titles(#i)
> let #wrap = headers.wrap(#i)
> print $title () wrap #wrap 4 keep-top
>
> Hope my question is short and clear!
>
> Thanks
>
>
> Kevin LaRoche
> Ottawa, Ontario
> Brio 6.1 Oracle 8i Windows 2000
>
>
>
>
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
>
>
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users