Updateable report with javascript calculation

Hi all,
I have an updateable report where the user fills in one column. I then need a simple multiplication based on the user filled in column and another column to populate into the final column.
I have managed to do this using the following javascript in the page header
<script language="JavaScript" type="text/javascript">
<!--
function calcit(pThis)
var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
html_GetElement('f03_'+vRow).value = html_GetElement('f02_'+vRow).value * html_GetElement('f01_'+vRow).value;
//-->
</script>Column f01 is a value in a table based on the SQL to create the report (AQLSCORE)
Column f02 is what the user fills in (AQLERRORS)
Column f03 is where the calculation is populated (AQLTOTAL)
With AQLERRORS element attribute = onchange="calcit(this);"
The problem I am having with the above is that it only works when f03 is a text field (i.e. the user can change the value) I would like the column to be non-editable (the user should not be able to change this field). If I make the column Display as text (saves state) the calculation returns a NaN error.
When I change the calculation from a * to a + the value returned is 1undefined showing that the value from f01 is undefined
Demo app
http://apex.oracle.com/pls/apex/f?p=15328
username: demo
password: demo
There are 2 pages one where the calculation is working but with AQLSCORE as a text field and another where it is returning NaN but with AQLSCORE as Display as text (Saves state)
Any ideas how I can perform the calculation and protect the AQLSCORE column from the user
Kind regards,
Alex
Edited by: user10942729 on 30-Jul-2010 08:12

Thank you for your response.
I have corrected the code as you suggested however it still causes the same error.
I have very limited knowledge of java and html (probably not a good start I realise) but it seems that the javascript cannot see(??) the value in the AQLScore (f01) column when it is Display as Text(saves state)
If I change the calculation to just make the value = the AQLScore (f01) without the parseInt syntax 'undefined' is returned. With the parseInt 'NaN' is returned.
I will keep looking for an answer
Cheers,
Alex

Similar Messages

  • Setting fields defined in SQL updateable report with a process

    I have SQL statement defined in a SQL updateable report with hidden fields. I want to be able to update these hidden fields with values from other displayed fields on the page. How do I reference these hidden items - I have referencign them as :my_field but get and error telling me thats its underfined.

    But, the reason I am doing this is because I want to format the page with 6 columns in one <TD> cell with some extra text and formatting etc - I don't want 1 column per <TD>. Thats why I am using the APEX_ITEM.TEXT so I can format the 1 <TD> the way I want it (with 6 columns it there).
    In the short term can you tell me how to reference hidden fields please.
    I will create the case in apex.oracle.com in the next few days to make it clearer.
    P.S. see my previous post: SQL QUERY updateable report with APEX_ITEM fields to update hidden columns

  • SQL Query updateable report with row selector. Update process.

    I have a SQL Query updateable report with the row selector(s).
    How would I identify the row selector in an update process on the page.
    I would like to update certain columns to a value of a select box on the page.
    Using the basic:
    UPDATE table_name
    SET column1=value
    WHERE some_column=some_value
    I would need to do:
    UPDATE table_name
    SET column1= :P1_select
    WHERE [row selector] = ?
    Now sure how to identify the [row selector] and/or validate it is checked.
    Thanks,
    Bob

    I don't have the apex_application.g_f01(i) referenced in the page source...In the page source you wouldn't find anything by that name
    Identify the tabular form's checkbox column in the page(firebug/chrome developer panel makes this easy)
    It should be like
    &lt;input id=&quot;...&quot; value=&quot;&quot; type=&quot;checkbox&quot; name=&quot;fXX&quot; &gt;we are interested in the name attribute , get that number (between 01 and 50)
    Replace that number in the code, for instance if it was f05 , the code would use
    apex_application.g_f05
    --i'th checked record' primary keyWhen you loop through a checkbox array, it only contains the rows which are checked and it is common practice to returns the record's primary key as the value of the checkbox(available as the the i'th array index as apex_application.g_f05(i) , where i is sequence position of the checked row) so that you can identify the record.

  • The combination of report with javascript

    Hi guys,
    I want to use report combined with javascript as follows:
    <APPLET NAME="ASMGridAppAssembly" ...
    PARAM NAME="QueryTemplate" VALUE="..../Reports/PTSD/AsmNCMFRXQuery">
    <PARAM NAME="DisplayTemplate" VALUE=".../Reports/AsmGrid">
    <param name="Param.1" value=>
    <param name="Param.2" value=>
    </APPLET>
    document.ASMGridAppAssembly.getQueryObject().setParam(3,Param3);
    document.ASMGridAppAssembly.getQueryObject().setParam(4,Param4);
    Can I achieve this?
    Thanks,
    Tony.
    Edited by: Tony Hu on Aug 8, 2008 7:07 PM

    Mike - Huh?  If javascript is called to an active applet on the page that received Param.1 and Param.2 through param overrides in the html (like shown in Tony's post) they will absolutely override any static ones that are in the query template itself.
    Tony - you need to instruct the applet to run the query with your 2 new parameters, so add this line after setting param 3 and 4:
    document.ASMGridAppAssembly.updateGrid(true);
    Regards,
    Jeremy

  • Sql Query(Updateable Report) with pagination

    Hi,
    We're on APEX 3.2 I have a question on Sql Query(Updateable Report) and pagination. I have an updateable report which we have set to show 20 rows. When the userwhi has more than 20 rows enters the data and clicks next the data disappears. I have been reviewing other posts, but haven't come to a clear conclusion on how to prevent this from happening. I have been trying to use javascript to show a save popup when clicking 'Next' Any help is appreciated.
    Thanks,
    Joe

    any ideas?

  • Incomplete download of OBIEE report with Javascript

    Hi,
    When I try to download a report ( containing Javascript code ) to excel, it does not do a complete download. The resulting excel sheet only contains a part of the result fetched by the report.
    I when I try to do the same activity with a report that does not contain javascript, the complete result set is downloaded to excel.
    Any help in this matter would be much appreciated.
    Denu

    Hi Joe,
    I found out that this behavior is occuring in all my reports that have a hyperlink specified in the 'fx' whether the report contains javascript or not.
    To cite an example
    A report has only 6 columns. Out of which the first column contains a list of order numbers. These order numbers have hyperlinks on them
    the following is the code in 'fx' section of the order column
    ''||CAST("Item Loc Order Revisions"."Order #" as char)||''
    where I am using the session variable NQ_SESSION.RMS_URL.
    On the dashboard, I have enabled the download link for this report.
    When I try to download an excel format of this report, the resulting excel only has one record. While the report actually has 3 records.
    I have tried with IE version 7, Mozilla firefox and Google Chrome. All of them provide the same results.
    When I remove the hyperlink from the column, save the report, and try downloading it from the dashboard, I am able to see all the 3 records in the excel.
    Thanks
    Denu
    Edited by: user10874114 on Dec 15, 2009 9:15 AM

  • Updateable  report  with CHECKBOX - Error in MRU: row= 1, ORA-01403:

    Hi All,
    Lets say I have a table tab_1 with column return_flg
    I have an updateable report - tabular form.
    For the return_flg column I have:
    I have Tabular Form Element attribs:
    Display As Standard Report Column
    Default Type No Default
    Default
    Reference Table Owner - no reference selected
    Reference Table Name TAB_1
    Reference Column Name RETURN_FLG
    But there is no CHECKBOX display type..so I used HTMLDB_ITEM.CHECKBOX in the SQL...
    Select ID, .....
    HTMLDB_ITEM.CHECKBOX(1,RETURN_FLG) "RETURNED"
    from tab_1 where order_id = '1'
    How do I get it to update with the MRU?
    I get Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01403: no data found, update TEMP_USER.TAB_1 set "ID" = :b1
    Thanks for the help, BillC
    Message was edited by:
    bcarlis_2000

    No, I had an updateable report that works great..
    Lets say
    Select ID, item_name
    from TAB_1 where ID = '1'
    Updates great!
    then added column to the table to track if item was returned.
    RETURNED_FLG
    changed select of same form to:
    Select ID, item_name
    from TAB_1 where ID = '1'
    HTMLDB_ITEM.CHECKBOX(1,RETURNED_FLG) "RETURNED"
    Now, it updates great IF the checkbox is not checked but gives the error if checked.

  • Updateable Report with pagination(APEX 3.2)

    Hi,
    I am working on APEX 3.2 and I have a question on Sql Query(Updateable Report) and pagination. I have an updateable report which we have set to show 100 rows. When the user has more than 100 rows enters the data and clicks next the data disappears. How can i save first 100 records once i click next ?. Any suggestions will be appreciated.
    Thanks,
    Greenhorn

    Here is what I did to get it to work.
    1. Copy xmlparserv2.jar from my ORACLE_HOME/oc4j/lib directory to my glassfish domains/domain1/applications/fop/WEB-INF/lib directory.
    2. Added the following two lines to the glassfish domains/domain1/fop/apex_fop.jsp before the driver.run() line
    out.clear();
    out = pageContext.pushBody();The second part of solution I found on another forum page.

  • Export Interactive reporting with javascript

    Hi,
    i have some problem when i try to export in excel my report created with Interactive Reporting.
    I use the javascript code inside the button and at onClick event i succeded only the file conversion in mhtml format.
    The next step is conversion from mhtml in xls format, but i think that the instance JooleObject don't.
    Below the code that i use:
    //**********Create the FileSystemObject
    var objFSO = new JOOLEObject("Scripting.FileSystemObject");
    var strMhtmlFile = "C:\\pippo.mhtml";
    var strExcelFile = "C:\\pippo.xls";
    //************Create the JOOLE Object for Opening Excel File
    var objExcel = new JOOLEObject("Excel.Application");
    //**********If Files Already Exist - Delete Them
    if (objFSO.FileExists(strMhtmlFile))
    objFSO.DeleteFile (strMhtmlFile);
    if (objFSO.FileExists(strExcelFile))
    objFSO.DeleteFile (strExcelFile);
    //**********Export to MHTML Format
    ActiveDocument.Sections["PDC_FIN"].Export(strMhtmlFile,bqExportFormatOfficeMHTML,true);
    //**********Make Excel Invisible
    objExcel.Visible = false;
    //**********Open MHTML File in EXCEL
    objExcel.Workbooks.Open(strMhtmlFile);
    //**********Save As Copy of MHTML File into .XLS
    objExcel.ActiveWorkbook.SaveCopyAs("C:\\pippo.xls");
    //**********Close EXCEL
    objExcel.Quit();
    Have you any suggestion? There are some libraries that i must import?
    I use Interactive Reporting Studio 11.1.1.3
    Thank you in advance.
    Flavio

    Hi,
    thank you for response.
    I use IR Studio (Desktop) and public the report in the workspace when the report is complete.
    Your suggestion work
    var strMhtmlFile = "C:\\pippo.xls";
    ActiveDocument.Sections["PDC_FIN"].Export(strMhtmlFile,bqExportFormatOfficeMHTML,true);but the problem is that when export the report directly in xls format, the formatting of the report is lose. For this reason i export befor in mhtml and after Open/SaveAS the report in xls format for mantaining the formatting.
    I think that the istruction
    //**********Open MHTML File in EXCEL
    objExcel.Workbooks.Open(strMhtmlFile);
    //**********Save As Copy of MHTML File into .XLS
    objExcel.ActiveWorkbook.SaveCopyAs("C:\\pippo.xls");
    on the objExcel variable (instance of JOOLEObject) don't work.
    I speak with my develop team and decide if adopt your solution.
    Thank you so much.
    Flavio

  • Help with Javascript/Calculations

    Hello,
    Have a building use policy for school.
    Need help with checkboxes and default values.  I can get javascript/math to work when I click check box.
    Someone wants to rent a room they check the rentRoom checkbox.  Then the enter how many rooms 1,2,3 etc..  The value for the rentRoom checkbox is $25.
    I can get it when the checkbox for rentRoom is selected the rentRoom.Total computes correctly.  However, what I want is when the form opens up a default value of $0.00 to be in there.  I also want if someone goes back and unchecks the rentRoom checkbox the value goes back to $0.00 not just blank.   Right now I am getting the error the value entered does not match the value of the field.  That is if I put the default value in options.  Basically, I can't seem to figure out the javascript code to get this to work.
    Am I asking for too much, can someone guide me to javascript to help me out.
    I have tried if/then statements and switch statements.  I just can't figure out how to get it to for lack of better a word - toggle back and forth.
    If this is not possible please tell me.  If it is too complicated tell me.  I am not using livecycle for this as we had a word document and I just used the find form fields.  I am also using Adobe Acrobat 8 Professional.
    Thanks

    Hello,
    Thanks that looks good.  I am still missing something but the calc doesn't work when I put in my variables.  I will work with it more but nothing happens.
    The one thing is I have the default value of the checkbox as 15 so don't know if that messes it up.
    Right now I get the default value of $0.00 all the time.  When I click on the check box on/off it doesn't do the calcs.
    sorry, any more input, what am i missing??
    I also changed the syntax error that was posted on your origianl post.  You had == 'Off" I changed that to 'Off'

  • How to create an expense report, with amounts calculation, including currency conversion ?

    Hello,
    I would like to create an expense report like the one shown below.
    As far as I could try the PDF forms editor, I don't understand how we can build such report. Furthermore, I would like to know how we can make easy calculation in the report ?
    Thanks for your assistance.
    Ben

    I would suggest, building additional columns in your query for the what if analysis. These columns would use formula variables for the user to input for the changeable fields. These will give hima side by side comparison of actual and what-if values.
    Thanks
    Vineet

  • Report with multiple calculations

    I am learning reports and need some inputs on how can I handle the following report
    1. One of my summary area in the report should show 5 amounts as a table view and the sixth column should be sum of the first 4 columns (I am getting those 5 values with a query)
    2. In the second row with an external condition is false I need to put zeros under each column ad an the sixth also it is zero
    3. But if the condition is true, I need to calculate a new amount (multiply by %) and show that amount under each column and again add the new amounts in the sixth column
    I am not sure whether I need to use forumla or place holders, please help me.
    Thanks

    Hi Hamid,
    Thank you for your reply.
    It is a complex report and my Requirements are as follows.
    1. It is a statement/invoice report (I already completed this part), but at the end of the report we need to show the aging summary.
    In the aging summary we need to show the amounts, interested and the totals based on the due dates.
    2. One customer can have multiple types of accounts (for example cable, water, internet, electricity etc.),
    we need to create a report to show the invoice/statement for each month for the selected customers and that report should include all the account type of that particular customer.
    I am completed this report part.
    3. At the end of the report I need to create aging summary for each customer. Main purpose of this aging is it should show 5 buckets (columns).
    Each bucket is sum of amount of invoice balance due for all account types grouped by due date
    buckets are:
    CURRENT ONE_MONTH_DUE TWO_MONTHS THREE_MONTH MORE_THAN_THREE TOTAL
    Suppose user has 4 account types (cable, water, phone, inter net) and there is no due on cable and water that sum should come under CURRENT column
    if phone and internet three months due that sum should come under
    THREE MONTHS DUE and other buckets should show zeros. TOTAL should show the sum of each rows.
    4. based on the account type if that account has interest enabled and the due date is more than one month we need to calculate interest for each bucket and show that amount in the second row under each bucket.
    So that report should look like:
    BUCKET: CURRENT ONE_MONTH_DUE TWO_MONTHS THREE_MONTH MORE_THAN_THREE TOTAL
    220.00 0 0 340 560.00
    INTEREST: 0 0 0 34 34.00
    TOTAL: 220 374 594
    Please help me how to solve this problem.
    Thanks.

  • SQL QUERY updateable report with APEX_ITEM fields to update hidden columns

    Here is my SQL query:
    select
    "EMPLOYEE_ID",
    "PUBLICATION_ID",
    "TITLE",
    '<NOBR>1. ' || APEX_ITEM.TEXT(101,CODE1,2,3) || '  ' ||
    APEX_ITEM.TEXT(102,CODE1_PCT,2,3) || ' %</NOBR><BR>' ||
    '<NOBR>2. ' || APEX_ITEM.TEXT(103,CODE2,2,3) || '  ' ||
    APEX_ITEM.TEXT(104,CODE2_PCT,2,3) || ' %</NOBR><BR>' ||
    '<NOBR>3. ' || APEX_ITEM.TEXT(105,CODE3,2,3) || '  ' ||
    APEX_ITEM.TEXT(106,CODE3_PCT,2,3) || ' %</NOBR>' rfcd_codes,
    APEX_ITEM.DISPLAY_AND_SAVE(100,CODE1) hidden_rfcd1,
    mycomments
    from "#OWNER#".mytable
    I have 3 code fields with their percentages (_pct). I have concatinated them so I can format them nicely on the page.
    I have create a process 'on-submit and before computations and validations' where I was hoping to assign my table columns (eg the code and pct columns) from the APEXITEMs in my select statement.
    I can get the values from these (APEX_ITEM) fields by referencing APEX_APPLICATION.G_F10(i) etc.... so thats cool.
    But my problem is how do I reference the table columns so I can assign them.
    I am using a 'Multi Row Update' process to perform the update to the database.
    P.S. mycomments column is working fine. It gets updated nicely but its just those other APEX_ITEM fields.

    I don't have the apex_application.g_f01(i) referenced in the page source...In the page source you wouldn't find anything by that name
    Identify the tabular form's checkbox column in the page(firebug/chrome developer panel makes this easy)
    It should be like
    &lt;input id=&quot;...&quot; value=&quot;&quot; type=&quot;checkbox&quot; name=&quot;fXX&quot; &gt;we are interested in the name attribute , get that number (between 01 and 50)
    Replace that number in the code, for instance if it was f05 , the code would use
    apex_application.g_f05
    --i'th checked record' primary keyWhen you loop through a checkbox array, it only contains the rows which are checked and it is common practice to returns the record's primary key as the value of the checkbox(available as the the i'th array index as apex_application.g_f05(i) , where i is sequence position of the checked row) so that you can identify the record.

  • Date formatting on updateable report

    I have an updateable report with a date column. I would like the user to be able to use mm/dd/rrrr format.
    Is this possible?
    Thanks

    when you use our tabular form wizard to generate a tabular form, you're somewhat limited in what you can do to the data that's being selected out of your table. it's currently set up that way because we do some optimistic locking stuff behind the scenes to maintain your data integrity for you. there might be other ways to deal with your specific request, but this approach seems easiest to me assuming that changing your db's default date format isn't an option:
    put html db pl/sql processes on both your page rendering and page submission sections that set your nls_date_format for each of those db sessions. so both of your new html db processes would be of type "PL/SQL Anonymous Block". one would fire with a process point of "On Load - Before Header" and the other would fire "On Submit - Before Computations and Validations". both processes would look like...
    begin
    execute immediate 'alter session set nls_date_format = ''mm/dd/rrrr''';
    end;
    ...and after those two changes, your tablular form should handle dates in the mm/dd/rrrr format you're looking for.
    hope this helps,
    raj

  • Apex_item.radiogroup in updateable Report

    How can i build up an updateable Report with a radiogroup created by apex_item.radiogroup?
    i know the syntax like
    APEX_ITEM.RADIOGROUP (1,deptno,'20',dname)
    but i wanna have 5 different options in 1 radiogroup.
    How can i manage this?
    thx so far
    P.S.: I know that you can define a column to be a radiogroup but in my case it must defined with the apex_item package.

    Hi,
    Have a look at: Re: User Radiogroup in Tabular Form - there are several methods that you could use - the details for each are shown in the app pages themselves rather than the thread
    Andy

Maybe you are looking for

  • How do I launch quicktime player on Mac Book Air?

    How do I launch Quicktime Player on Mac Book Air? I know that my computer came with it, and when I try to launch it, the icon tells me that it is Version 10.1. Nothing else happens. I wanted to watch some online videos which require the plug in, but

  • J2SE/J2EE

    What's the difference between the Standard Edition and Enterprise Edition? Any advantages or disadvantages? I just wanna know which one I should download. Tnx!

  • Create a remittance challan.

    when i am trying to create a remittance challan forwithholding tax 194j under j1inchln in the new fiscal year dt 23.04.2010 I am getting the follg message. can anybody guide me to create a remittance challan. No unpaid tax lines exist for the given s

  • Port Number in Oracle9i for running isqlplus

    Hi all, Just yesterday I installed Oracle9i in my PC which OS is WinXP. After installing, I faced a problem whenever I tried to run isqlplus. Because from Oracle Enterprise Manager console I found Host (pc) & PORT (1521). So, when in IE i gave (http:

  • Will this Mac and Adobe thing ever be resolved

    No I'm not on here to moan about Mac not supporting Flash (and yes I know that in theory Mac have dome a U turn and are prepared to support it, albeit through gritted teeth).  I have a problem though, I have been using Adobe since, well forever reall