If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

[Solved] Word Wrapping or Trunating Text

Started by B, 07 Nov 2005 11:24:25 AM

Previous topic - Next topic

B

Hi guys,

Apologies in advance if this seems like a strange query.Ã,  Also, this is my first post on a message board so please be gentle with any responses.

I am trying to design a cheque writer report in CRN to fit a UK cheque and therefore need to precisely be able ti fit the information into the required boxes..Ã,  As an anti- fraud measure, the account payee field can only be 35 characters, has to flow from right to left and can only span one line, therefore no line wrapping.Ã,  I know in Impromptu, there was an option in the Layout tab which could either enable or disbale line wrapping but I cannot find an equivalent option in Report Studio.Ã,  I have tried using the Max Characters property but this does not really help sizing issues.Ã,  I have also tried putting the name in a text field as a report expression and embedding this in a block which I could then use the 'clip' functionality of a block, but this does not work either.

If I had any hair, it would be well and truly ripped out by now, so all help gratefully received.

Cheers
B

CoginAustin

2 options I can think of

1.  make the query item a substring 35. This way it will never go past 35 characters.
2. If it is a list report:

unlock the report, place a Block into the column you need set to 35 characters
Place the field you need inside the block
Click the block and go to size and overflow. Change the size and choose Content is Clipped. This will clip anything past the size of the block but it wont be as neat as using a substring

B

Thanks for this but have I have already tried both of these.  The substring query for 35 characters is all well and good but the problem is the finite amount of space that I have to work with, ie the box in the cheque itself.  Irrespective of the number of characters of the payee, I want the field to cut off when it gets to the end of the 'row' (for want of a better term) rather than wrap round onto two 'rows'.  For instance, if I size the block to be 5cm, if the payee name is not finished by the end of the box, the rest of the name is truncated and not shown (don't ask me why, user requirement!!).

I have done this in a footer of the report as the cheques themselves are printed at the bottom of the page.  Whenever I have looked in the support guides within Help in CRN, it mentions an 'Allow Word Wrap' function in the left hand properties pane but I have been unable to find this to turn it off.

mikegreen

B,
  In the properties of the text field/block/table item that you have the text in- goto Positioning and Size & Overflow.  Set the width to 5cm (or whatever you need) and then choose "Content is clipped" for overflow.

  I hope I didnt miss an obvious reason that wouldnt work....

Cheers,

Mike

B

Hi Mike

Thanks for the reply, much appreciated and through the replies that I have got I have realised that I was making a huge mistake in that, initially, the text item that I had placed inside the block had properties of its own which I think overwrote some of the other things I was trying to do in the block, I assume that this is due to the hierarchy relationship within CRN.

However (there's always a however isn't there?!)...

I can now clip the block effectively to the required size and stop the text from wrapping but, as I mentioned previously, this is a cheque report with various anti-fraud measures which should be included.Ã,  One of these is that the text in the block should run from right to left, which I know I can do in the properties pane.Ã,  The clip contents property appears to run from left to right, therefore if the text item is larger from the block, with the text item running from right to left and the clip contents of the block runing from left to right, it hacks off information that I require!

So, for example, if I have a supplier called 'Widgets, Sprockets and Gadgets', our accounts package in this table will hold it in a field, all * apart from the supplier name, '******* (and so on until) ****Widgets, Sprockets and Gadgets'.  I want the word 'Gadgets' to be the right most word, aligned to the right of the block, with the field running from right to left so as if I knock off some *, I don't really care.  This all works well until I bring in the content clipping, which I believe runs from left to right so, if the text field turns out to be greater than the size of the block, I could end up with '*****Widgets, Sprockets and', whereas its actually the * I want clipped.


Apologies if this doesn't make sense or that I am gabbling but I believe that this is causing me to go mad and I have users shouting at me a lot as for some reason they don't want to have to hand write cheques (bunch of quitters!).  I would have inlcuded some pics/images to better illustrate the example but I didn't know how to, sorry.

Thanks for all your help so far though, it is much appreciated.

B

JoeBass

Hi B,
  If you haven't tried manipulating the string with a calculation to handle the right to left flow and truncating needs, you could try using an unformatted calculation to display something like the following.  I wrote this RN calculation using SQL Server functions.

if (character_length([Store_Name]) > 7) then
   (
      stuff(
         [Store_Name],
         8,
         character_length([Store_Name]) - 7,
         ''
      )

   )
else
   (
      stuff(
         [Store_Name],
         1,
         0,
         space(7 - character_length([Store_Name]))
      )

   )

mikegreen

Quote from: B on 08 Nov 2005 01:13:54 PM
<snip>
So, for example, if I have a supplier called 'Widgets, Sprockets and Gadgets', our accounts package in this table will hold it in a field, all * apart from the supplier name, '******* (and so on until) ****Widgets, Sprockets and Gadgets'.  I want the word 'Gadgets' to be the right most word, aligned to the right of the block, with the field running from right to left so as if I knock off some *, I don't really care.  This all works well until I bring in the content clipping, which I believe runs from left to right so, if the text field turns out to be greater than the size of the block, I could end up with '*****Widgets, Sprockets and', whereas its actually the * I want clipped.

B,
  Are you using a fixed-width font? If not, I would recommend doing that and then trimming to a known number of characters based on the fixed-width character size.  Courier is the first font that comes to find.. However, there are a fair amount of fixed width fonts that are in Windows (and should be available via Unix too).

  Cheers,

Mike

JoeBass

If you try the calculation and want leading asterisks, and you use SQL Server, you can replace the space function with: 

         replicate('*', (7 - character_length([Store_Name])))

I used narrow field lengths to test out the formula

B

Hi guys

Thanks very much for your feedback on this, it has been v helpful and am sure some of the functions you've used will come in handy in future report writing as well.  When I get chance, I'll try out the ideas.

Thanks again for your time

B

B

Apologies for taking so long to respond to this, basically in the end I ended up persuading the user to change their requirements and also used the suggestions involving Fixed Width text and using the replicate function, which I was unaware with.


Thanks to everyone for your help and advise on the topic.

B