MS Word rtf template - question on formatting of numbers

Hello,
First let me start by saything that this is the first time I've developed using this tool (previously used Report Builder 6i), and I have never used xml or xsl. If I've left out any information, please let me know what else you need. If you could be as specific as possible in your suggestions with syntax, etc. I would really appreciate it.
I have a requirement to format a number as follows:
if negative number display in brackets with comma separators
if zero display as '-'
if positive number display as is with comma separators
sample data would be:
(300)
1,300
I've used the 'Text Form Field Options' Dialogue box to enter the following format: #,##0;(#,##0) and this has given me the first and 3rd requirements. I've used <?xdofx:if SUB_PROG_ENC_YEAR_AMOUNT = 0 then '- ' else SUB_PROG_ENC_YEAR_AMOUNT end if?>to meet the 2nd requirement. However, now I have an alignment issue. When I preview in pdf from Word, the data displays as follows:
(300)
1,300
The positive number needs to shift one space to the left. I tried adding the following condition: else if SUB_PROG_ENC_YEAR_AMOUNT > 0 then SUB_PROG_ENC_YEAR_AMOUNT||' '
but it doesn't let me concatenate a string (I'm guessing because the field is formatted as a number?).
I was going to try leaving the field formatted as regular text, and doing something like this right in the code:
<?xdofx:if SUB_PROG_ENC_YEAR_AMOUNT = 0 then '- 'else if SUB_PROG_ENC_YEAR_AMOUNT >0 then
format-number:SUB_PROG_ENC_YEAR_AMOUNT;'9g999'||' ' else SUB_PROG_ENC_YEAR_AMOUNT end if?>
This doesn't work the way I have it (syntax is wrong), but will it work with the proper syntax or do I have to try another approach?
Any help would really be appreciated
Thank you!

Thanks fo responding.
The spacing in my sample data looks incorrect..sorry about that....what I'm trying to do is align the numbers on the right side, so I would only ever need to add one space to the right side of a positive number. I thought of using rpad to add a single space and using length of the field and a formula in order to generate the padded length, but it doesn't seem to work. The syntax I used was:
<?xdofx:if SUB_PROG_ENC_YEAR_AMOUNT = 0 then '-' else rpad(SUB_PROG_ENC_YEAR_AMOUNT,15,' ') end if?> which just returned the value of sub_prog_enc_year_amount.
For curiosities sake I tried using '*' and '0' as the padded_string. The '0' worked but not the asterisk or the space. It doesn't like string value in the padded_string, I'm guessing because the field is formatted as a number.
That's why I tried using the format number function right in the code (see my original post), but the syntax isn't correct. Would you be able to suggest the proper syntax or point me to to some sample code?
Thank you for your assistance.

Similar Messages

  • Reseting page number in Word RTF template for BI Publisher PDF generation

    Hi!
    Apex 4.0.2, Oracle 10.2.0.4, BIP 10.2
    Bills are created based on Word RTF file with BI Publisher. Reszulting file is one big PDF file, which has many pages.
    Word RTF template is grouped on BILLS.ID field with page break option. So one BILLS.ID may have one or many pages (according data).
    How to create RTF template (for PDF BI Publisher generation) with reseting page numbers when grouping value change.
    Page numbers are in footer in format
    curr_group_page/total_group_pages
    where:
    curr_group_page is current page number in group (defined with BILLS.ID field),
    total_group_pages is total page number of pages in group (defined with BILLS.ID field).
    I need to reset numbering whenever BILLS.ID (group) change.
    Example:
    ID=1 (4 pages)
    1/4, 2/4, 3/4, 4/4
    ID=2 (1 pages)
    1/1
    ID=3 (2 pages)
    1/2, 2/2
    ID=4 (3 pages)
    1/3, 2/3, 3/3
    etc.
    How to achieve that kind of numbering?
    Any help appreciated.
    Regards,
    Damir Vadas
    Edited by: Damir Vadas on May 16, 2011 12:49 PM

    Simple question.. Does your posting deal with an APEX issue or a BI Publisher issue? The posting you have deals with the RTF add-on for Word that builds report layouts for BI Publisher. I suggested in my response that you move it to a more relevant forum..
    If you feel that me alerting you to the fact your are VIOLATING forum policy is an issue, please feel free to ask others their view.. (posting to a 3 year old closed thread, creating MULTIPLE threads for a single issue..) You do NOT seem to get the idea that posting this in the Bi Publisher support forum would probably get you a BETTER response than here.. Asking pl/sql questions here will also get people to refer your questions to the PL/Sql Support forum..
    Also, here is a POSSIBLE answer from the BI Publisher Forum: http://forums.oracle.com/forums/thread.jspa?threadID=594805
    This Is The APEX SUPPORT forum, we deal with SUPPORT questions on APEX (Application Express)..
    Thank you,
    Tony Miller
    Webster, TX
    You know, I used to think that it was awful that life was so unfair. Then I thought, wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? So, now I take great comfort in the general hostility and unfairness of the universe.
    If this question is answered, please mark the thread as closed and assign points where earned..

  • RTF template does not format properly when run from Concurent Manager

    Hi
    I have complex RTF template; many stuff in are in header in word table format,body section again fields are in table format and Footer again in word table format.
    When I run BI Publisher report as concurrent request half the content like header and footer are not displayed. I can see copmlete report when I preview using XML data in word. Is there any limitaions that certan fonts, word format features not supported in RTP template. What is the best way to put header, body and footen in main body area rather using Header and Footer features of word?
    Thanks and regards

    You can use the start:body etc syntax to move your header/footer into the main part of the document. This way you can use form fields.
    Regards,
    Gareth

  • Convert PDFs to Word, RTF, spreadsheets or other formats

    This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/X/pro/using/WS58a04a822e3e50102bd615109794195ff-7eeb.w .html

    How do I convert an entire directory of PDFs to a text format? I would prefer not to have to do them one by one.

  • RTF Template Logo boarders get changed in apps pdf output

    Hi,
    I developed rtf template with logo , rtf page header is 0" and margins are 0.2" and 0.25" (minimum for ms word to print).
    I don't want to have any space b/w header and logo.
    Preview in rtf template in pdf format is showing with correct margins.
    But when i print the pdf preview, the logo changes its positin..ie..margins get changed.
    when i attach to template in apps, the pdf output is coming with different boarders sizes.
    PDF O/P is having space at the header ie..b/w header and logo.
    any suggestions.
    Thanks.

    I figured out why the layout is changing when I print - page scaling option in Adobe was set to 'fit to printable area'. Is there some way that I can ensure whomever prints the file (3rd party provider) has this setting turned off? A command embedded in the template? A config file?
    Any help would be sincerely appreciated.......

  • PO RTF Template: Multiple attachments(long and shor text) displayed once

    Hi
    I have a RTF template for PO output communication program. These are the issues i am facing. could someone help.
    1) The template does not display multiple short text elements for each line number. It only displays the first attachment.
    <LINE_SHORT_TEXT>
    <LINE_SHORT_TEXT_ROW>
    <PO_LINE_ID>54015</PO_LINE_ID>
    <SHORT_TEXT>short text 1</SHORT_TEXT>
    </LINE_SHORT_TEXT_ROW>
    <LINE_SHORT_TEXT_ROW>
    <PO_LINE_ID>54015</PO_LINE_ID>
    <SHORT_TEXT>short text 2</SHORT_TEXT>
    </LINE_SHORT_TEXT_ROW>
    </LINE_SHORT_TEXT>
    In the template this
    <?for-each:LINES_ROW?><?sort:LINE_NUM;'ascending';data-type='number'?>
    <?LINE_NUM?> <?SHORT_TEXT?>
    <?end for-each?>
    2) The template does not display the multiple attachments(long text) for each line number. It only displays the first attachment.
    </DISTRIBUTIONS_ROW>
    </DISTRIBUTIONS>
    </LINE_LOCATIONS_ROW>
    </LINE_LOCATIONS>
    </LINES_ROW>
    </LINES>
    <LINE_ATTACHMENTS>
    <TEXT>long text attachment which is 2nd note.</TEXT>
    <ID>53995</ID>
    <TEXT>see this 5th long atta</TEXT>
    <ID>53995</ID>
    <TEXT>long text 1</TEXT>
    <ID>54015</ID>
    <TEXT>long text 2</TEXT>
    <ID>54015</ID>
    </LINE_ATTACHMENTS>
    In the template i am doing this
    <?if: PO_DATA/LINE_ATTACHMENTS/TEXT !=''?>
    <?for-each:LINES_ROW?><?sort:LINE_NUM;'ascending';data-type='number'?>
    <?if:LINE_NUM!=''?> <?concat('Line Number ',LINE_NUM)?> <?end if?>
    <?variable@incontext:PoLnID;'PO_LINE_ID'?>
    <?/PO_DATA/LINE_ATTACHMENTS/ID[child::text()=$PoLnID]/preceding-sibling::TEXT[1]?>
    <?end for-each?>
    3) Also I want the Total amount to be printed on the last page but the total amount header should still be there on every page and has "Continued" text when it has multiple pages.
    4) Also the Text File attached to PO is not seen in the PDF PO. is there anything for it do ?
    Please help
    Thanks
    Edited by: user525275 on May 1, 2009 2:14 PM

    Hi Tim,
    You are quite right... I'm trying to associate each of the text attachments with the proceeding ID.
    I've simplified it (sorry, I hadn't turned on the monitoring of the forums) in the following forum post:
    Basic RTF template question
    BTW, thanks for your blog. It's been very helpful.
    Cheers,
    Andrew

  • Conditional Formatting in RTF templates

    HI
    I am just going around with designing of rtf templates. I have a question regarding the conditional formatting feature. The question is
    IF i am having different type of customers(corporate,individual,etc..) passed as parameters, Can an particular cell be formatted with different colors for different customers. for example, if the parameter is corporate customer the the color of particular cell should be RED in color, and if parameter is Individual the color of cell Must be GREEN in color.
    Please help me out with this.
    Thanks in advance

    Yes you can conditionally format the individual cells.
    Take a look at the guide (link provided) and search for "Cell Highlighting":
    http://docs.oracle.com/cd/E10415_01/doc/bi.1013/e12187/T421739T481157.htm
    Example code: <?if:debit>1000?><xsl:attribute xdofo:ctx="block" name="background-color">red</xsl:attribute><?end if?> <?debit?>
    Thanks,
    Bipuser

  • How can I get the template( word rtf )  for PO – Printed Purchase Order ?

    I want to convert the “PO - Printed Purchase Order” report from Oracle rdf format to BI Publisher. I am looking for the template but could not find in UNIX.
    As per the Oracle blog, the template is available. Please see the URL : https://blogs.oracle.com/xmlpublisher/resource/121BIPReports.pdf
    The template code is POXPRPOL_XML.rtf
    when I look at the $PO_TOP/patch/115/publisher/templates/US directory, I cannot find POXPRPOL_XML.rtf
    How can I get the template( word rtf ) for PO – Printed Purchase Order ?
    Thank you,
    Biju Varghese.

    How can I get the template( word rtf ) for PO – Printed Purchase Order ? XML Publisher Administrator -> Templates
    find by code or name
    open it and you can downloadtemplate by "download" button

  • How to create rtf template to view report in Word and Excel, with numeric f

    Hi,
    Please help me!
    How to create rtf template to view report in Word and Excel, with numeric formatted fields (like this 999 999 999,99 with spaces between numbers) and then end user be able to process those fields with Excel tools (sum, etc).
    Thank you.

    From what I have seen Excel can not handle 999 999 999.00. You can use 999999999.00 and then format it as you want in the xls bt you can not have values like 999 999 999.00 coming from publisher output and have functions on the values in Excel
    Tim

  • Basic question, how to create rtf template with a given xml file

    Hello guys
    I am new to BI publisher and I am learning how to create rtf templates using given xml fiel definitions by following the bi publisher guide
    The steps I am following is:
    1, create template using template builders, which is downloaded into MS words.
    2, In the empty template, map the xml columns with template field using BI publisher tag
    3, upload the template to BI Publisher as a layout.
    That's all I can understand.
    My question is:
    1,in which above step do I import XML file into template builder (if not bi publisher), how to do so?
    2,After template is created, how to associate this template layout with existing reports in BI Publisher, or is it necessary at all?
    3,In the template content in MS Word template builder, what should I enter other than BI publisher tags for mapping XML field to desired template field
    Or, if my understand of this process is entirely wrong, what's the right process of creating rtf template with a given XML file definition
    Thanks

    If you have a BI Publisher desktop installed, have a look a the demos,.. should answer most of your basic questions.
    (Windows) Start->Programs->Oracle BI Publisher Desktop->Demos
    Invoice Demo - good one for those with E-Business Suite
    Report Demo - Sample using BI Publisher

  • RTF templates and word cell padding.

    Hi.
    I'm having a problem with numbers in an XML Publisher report. Generated RTF templates don't seem to retain the cell padding properties.
    Has anyone got any suggestions on how to get round this?
    Thanks.
    Steve.

    Well there appears to be a bug in the RTF generator.
    It appears that Oracle want to use paragraph left and right indentation properties to pad text in cells away from cell borders. There is a bug in the rtf reader in word that causes problems if cell padding properties are used so paragraph indentation appears a sensible work round.
    By default there appears to be a left hand indentation of 5 applied to all paragraphs in cells. If a left hand cell maring is applied to cells then the left hand cell margin in the report increases in size.
    However, right hand cell margins appear to be ignored and NOT written as attributes to cell paragraph text in the the generated report, and this causes problems when trying to print an RTF report as numbers in cells get clipped by cell borders.
    Edited by: user7137712 on 18-Mar-2010 03:21

  • How to Format number in RTF template?

    Hi,
    In RTF template i am using Format_number for custom requirement. when i am using below conditon <?format-number(ENTERED_CR,'##,##0.00')?> number is getting formatted if above 1000 only. My requirement is 1). 444 should format like 444.00 2). 444.55 should format like 444.55 only. Can anyone suggest on this ASAP.

    in the next time use BI Publisher forum - BI Publisher
    <?format-number(ENTERED_CR,'##,##0.00')?>it's works for me
    output:
    444    ->  444.00
    444.55 ->  444.55

  • PDF formating issue in RTF Template

    Hi,
    I have an XML for which i have data for both subavisor level and fund level and the data at each fund level are derived/aggregated from Subadvisor level(using complex formula which is taken care at the database level not at the RTF level).
    I need to show both Fund level data and SubAdvisor level data in the report, so i have designed the required RTF Template to show the Sub Advisor level data for each fund Level Data.
    The Sample XML is(i have only included one SubAdvisorLevel data(XYZ) for the Fund(ABC) :
    <DATA_DS>
    - <G_1>
    <FUND_NAME>ABC</FUND_NAME>
    <SUB_ADV_ANA_MIL>1234</SUB_ADV_ANA_MIL>
    <MGMT_FEE_PAID>1234</MGMT_FEE_PAID>
    <MGMT_FEE_PAID_O>NA</MGMT_FEE_PAID_O>
    <MGMT_FEE_BP>1234</MGMT_FEE_BP>
    <MGMT_FEE_BP_O>NA</MGMT_FEE_BP_O>
    <TA_BILLABLE_ASSET>NA</TA_BILLABLE_ASSET>
    <TA_FEES_PAID>NA</TA_FEES_PAID>
    <TA_FEES_PAID_O>NA</TA_FEES_PAID_O>
    <TA_EFF_BP>NA</TA_EFF_BP>
    <TA_EFF_BP_O>NA</TA_EFF_BP_O>
    </G_1>
    - <G_1>
    <FUND_NAME>ABC</FUND_NAME>
    <SUB_ADV_NAME>XYZ</SUB_ADV_NAME>
    <SUB_ADV_ANA_MIL>123</SUB_ADV_ANA_MIL>
    <MGMT_FEE_PAID>123</MGMT_FEE_PAID>
    <MGMT_FEE_PAID_O>NA</MGMT_FEE_PAID_O>
    <MGMT_FEE_BP>123</MGMT_FEE_BP>
    <MGMT_FEE_BP_O>NA</MGMT_FEE_BP_O>
    <TA_BILLABLE_ASSET>NA</TA_BILLABLE_ASSET>
    <TA_FEES_PAID>NA</TA_FEES_PAID>
    <TA_FEES_PAID_O>NA</TA_FEES_PAID_O>
    <TA_EFF_BP>NA</TA_EFF_BP>
    <TA_EFF_BP_O>NA</TA_EFF_BP_O>
    </G_1>
    - <G_1>
    Because of this structure the XML, i have designed the RTF template by putting the following code:-
    <?for-each-group:G_1;./FUND_NAME?><?sort:current-group()/FUND_NAME;'ascending';data-type='text'?>
    <?FUND_NAME?> <?SUB_ADV_ANA_MIL?> ............................................(other Attributes are also present)
    <?for-each-group:current-group();./SUB_ADV_NAME?> <?if:SUB_ADV_NAME!=''?> <?SUB_ADV_ANA_MIL?>............(other Attributes are also present)
    <?end if?><?end for-each-group?>
    The only issue i am facing while exporting this RTF Template to PDF is that i am getting a blank row in the PDF(because of the condition <?if:SUB_ADV_NAME!=''?> ) for the 1st level of Sub Advisor level Grouping and there after all the Sub Advisor level data are coming up fine.
    Can you please help me out in resolving this issue

    Thanks Bipuser,
    But the inlines function in not giving the desired result, it is working in the same way even if i haven't put any condition.
    The problem with the existing condition <?if:SUB_ADV_NAME!=''?> is that only PDF is generated with the extra space and Excel does not comes up any space.
    Please let me know if you need any further information from my end.
    Thanks again,
    Regards
    Mrinal

  • Problem in RTF template

    Hi all,
    I use Bi publisher version (11.1.6 )
    First Question : What is the best template type for making operational reports not statistical report ( RTF template or PDF template or others ) ? --
    Second Question :
    when i try to make report template using RTF template in ms-word by using Bi publisher desktop
    1- How can i make repeating header dynamically ( header contain data from data model ) ?
    2- when i insert an image in the header it did't appear in the runtime ?
    3- when i insert line in the header it did't appear completely just part of the line .

    First Question : What is the best template type for making operational reports not statistical report ( RTF template or PDF template or others ) ? --it will be clear if you look at "Table 2-6 Valid Output Formats for Each Layout Type" - http://docs.oracle.com/cd/E23943_01/bi.1111/e22254/create_report_new.htm#layout_config
    Second Question :
    when i try to make report template using RTF template in ms-word by using Bi publisher desktop
    1- How can i make repeating header dynamically ( header contain data from data model ) ?did you try
    >
    To repeat header rows:
    Select the row(s) that you want to repeat on each page.
    From the Table menu, select Heading Rows Repeat.
    from http://docs.oracle.com/cd/E23943_01/bi.1111/e22254/create_rtf_tmpl.htm#BHBFEJJI ?
    2- when i insert an image in the header it did't appear in the runtime ?
    3- when i insert line in the header it did't appear completely just part of the line .did you try "4.5 Defining Headers and Footers" http://docs.oracle.com/cd/E23943_01/bi.1111/e22254/create_rtf_tmpl.htm#do_handf ?

  • Convert XSL-FO template back to RTF template

    Report's layout that I have to create has strict size requirements (e.g. page margins, cell sizes and so on).
    I created a simple RTF template using MS Word. RTF template meets this size requirements but when I print my report using Acrobat Reader report looks different.
    I know that this happens because at runtime BI Publisher converts report to XSL-FO automatically to XSL-FO and only after that it renders pdf.
    In order to meet thissize requirements I converted my RTF template to XSL-FO stylesheet using Template Builder and changed appropriate cells and margins etc. manually.
    And everything works well but now I know that there will be a lot of changes in this report's layout (e.g. several complex tables will be added).
    It's quit difficult for me to create tables in XSL-FO. And so my question is
    HOW CAN I CONVERT MY XSL-FO STYLESHEET BACK INTO RTF FORMAT WITH ALL THE LOGIC IT HAS?
    BI Publisher Release 10.1.3.4
    Thanks.
    Edited by: Ruslan on 20.07.2011 5:22

    No way , you can't go back.

Maybe you are looking for

  • Need correct cable to run from iMac to 32 inch Samsung Tv

    Can anyone tell me how I can view Netlix  on my tv after pulling it up on my imac ?  Any links would be appreciated,,,,,,,Thanks--Rick

  • How to get Itunes to actually work? cant use it. Help

    Since upgrade nothing is working right. It doesn't recognize my iphone or ipad, evrything that I need to do is grayed out where I cant use it. What is the use of having this if it isnt going to work? It doesn't sync, won't let me restore from backup.

  • Assign plan/budget profile for internal order

    i just tried to use T-code KO22 to do change budget for an order, but error msg show 'Assign a plan or Budget profile to the object'.so i wonder how to create the plan or Budget profile and assigned it?  waiting for your answer....

  • Trigger Idoc by using the Output type in Z function module

    My requirement is when I run Z function module then  Idoc should be send which is configured in Output Type. Means when ever i run the Functional module that Output type should be triggered.? Does any one have solution??

  • Uploading CSV file

    Hi, i saved excel file into CSV file in that file amount filed contains comma.now iam uploading csv file into internal table using GUI_UPLOAD iam getting data into internal table. internaltable contains row  like 1100,600000,1114,"1,89",Hours on Proj