This is a discussion on Re: [Info-Ingres] Report Writer within the Ingres forums, part of the Database Server Software category; --> Thanks for the replies I've received so far. I may have misled a few people with the "trailing space" ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Thanks for the replies I've received so far. I may have misled a few people with the "trailing space" line. I'm actually after a solution with no space padding either side. So far the only solution that definitely works is to build an IF statement depending on the size of the data and provide individual format statements like this: ..DETAIL .IF col1 < 10 .THEN .TFORMAT col1 ("z.nn") .ELSEIF col1 < 100 .THEN .TFORMAT col1 ("zz.nn") .ELSEIF col1 < 1000 .THEN .TFORMAT col1 ("zzz.nn ") .ELSEIF col1 < 10000 .THEN .TFORMAT col1 ("zzzz.nn") .ELSEIF col1 < 100000 .THEN .TFORMAT col1 ("zzzzz.nn") .ELSEIF col1 < 1000000 .THEN .TFORMAT col1 (" zzzzzz.nn") .ELSEIF col1 < 10000000 .THEN .TFORMAT col1 ("zzzzzzz.nn") .ELSEIF col1 < 100000000 .THEN .TFORMAT col1 ("zzzzzzzz.nn") .ELSEIF col1 < 1000000000 .THEN .TFORMAT col1 (" zzzzzzzzz.nn") .ELSEIF col1 < 10000000000 .THEN .TFORMAT col1 ("zzzzzzzzzz.nn") .ENDIF .PR col1 It's not very pretty but so long as I cover the maximum size it works. Jon Gibson Senior Database Administrator Hiscox Plc T: +44 (0)20 7448 6820 F +44 (0)20 7448 6899 www.hiscox.com -----Original Message----- From: info-ingres-bounces@kettleriverconsulting.com [mailto:info-ingres-bounces@kettleriverconsulting.com] On Behalf Of Gibson Jonathan Sent: 22 January 2007 15:37 To: Info-Ingres@kettleriverconsulting.com Subject: [Info-Ingres] Report Writer Hi Folks, I'm looking some help on what would appear to be a trivial formatting issue in report writer but has been bugging me for the last couple of hours. I looking to produce a report that has large numeric values. By default, Report Writer (RW) is converting these values into scientific notation, ie. 12000000 is becoming 1.200e+007. Expanding this by using a format code such as -zzzzzzzzzzzzzz.nn works fine apart from the trailing spaces it puts in - the report can't have these. I've tried converting the value to a varchar and then using squeeze but RW doesn't like it, i.e. .pr SQUEEZE(VARCHAR(premium("-zzzzzzzzzzzzzz.nn"))) produces the following error at run time E_RW107C Expected comma or closing parenthesis for function call in header text for 'detail'. Line with error: 'pr squeeze(varchar(premium("zzzzzzzzzzzzzzz.nn"))),', ''. Error check continues . . . I've also looked at trying to use the sql flags for expanding numeric values (i.e. the -f and -F flags) but the manuals suggest that these aren't available when running report. Any help much appreciated. Jon Gibson Senior Database Administrator Hiscox Plc T: +44 (0)20 7448 6820 F +44 (0)20 7448 6899 www.hiscox.com ************************************************** ******************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. No one else is authorised to distribute, forward, print, copy or act upon any information contained in this email. If you have received this email in error, please notify the sender. Hiscox Syndicates Limited, Hiscox Insurance Company Limited, Hiscox Underwriting Limited and Hiscox Investment Management Limited are authorised and regulated by the Financial Services Authority. Hiscox plc is a company registered in England and Wales under company registration number 2837811 and registered office at 1 Great St Helen's, London EC3A 6HX ************************************************** ******************** __________________________________________________ ___________________ This message has been checked for all known viruses by blue-source. For further information visit www.blue-source.com powered by Messagelabs __________________________________________________ ___________________ This message has been checked for all known viruses by bluesource. For further information visit www.blue-source.com powered by Messagelabs __________________________________________________ ___________________ This message has been checked for all known viruses by blue-source. For further information visit www.blue-source.com powered by Messagelabs |
| Thread Tools | |
| Display Modes | |
|
|