SRW.SET_FORMAT_MASK

i user SRW.SET_FORMAT_MASK('NNNNNNNNNNNPR'); for format the number in report,
the result must me like <1000> for -1000 but when i use SRW.SET_FORMAT_MASK('NNNNNNNNNNNPR'); package the result be like >1000<

If you want to display 4 decimal places you need to set decimalDigit="4". Also, make sure nothing is happening to the value before your graph gets it that would cause it not to display correctly.
Here is what the DTD for graphs looks like for the ViewFormat element:
<!-- ViewFormat specifies number formatting-->
   <!ELEMENT ViewFormat EMPTY >
   <!-- ViewFormat attributes
   numberType: format numbers as currency or percent?
   thousandSeparator: character for separating thousands
   decimalSeparator: character for separating whole number from decimal
   currencySymbol: currency symbol; numberType must be NUMTYPE_CURRENCY
   leadingZero: display leading zeros?
   decimalDigit: number of decimal digits to display
   posNumFmt: format for positive numbers
   negNumFmt: format for negative numbers
   posCurFmt: format for positive currency
   negCurFmt: format for negative currency
   scaleFactor: how much to scale (abbreviate) numbers
   scaleDownThousands: character(s) to use when numbers represent thousands
   scaleDownMillions: character(s) to use when numbers represent millions
   scaleDownBillions: character(s) to use when numbers represent billions
   scaleDownTrillions: character(s) to use when numbers represent trillions
   scaleDownQuadrillions: character(s) to use when numbers represent
        quadrillions
   javaDateFormat: Java date format
   oracleDateFormat: Oracle date format
"used" attributes specify whether one of the above properties has
   been explicitly set; used for merging when using rules
   -->You would put this inside your X or Y axis element like:
<Y1Axis lineWidth="1">
<ViewFormat decimalDigit="4" decimalSeparator="." decimalDigitUsed="true" decimalSeparatorUsed="true"/>
</Y1Axis>I don't see your X axis anywhere...maybe it it your "O1Axis" but I don't see that either, I only see "O1Title","O1TickLabel", etc.

Similar Messages

  • SRW.Set_Format_Mask not working!!

    Hi,
    I want the number to be displayed as : 500.00 or 100.00 or 10.00 or 1.00
    This format mask works in the DB
    SQL> select to_char(100,'99999990.9999') from dual;
    TO_CHAR(100,'9
          100.0000I right click on the Graph embedded with the report, and select "PL/SQL Editor" and added the following Format Trigger.
    function CT_1FormatTrigger return boolean is
    begin
        srw.set_format_mask('99999990.9999');
        return (TRUE);
    end;Now when I run the report, I am not seeing the X-axis number format as 1.00, 5.00.
    Why is this not working?
    Thanks

    If you want to display 4 decimal places you need to set decimalDigit="4". Also, make sure nothing is happening to the value before your graph gets it that would cause it not to display correctly.
    Here is what the DTD for graphs looks like for the ViewFormat element:
    <!-- ViewFormat specifies number formatting-->
       <!ELEMENT ViewFormat EMPTY >
       <!-- ViewFormat attributes
       numberType: format numbers as currency or percent?
       thousandSeparator: character for separating thousands
       decimalSeparator: character for separating whole number from decimal
       currencySymbol: currency symbol; numberType must be NUMTYPE_CURRENCY
       leadingZero: display leading zeros?
       decimalDigit: number of decimal digits to display
       posNumFmt: format for positive numbers
       negNumFmt: format for negative numbers
       posCurFmt: format for positive currency
       negCurFmt: format for negative currency
       scaleFactor: how much to scale (abbreviate) numbers
       scaleDownThousands: character(s) to use when numbers represent thousands
       scaleDownMillions: character(s) to use when numbers represent millions
       scaleDownBillions: character(s) to use when numbers represent billions
       scaleDownTrillions: character(s) to use when numbers represent trillions
       scaleDownQuadrillions: character(s) to use when numbers represent
            quadrillions
       javaDateFormat: Java date format
       oracleDateFormat: Oracle date format
    "used" attributes specify whether one of the above properties has
       been explicitly set; used for merging when using rules
       -->You would put this inside your X or Y axis element like:
    <Y1Axis lineWidth="1">
    <ViewFormat decimalDigit="4" decimalSeparator="." decimalDigitUsed="true" decimalSeparatorUsed="true"/>
    </Y1Axis>I don't see your X axis anywhere...maybe it it your "O1Axis" but I don't see that either, I only see "O1Title","O1TickLabel", etc.

  • SRW.SET_FORMAT_MASK('NNNNNNNNNNNPR');

    i user SRW.SET_FORMAT_MASK('NNNNNNNNNNNPR'); for format the number in report,
    the result must me like <1000> for -1000 but when i use SRW.SET_FORMAT_MASK('NNNNNNNNNNNPR'); package the result be like >1000<

    You may be right. However I checked this as well and the legnth was 10 in the database (pre_val_amt = number(12,2)) and the other field that is not giving me the issue has the same length but it generates exact output.
    Any other clues?

  • SRW package not working in Reports 10g (9.0.4)

    Dear All,
    I am using reports services 10g (9.0.4) for RHEL o/s.we are using SRW pkg in our reports heavily.But when we compile reports in Linux it is showing errors like SRW.message ,SRW.set_field_char,SRW.set_format_mask must be declared.
    Though these functions are well written in reports help,it is not at all supporting these functions.
    What is solution for this for successfull compilation of reports??
    Regards-
    Onkar Vidwans
    INDIA

    Your not seeing the built in package for some reason.
    Maybe they are missing on your Linux machine.
    Reinstall reports there? Examing your environment variables?
    Is that rwrun.jar anywhere?

  • How to get the width of a numeric field at runtime

    Hi, everyone :D
    Is there a built-in that let me get the width of a numeric field at runtime? The SRW bulit in only has the SWR.GET_PAGE_NUM built-in. Is there something like the Get_item_property of Forms IN Report?
    Thanks
    Edited by: user12422762 on 07-ene-2010 14:16
    Edited by: user12422762 on 07-ene-2010 14:30
    Edited by: user12422762 on 08-ene-2010 4:40
    Edited by: user12422762 on 08-ene-2010 4:50

    Hi. Thanks for answering. I need the width because i want to set the format of the field at runtime. The quantity of decimal digits for all the numeric fieds in the report is received as a parameter.
    I can use a function to create the respective decimal mask ('D99,'D999',etc.) and then call the SRW.SET_FORMAT_MASK in the format trigger of every single field, but i'd have to type the mask of the integral part of the number in the code of the trigger ('99G999D99, '999G999G999D'). However, If i could get the width, i'd just create a function and call it from every format trigger.
    Edited by: user12422762 on 08-ene-2010 10:05
    Edited by: user12422762 on 08-ene-2010 10:06
    Edited by: user12422762 on 08-ene-2010 10:08

  • Convert a field to_number and use formatmask

    I like to convert a field into a number SRW.Set_field(0, to_number(:fieldname));
    as well create this mask 'N.NNN.NNN.NNN.NNN.NNN'
    SRW.SET_FORMAT_MASK('N.NNN.NNN.NNN.NNN.NNN'); or SRW.ATTR.FORMATMASK := 'N.NNN.NNN.NNN.NNN.NNN';
    All this srw doesn't work, why?

    The field doesn't have a datatype. The field's datatype is picked up from the column that is its source. Therefore, the datatype of a field is fixed at runtime and can't be changed.
    The srw.set_field_number() built-in only sets the value of a field, it doesn't change the field's type. If the datatype of the source column for a field was not "number" then the above call would have no effect.
    Likewise, the srw.set_format_mask() built-in only effects fields whose datatype is number.
    It sounds like what you're doing is trying to display both Character and Number values in a single field. The only way to do this with a single field is to base the field on a character column and do the formatting either in the SQL or PL/SQL that is the source of the column. This will limit you to the format masks available in both SQL or PL/SQL.
    Another way of doing it is to create 2 fields. One for the number value and one for the character value. Place the fields on top of each other and use format triggers to display one or the other. You can then use the srw.set_format_mask() against the number field if required.

  • How to set Character field's Format Mask?

    dear all,
    how to set Character field's Format Mask?
    i searched the forum and found the following, where can i use this code and how to change and set its format mask.
    SRW.SET_FORMAT_MASK('mask');
    Thanks
    Muhammad Nadeem

    Nadeem,
    If you have database 10g, look into function REGEXP_REPLACE. Otherwise you can also try this (you might already know).
    SELECT SUBSTR('CHHOCMIPO07020001', 1,2)||'-'||SUBSTR('CHHOCMIPO07020001' ,3,2)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 5,2)||'-'||SUBSTR('CHHOCMIPO07020001' , 7,3)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 10,2)||'-'||SUBSTR('CHHOCMIPO07020001' , 12,2)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 14,4)
    FROM dual
    CH-HO-CM-IPO-07-02-0001
    If you have to use this at many places, create a function, pass the raw value, manipulate the string and return.
    FS

  • How to handle a running number field in the report?  How to format it to be (a), (b),

    Hi,
    I'm very new in Oracle Report...
    Does anybody know how to generate a running number in oracle report? for eg. 1,2,3,4....
    Is there anyway to format these running number to i,ii,iii,iv,v,vi.... or a,b,c,d,e....
    Thanks

    Here is one way to do this:
    In the data model create a function and a placeholder in the group you want the numbers/letters to show. Set the placeholder name to cp_count and the datatype to number. Set the formula's formula to read:
    :cp_count := nvl(:cp_count,0) + 1;
    return :cp_count;
    And in the conditional formatting property of the field you want to show 1,2,3 or i,ii,iii in the layout editor add either:
    srw.set_format_mask ('RN');
    or
    srw.set_format_mask ('NNN');
    return true;
    I couldn't figure out how to get the a,b,c one'es to work easily. You can put in a large IF statement to return a for 1, b for 2, as in "if :cp_count = 1 then return 'A'
    Hope this helps

  • Custom Date and Number Formats

    Is there a way in disco admin to set the date format based on values from the database?
    For example, we have a function that we use in Oracle Reports (p_indicator passed in):
    CASE p_indicator WHEN '1'
    THEN v_format := 'MM/DD/YYYY'; -- US Date format
    ELSE v_format := 'DD-Mon-YYYY'; -- Foreign Date format
    END CASE;
    return v_format;
    In the Oracle Report field Format Trigger we use (iss_date_field_display is the database field indicator from the report SQL):
    SRW.SET_FORMAT_MASK(format_mask(:iss_date_field_display));
    So, any way to dynamically change the format mask for date and/or number fields in Discoverer based on data in the schema and/or a function?
    Thanks!

    Thank you,
    What would be the best way to call this function in a workbook?
    i created a function in the schema, and tied it to a calculation in the workbook, but the dbms lines fail. if i comment them out, i get a return, otherwise, the return is not getting set. here is the work...
    BEGIN
    dbms_session.set_nls('nls_currency', '''£''');
    CASE p_indicator WHEN '1'
    THEN
    dbms_session.set_nls('nls_date_format', '''MM/DD/YYYY'''); -- US Date format
    v_format := 'MM/DD/YYYY';
    ELSE
    dbms_session.set_nls('nls_date_format', '''DD-Mon-YYYY'''); -- Foreign Date format
    v_format := 'DD-Mon-YYYY';
    END CASE;
    RETURN v_format;

  • Formatting Character values

    Guru's,
    I have a character (varchar2) field I need formatted 9999-99-999-999 (It's an NSN - National Stock Number). I want to use srw.set_format_mask, but that only works for date/number fields. I have the field formatted FMXXXX"-"XX"-"XXX"-"XXXX in forms, but what is the correct way to format it in Reports? Seems like such a simple task but I can't find an easy resolution.
    Thanks in Advance
    abc

    i figured it out on my own - in format trigger
    function F_nsnFormatTrigger return boolean is
    tmp varchar2(16);
    begin
         if :nsn <> 'N/A' then
         tmp := substr(:nsn,1,4)||'-'||substr(:nsn,5,2)||'-'||substr(:nsn,7,3)||'-'||substr(:nsn,10,4);
         srw.set_field_char(0,tmp);
         end if;
         return (TRUE);
    end;

  • Decimal format in Excel output

    In one of my Excel output reports, I'm setting the number format dynamically as SRW.SET_FORMAT_MASK('LNNNGNNNGNNNGNN0D0');
    to display just one decimal place but this works for numbers less than 1000 and it displays two decimal places for numbers 1000 and greater. However, this works for all numbers inside the Reports Builder but I'm getting this issue when I run the reports in the web using rwservlet with desformat as SPREADSHEET. Any help would be appreciated.
    Thanks
    Krishnamurthy

    Hi,
    Thanks a lot and thanks for your time and good solution.
    This the syntax is used for Date datatype :<?format-date:CREATION_DATE;' MON- YY'?>
    and for varchar data type <?concat(' ',/XLAAARPT/P_PERIOD_FROM)?>.
    Thanks & Regards
    Srikkanth

  • FUNCTION IS NOT WORKING WHEN RUN IN SRW.RUN_REPORT, URGENT

    Hi,
    I have a report. it has got 1 Query and 2 groups.
    Q1
    |
    |
    __G1__
    |F1 |
    |F2 |
    |F3 |
    |
    |
    |
    __G2__
    |Items|
    |Sales|
    | Qty|
    |Store|
    |Func4|
    |Func5|
    |Func6|
    The Query looks like above. Now In the report I have a 3 User parameters . For Each record in G2 the functions Func4,Func5 and Func6 adds the value to the user parameters at the report level.
    Now the Func1,Func2,Func3 takes the value of last 4 record for each item at each G1 Level and devides it by 4 and prints . As an example given below
    ITEMS-----SALES-------QTY-----------STORE
    10001-----10000-------200-------------100
    10001-----20000-------500-------------200
    10001-----15000-------350-------------175
    10001-----45000-------650-------------225
    10001-----50000-------700-------------300
    AVERAGE==>32500-------550-------------225 ==> Calculated by F1,F2,F3
    20001-----70000-------900-------------400
    20001-----30000-------600-------------350
    20001-----20000-------500-------------300
    20001-----25000-------450-------------275
    20001-----35000-------550-------------225
    20001-----65000-------800-------------400
    AVERAGE==>36250-------650-------------300 ==> Avg of last 4 records
    This report takes an parameter which is part of the Where condition of the Query Q1. If I run this report from the report builder and provide the value for the parameter then the report runs fine printing the exact values. If I run the report from another report(which I have to do, due to circumstances) using SRW.Run_Report and pass the parameter in the same command. The the function FUNC4, FUNC5, FUNC6 does not do the addition, as a result the Func1,Func2,Func3 returns 0. I dont know why this is happenning .
    This is very very URGENT, My project manager is on my head to finish it ASAP. Please help.
    Thanks
    Feroz

    Hi Toby and Danny,
    Thanks for the quick reply. I dont think I am having an interdependancy of the functions. Here is an sample what two functions do at each level
    Func6 =========> This function at group level G2
    begin
    -- To initialize the user parameter for each new item.
         If :CNT = 1 Then
              :Wk4_Pos_Qty := 0;
         End If;          
    -- to add the qty value to the user parameter for last 4 records. Uchange is the no of records for each item     
    If :CNT >= :UCHANGE - 3 Then
         :Wk4_Pos_Qty := :Wk4_Pos_Qty + :Qty;
    End If;     
    return 0;
    end;
    Func3 ======> this function at group level G1
    Begin
    -- if no of records are less than 4 then devide by the no of records or devide by 4.
         If :UChange < 4 Then
                   return((:Wk4_Pos_Qty + :Qty) / :UChange);
         Else
                   return((:Wk4_Pos_Qty + :Qty)/ 4);     
         End If;     
    end;
    Here Wk4_Pos_Qty is the User parameter created to hold the calue for the Um of last 4 records Qty.
    I tried to modify the Func3 so that it looks like this
    Func3
    begin
    srw.reference(:Wk4_Pos_Qty);
         If :UChange < 4 Then
                   return((:Wk4_Pos_Qty + :Qty) / :UChange);
         Else
                   return((:Wk4_Pos_Qty + :Qty)/ 4);     
         End If;     
    end;
    But it does not effect anything. I mean its the same. The Wk4_Pos_Qty returns 0 and Func3 returns 0.
    Any Suggestions .
    Thanks
    Feroz

  • SRW.Run_Report is not working in Reports from 6i to 10g

    Hi,
    I have a report .rdf file that submits another .rdf report using the SRW.Run_Report. This code was working fine in Reports 6i version. We are upgrading the Reports 6i to Reports 10g, and did a small change in the call i.e., Removed the server parameter, and it is not working. This is in Oracle E-Business Suite environment. The first report is called as a Concurrent Program. Here is the call that was working fine in Reports 6i (i.e., Oracle Apps 11i environment)
    srw.run_report('report='||l_source_dir||l_parent_shortname||'.rdf'||
    ' p_user_id='||l_user_id||
    ' p_resp_id='||l_resp_id||
    ' p_appl_id='||l_appl_id||
    ' p_conc_request_id='||
    ' batch=yes mode=character destype=file desname='||l_destination_dir||l_filename||
    ' desformat=verp_i012 p_vendor_id='||dealer_list_rec.vendor_id||
    ' p_trx_date_from='||to_char(l_date_from, 'DD-MON-RRRR') ||
    ' p_trx_date_to='||to_char(l_date_to,'DD-MON-RRRR') ||
    ' p_period_name='||l_period_name ||                                                                      
    ' server='||l_server
    It has been modified to the following for Reports 10g (i.e., Oracle Apps R12 environment)
    srw.run_report('report='||l_source_dir||l_parent_shortname||'.rdf'||
    ' p_user_id='||l_user_id||
    ' p_resp_id='||l_resp_id||
    ' p_appl_id='||l_appl_id||
    ' p_conc_request_id='||
    ' batch=yes mode=character destype=file desname='||l_destination_dir||l_filename||
    ' desformat=verp_i012 p_vendor_id='||dealer_list_rec.vendor_id||
    ' p_trx_date_from='||to_char(l_date_from, 'DD-MON-RRRR') ||
    ' p_trx_date_to='||to_char(l_date_to,'DD-MON-RRRR') ||
    ' p_period_name='||l_period_name
    );

    Thank you for your reply.
    Yes, it's done using MOD-PLSQL version 10.1.2.0.2.
    I did as you said: compared the 2 generated HTML files. It's not that it doesn't generate all tags. It generates all tags but some of them are different, that is it screws them up.
    Here it is some example code.
    For example, in 9i I have the following code:
    div id=div_plus_GENERALE style="cursor:hand; display:none;"
    <td> width=8 </td>
    <td id=butt align=left style="font-family:Verdana,Tahoma;
    font-size: 10px; font-weight: 400; color: '#ffffff';
    background-color: '';
    "onClick="if (butt_clicked) butt_clicked.style.cssText=restore_butt_style;
    butt_clicked=this; restore_butt_style=butt_off_lit;
    this.style.cssText=butt_on_lit;
    var x = document.getElementById('Freccia_' + freccia_old);
    x.style.display = 'none';
    Freccia_sitointer_anagrafica_anagrafica_cliente_punto.style.display='block';
    freccia_old='sitointer_anagrafica_anagrafica_cliente_punto';"
    onMouseOver="this.style.cssText=butt_on_lit;"
    onMouseOut="if (butt_clicked != this) this.style.cssText=butt_off_lit;">Anagrafica Fornitura</td></tr>
    <tr>
    <td height=2></td>
    </tr>
    </table>
    In 10g the HTML code looks like this:
    div id=div_plus_GENERALE style="cursor:hand;"
    <td width=8> </td>
    <td align=left style="font-family:Verdana,Tahoma;
    font-size: 10px; font-weight: 400; color: '#ffffff';
    background-color: '';">
    <a href="sitointer.anagrafica.anagrafica_cliente_punto target="frameCenter"
    onClick="var x = document.getElementById('Freccia_' + freccia_old);
    x.Style.visibility='hidden';
    Freccia_sitointer_anagrafica_anagrafica_cliente_punto.Style.visibility='visible';
    freccia_old='sitointer_anagrafica_anagrafica_cliente_punto';"
    onMouseOver="this.style.cssText=butt_on_lit;"
    onMouseOut="if (butt_clicked != this) this.style.cssText=butt_off_lit;">Anagrafica Fornitura</a></td></tr>
    <tr>
    <td height=2></td>
    </tr>
    </table>
    At this point I don't know what should I investigate next.
    Thank you very much.
    Daniela

  • SRW,Run_Report not working on Report Server

    1 The plan is to do a select in the mother report. Get a number of rows, among them a company name, which the SQL is sorted on.
    2 In the data model I have a function that checks if a global variable is the same as the company name. If not, it will set the global variable equal to the company name, and then it will run a global defined function that starts the SRW.Runreport call that generates a PDF for this company.
    3 Next row the same thing will happen, and maybe the function is run again, or maybe it is the same company, in which case the SRW function will be skipped.
    The report runs nicely from reports builder, but when I try running it on the server it fails with error: REP-1401: 'cf_doc_trans_letterformula': Fatal PL/SQL error occurred. ORA-06508: PL/SQL: could not find program unit being called.
    I use following web link to start the “mother” report: http://Rep_server/reports/rwservlet?SERVER=origo_report&USERID=user%2Fpassw%40tns_name&AUTHID=user2%2Fpassw2&DESTYPE=cache&DESFORMAT=rtf&Report=temp.rdf
    In the temp.rdf the following statement is executed: SRW.Run_Report('BATCH=YES DESTYPE=FILE DESFORMAT=pdf DESNAME='||P_Desname||'.pdf REPORT='||P_REPORT||'');
    Are there any special settings I must make, when running on a Reports Server as opposed to the Reports Ruilder? Do I need a SERVER=REP_SERVER in the SRW.Run_Report parameter list?
    Any suggestions at all will be immensely appreciated.

    Hi,
    Top right cornor has a text box. Type "bobj is undefined" & you would find many KBs, forums & blogs.
    http://www.sdn.sap.com/irj/scn/advancedsearch?query=bobjisundefined
    Thanks,
    Saurabh

  • How to use srw.run_report without userid parameter in 10g

    I have the following function which works fine when I supply the userid parameter.
    Is it possible to run srw.run_report without the userid? If not is there another way to run a batch report to create a file?
    create or replace
    FUNCTION SUNRESDS(vopersorjudicial varchar2)
    RETURN VARCHAR2 as
    myPlist SRW_PARAMLIST;
    myIdent SRW.Job_Ident;
    BEGIN
    myPlist := SRW_PARAMLIST(SRW_PARAMETER('',''));
    srw.add_parameter(myPlist,'GATEWAY','http://xxx.xx.xxx.xx/reports/rwservlet');
    srw.add_parameter(myPlist,'SERVER','rep_172_FRHome1');
    srw.add_parameter(myPlist,'REPORT','d:\oracle\FRHome_1\forms\sunresds.jsp');
    srw.add_parameter(myPlist,'USERID','username/password@databasename');
    srw.add_parameter(myPlist,'DESTYPE','file');
    srw.add_parameter(myPlist,'DESFORMAT','PDF');
    srw.add_parameter(myPlist,'popersorjudicial',vopersorjudicial);
    srw.add_parameter(myPlist,'DESNAME','d:\Reports\unresolved_discrepancies.pdf');
    myIdent := srw.run_report(myPlist);
    return 'Y';
    EXCEPTION
    when others then
    return ('sunresds ' || sqlerrm);
    END;

    Did you solve your problem? How did you do?

Maybe you are looking for