Using Javascript in a report region

I have a text box that I need to populate with an amount for billing. There is also a field that shows the amount due. If the amount due is equal to the amount being paid, I want my user to click on the amount due, and it automatically populates the amount being paid. I am using the javascript:setValue('destination','origination'); command, but the problem is that I am unable to choose the text field in the javascript. I have tried using #value# aliasing, and htmldb_application.g_f0x and just f0x... nothing seems to properly alias the text box within the tabular form. Any ideas?
Thanks,
Scott

Scott,
I know a way to do this, but it is not an easy implementation and it is quite hard to explain. Carl is an Oracle guy so he may know of a better solution, but here is what I came up with on my own:
First let's be familiar with the htmldb_item syntax (found in the html db documentation):
HTMLDB_ITEM.TEXT(
p_idx IN NUMBER, -- unique id
p_value IN VARCHAR2 DEFAULT NULL, -- value of item
p_size IN NUMBER DEFAULT NULL, -- HTML tag attributes
p_maxlength IN NUMBER DEFAULT NULL, -- max length
p_attributes IN VARCHAR2 DEFAULT NULL, -- HTML elements including where you incorporate the javascript for this item
p_item_id IN VARCHAR2 DEFAULT NULL, -- id you can specify
p_item_label IN VARCHAR2 DEFAULT NULL) -- labe you can specify
I would create your report region using the following sql statement:
select order_number "Order Number",
name "Name",
amount_due "Amount Due",
lpad((ROW_NUMBER() OVER (ORDER BY order_number)),4,0) "Row Num",
htmldb_item.text(7,amount_paid,null,null,null,'f07_'||lpad((ROW_NUMBER() OVER (ORDER BY order_number)),4,0) "Amount Paid"
from tbl_orders
where....
order by order_number
--i had to use an order by to get the ROW_NUMBER() to work
This will create on every row an item that is specific to the row number. For example:
Row # Amount Paid text box item ID
1 f07_0001
2 f07_0002
500 f07_0500
etc.
This will allow you to reference items based on what row they are when using javascript.
Next you need to create a link out of the the amount_due column. Go to the Report Region, then the Report Attributes tab. Click on the edit link for the amount_due column. Go to the Column Link section.
Make link_text = to the value of amount_due column(#amount_due# probably)
Make the Target = URL
Make URL = javascript: setValues('#AMOUNT_DUE#','#ROW_NUM#');
This will send the value of amount due and the row number.
Here's the javascript you would put in your HTML Header on you Page Attributes:
<script language="JavaScript1.1" type="text/javascript">
function setValues(due, rownum){
document.getElementById('f07_'+rownum).value = due;
</script>
Give that a shot. I just created a page and got that to work.
Chris

Similar Messages

  • Error when trying to use this query in report region

    Hi ,
    I am getting "1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00933: SQL command not properly ended"
    while trying to use this query in reports region .
    Pls help.
    Thanks ,
    Madhuri
    declare
    x varchar2(32000);
    begin
    x := q'!select (first_name||' '|| last_name)a ,
    count(distinct(session_id)),manager_name
    from cappap_log,
    MIS_CDR_HR_EMPLOYEES_MV
    where DECODE(instr(upper(userid),'@ORACLE.COM',1),0,upper(userid)||'@ORACLE.COM',upper(userid)) = upper(email_address)!';
    if :P1_ALL = 'N' then
    x:= x||q'!and initcap(first_name ||' '|| last_name)=:P1_USERNAME!';
    else
    x:= x||q'!and initcap(first_name ||' '|| last_name)like '%'|| :P1_USERNAME||'%'!';
    end if;
    if :P1_APP_NAME = '%' then
    x:= x||q'! and flow_id like '%'!';
    else
    x:= x||'flow_id = :P1_APP_NAME';
    end if;
    x:= x||q'! group by first_name||' '|| last_name , manager_name!';
    return x;
    end;

    Hi, I am actually stuck here. Can you please let me know which among these is the higher version.
    1) Final Release 3.50
       Version 3500.3.016
    2) Final Release 3.50
        Version (Revision 481)
    Because it is working fine in the 1st one whereas its throwing that error pop-up in 2nd one(as soon as we select the Change query global definition option) .

  • How can I hide figures or characts. using javascript in wad report BI NW 7

    Hi,
    How can I hide figures or characteristics using javascript or command in wad report ( BI NW 7).
    I have read the documentation for WEB API, but it doesn't provide some info on that area.
    Thank you.
    Edited by: Sergey Antonov on Jul 29, 2011 3:08 PM

    You can use REMOVE_DRILL_DOWN in WAD to remove characteristic..to remove a keyfigure with a button you could a variable with that button, which makes an invalid selection of the keyfigure though it is 2000, e.g. set CALYEAR = 1900.
    Hope it helps,
    Christian

  • Using JavaScript to create reports listing security settings

    Hi...I'm trying to create an Acrobat 8 batch process using a JavaScript that creates a log/report that lists the security settings for each PDF in a directory. I want to be able to periodically run this script so that I can ensure that (a)each file uses the departmental permissions password and (b) that the set of permissions (copying not allowed etc.) are set according to our standard.
    I've looked at the JavaScript reference etc. but am seriously confused. There's a securityhandler object but how can I use that (or something else) to get a list of the doc's security permissions and to check that password x has been used?
    Many thanks.

    You can try using Auditpol.exe: http://technet.microsoft.com/en-us/library/cc731451%28v=ws.10%29.aspx
    This
    posting is provided "AS IS" with no warranties or guarantees , and confers no rights.   
    Microsoft
    Student Partner 2010 / 2011
    Microsoft
    Certified Professional
    Microsoft
    Certified Systems Administrator: Security
    Microsoft
    Certified Systems Engineer: Security
    Microsoft
    Certified Technology Specialist: Windows Server 2008 Active Directory, Configuration
    Microsoft
    Certified Technology Specialist: Windows Server 2008 Network Infrastructure, Configuration
    Microsoft
    Certified Technology Specialist: Windows Server 2008 Applications Infrastructure, Configuration
    Microsoft
    Certified Technology Specialist: Windows 7, Configuring
    Microsoft
    Certified Technology Specialist: Designing and Providing Volume Licensing Solutions to Large Organizations
    Microsoft Certified IT Professional: Enterprise Administrator
    Microsoft Certified IT Professional: Server Administrator
    Microsoft Certified Trainer
    Thanks but I guess, auditpol ca be used only to manipulate system audit policies. how do I specify a folder and user in auditpol ? I could not find or understand how folder can be included with auditpol command line options.
    Thanks !

  • Enable particular row of apex_item report region....

    Hi guys,
    I have a report region.i used apex_item to create report region.
    select apex_item.checkbox(1,ADDRESS1)
    chk_bx,apex_item.text(2,ADDRESS1) Address,apex_item.text(3,ITEM1) Item,null from address_details;On page load i disabled the report region by using below javascript
    function disableItems(pRegionStaticId,pDisableFlag) {
    alert('disa');
      $('#'+pRegionStaticId).find('[name^=f]').each( function(){ /* matches fxx */
        if( $(this).attr('name').match(/f[0-9][0-9]/) ){
          return $(this);
      }).attr('disabled',pDisableFlag);
    }After the report region get disabled,i have to enable a particular row of report region, ie when i set click first row f01[0] (f01 is checkbox), then i enable that row(clicked row), if i click second row f01[1],then i have to enable that row vice versa...
    Is that any javascript to achive this?
    Thanks in advance

    Hi
    i have a report with parameter is the year i can select a multiple value.
    Below is an example for the result:
                                    year
     Data        2010    2011   2012  
     hp          14         25           30    
     Dell        17         18           20
    i need to get the value of the last previous i mean i this example i have the last year is 2012 i need the value of 2011
    i tried a script with vb.net but i don't get the result i get only the value of year this is my script
    Dim Shared Num1 As StringDim Shared values As System.Collections.ArrayList=New System.Collections.ArrayList()Public Function GetVal(Val as Integer,Year as Parameter)  as String   If Year .IsMultiValue then    For i as integer=0 to Year.Count-2          Num1= Year.value(i)                       Next    End If   Return Num1End Function
    this script return me 2011 but me i want the value in of the year 2011
    thanks

  • How to display the items in a Report Region

    Is it possiable to have the fields in a report region based on an sql query be display in somthing other than a row? For example if I have a Report Region with four columns it will look something like:
    <Field 1, row 1 value> <Field 2, row 1 value> <Field 3, row 1 value> <Field 4, row 1 value>
    <Field 1, row 2 value> <Field 2, row 2 value> <Field 3, row 2 value> <Field 4, row 2 value>
    <Field 1, row 3 value> <Field 2, row 3 value> <Field 3, row 3 value> <Field 4, row 3 value>
    etc
    Is it possiable to tell ApEx to display the Report Region like:
    <Field 1, row 1 value> <Field 2, row 1 value>
    <Field 3, row 1 value> <Field 4, row 1 value>
    <Field 1, row 2 value> <Field 2, row 2 value>
    <Field 3, row 2 value> <Field 4, row 2 value>
    <Field 1, row 3 value> <Field 2, row 3 value>
    <Field 3, row 3 value> <Field 4, row 3 value>
    etc
    Maybe there is a nother way to do this that uses somthing other than an sql based report region. Thanks very much for the help.

    This can be done using a SQL query report region with a [custom report template|http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/themes.htm#sthref1744].
    Unfortunately the documentation is not particularly helpful on this topic, and as use cases tend to be very specific, reusable solutions are rarely shared in the community ("custom" reports after all...) See [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=1569996] for a good discussion of the technique, with a link to an example on apex.oracle.com.
    A response to [another recent thread|http://forums.oracle.com/forums/thread.jspa?threadID=1012690] showed another example on page 1 of the [Online Store demo app|http://www.oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html#STORE], which you can download, install and examine. This uses a custom report template in conjunction with the report HTML Expression feature.
    (I'm not totally clear on the display you're after: it might help to repost it using some example data rather than the abstract <Field 2, row 1 value> approach. Wrap the sample in \...\ tags to get fixed width characters that can be made to align, if that will help.)

  • How do I set an Apex mulri-row reports form value for the specifc current row using Javascript?

    I have a multi-row region based on a table in which I have two particular columns of interest.  The first has an LOV defined for which I have set up a pick-list of codes associated with the item's status as "OK" or having some problem, for which there are a small number of set codes associated.  Most rows will be OK, but when there is a problem, the pick-list will be used.
    When that pick list has been used, there is an optional "comments" column that can be filled in.  I want my screen to dynamically enable/disable a pushbutton that links to the comment based on the code.  This being row-based, the push-button needs enabling or disabling by row, not as a whole "conditional column".  That bit is ok, I think, but I don't know and can't find the syntax for how within the javascript onchange function I set the current row value for a different column to the one that triggered it.
    My header function (that doesn't work) is going to be something like this (where the status column LOV having a value = 6 means "OK").  Note I'm using alert for a debug mechamism.  The $s line is my failed attempt to set he column value, here with a hard-coded string "Changed COMMENTS":
    <script type="text/javascript">
    function doActivateButton(object)
      if(parseInt(object.value)!='6')
        alert('It is not 6!');
        $s('#COMMENTS','Changed COMMENTS','Changed COMMENTS',TRUE);
      else
        alert('It is 6, you know!');
    </script>
    Ideally, I want any existing comments blanked if the user picks "OK" (6) as the new status, whereas for debug above I'm setting the hardcoded debug string.  You will probably also note I realise I haven't properly understood the purpose of the third parameter in the $s API.
    (This is a reports region, by the way.  A detail block, in forms-speak, with a header block above it.)
    Thanks for any assistance.
    Mark

    Sorry, versions are: Apex 4.1 on Oracle RDBMS 11.2.

  • Delete buttons in report region & javascript

    I managed to add a delete button on each line of my report region using 'Column link' with
    text <img src="#IMAGE_PREFIX#delete.gif" border="0" alt="Verwijderen Icon">
    url f?p=&APP_ID.:504:#APP_SESSION#:TEST:::P504_DELETE_ID_LCNT:#ID#
    and some extra coding.
    problem is : i'd like to add a javascript:confirmDelete function
    In a 'Normal' button you can add it via URL Target.
    Can anyone help me ?

    This seems to be the way to add javascript to the url-code
    f?p=&APP_ID.:504:#APP_SESSION#:TEST:::P504_DELETE_ID_LCNT:#ID#" onClick="javascript:confirmDelete('Are you sure....')
    The only problem now is to add some kind of code to javascript to cancel further processing??????
    return true or false has no effect.
    I tried to set the REQUEST-value but i can't find the solution.
    Please help.

  • How to resize a region in a SMIL presentation, using Javascript?

    I have Quicktime player embedded in HTML page. The src is link to SMIL text on my server. The presentation works fine, but I couldn't find any way to re-size its regions dynamically, using Javascript.

    Before posting, please TRY and do a search on the forum, you MIGHT find your question already asked and ANSWERED..: place a reports region on center of the page
    Thank you,
    Tony Miller
    Webster, TX
    On the road of life...There are 'windshields', and there are 'bugs'
    (splat!)
    "Squeegees Wanted"

  • Child Report Window Size XI 3.0 SP2 Using Javascript

    Hi All,
    I have to admit this is not my area  . I'm trying to get a new webi report in a sizeable window using javascript. I want to achieve this by selecting an open doc link from an existing webi report.
    We have been trying with the code below but get the 404 Missing Page error.
    We have been trying to get this to work on Edge. Do I need to install any SDK on to the system to get this to work?  Can anyone let me know the steps, please.
    Thanks...
    Mark
    Code:
    "<a href=__\"javascript:window.open('../../opendoc/openDocument.jsp?iDocID=Aa252KU2ReBDm4TkGkVTOLM&sIDType=CUID&sType=wid&sReportPart=UIREF%3ARID%3D1005%3ABID%3D1008&mode=Part&sRefresh=N&sWindow=New','SAMPLE ','width=350,height=250') \" title=\"\" target=\"_self\" nav=\"doc\">"[Actual].[Kpi Group]"</a>"

    Thanks for the response Guys.
    I have done a bit more digging and I think that you can only create a link referencing Java script in a  crystal report, not Webi?
    One way I thought of getting round this is to create a copy of opendocument.jp and add my Java script, in there, to resize my child window.
    Any comments or experiences to share?
    All the Best,
    Mark.

  • PL/SQL Table use in report region query

    Hello,
    I have a package function which return pl/sql table. I want to create a report region based on this pl/sql table. Is it possible to do this kind of report in HTMLDB?
    Please guide me in this area.
    Thanks
    HA

    The htmldb_collections API (apec_collections in 2.2) is a very useful method for rendering reports and one I have used extensivly in the past.
    Once created and populated you can reference your collection as if it were a SQL table i.e.
    Select c001, c002, c003
    from htmldb_collections
    where collection_name = 'MY_COLLECTION';
    You can absolutly base an Apex Report region on collections. Just treat them as another table that you can select from, join to others etc.
    In order to utilise this you must do the following:
    1) Create your collection:
    note that collections only persist for the duration of your session and you can only see the data you inserted into the collection. Also I would create this collection as the Database user who owns the Apex Workspace
    htmldb_collection.create_or_truncate_collection ('MY_COLLECTION');
    2) Populate your collection:
    In your case I would set a loop construct that parses through your pl/sql table and assign all values as described below. I assumed that my_plsql_tab has 3 columns called Val1, Val2, Val3
    FOR x IN 1..my_plsql_tab.count
    LOOP
    htmldb_collection.add_member (p_collection_name => 'MY_COLLECTION',
    p_c001 => my_plsql_tab(x).val1,
    p_c002 => my_plsql_tab(x).val2,
    p_c003 => my_plsql_tab(x).val3
    END LOOP;
    Note that you can have upto 60 elements in your collection.
    3) Access your collection:
    Select c001, c002, c003
    from htmldb_collections
    where collection_name = 'MY_COLLECTION';
    This quesry can then form the source of your sql report region.
    Hope all that helps
    Duncan

  • Refresh PL/SQL Report Region (not Page) using Select List value

    Hi,
    I've got a report region based on a 'PL/SQL function body returning a SQL query'which gets generated on selecting a value from a Select list item, The Select List action is 'Redirect and Set value' but this causes the whole page to refresh rather than just the report region. I've tried to refresh the report only using a dynamic action on the Select List item (Action now reset to  'None') but now the report is not appearing on choosing from the List. Can anyone suggest a solution that will allow me to refresh this report without refreshing the page? I am using APEX 4.2.2 and the report syntax is as follows:
    DECLARE
      v_statement VARCHAR2(500);
    BEGIN
      SELECT query_text
        INTO v_statement
       FROM sql_queries
       WHERE query_id = :P2_QUERY ;
       RETURN v_statement ;
    END ;
    where P2_QUERY is Select List Item,
    regards,
    Kevin.

    KevinFitz wrote:
    The report region being displayed is conditional on P2_QUERY item being NOT NULL. I assume the region not appearing is because the Action for the Select List Item is set to None and so P2_QUERY is always NULL.
    No, the region is not appearing because it is conditional on P2_QUERY being NOT NULL. This means that the report region never exists on the page shown in the browser, so it can't be dynamically refreshed. (Dynamic refresh doesn't evaluate region conditions, and it only re-renders the report content, not the entire region.)
    Remove the condition on the report region, check the refresh is working, then reconsider exactly what the requirements here are. If you want the region to appear only when P2_QUERY has a value, and you want it to be refreshed without submitting and re-rendering the page, then the region needs to be hidden rather than conditionally rendered, and shown via a dynamic action when P2_QUERY gets a value.
    I tried adding an additional Set Value True Action for the DA event but got an error as listed above,
    All irrelevant if Page Items to Submit on the region is used properly.

  • Can't get around this error after adding second dataset...A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset

    I added a dataset to an existing report and broke an aggregation.  In the old (i.e. single dataset) report, this expression below worked fine.  I wanted to get a distinct count of the vst_ext_id field when my educated field was like "VTE1*"
    = CountDistinct(IIF(Fields!educated.Value like "VTE1*", Fields!vst_ext_id.Value, Nothing))
    After adding a new dataset, this no longer works and I get the error " A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset".  Having done some research online, I found that I
    needed to specify my dataset explicitly and I thought this new expression might work, but still no success...
    = CountDistinct(IIF(Fields!educated.Value,"DataSet1" like "VTE12*", Fields!vst_ext_id.Value,"DataSet1", Nothing))
    Am I missing something?  Based on online responses, this explicit dataset naming convention seems to help most people, but it isn't working for me. 
    Thanks in advance!
    Brian

    I found the answer.  Apparently, my expression syntax was off.  This expression does the trick...
    = CountDistinct(IIF(Fields!educated.Value like "VTE12*", Fields!vst_ext_id.Value,Nothing),"DataSet1")
    I just happened upon this particular syntax searching online.  I was trying to specify the dataset name after each .value, but I never got that to work.   This is the only time I have found this particular syntax online. 

  • Problem with using a Spatial Query in a report region

    All: I am trying to create a report region using the below query. The query is syntactically correct and returns 10 rows. I have checked it out in SQL Developer AND in APEX SQL Workshop. It returns rows in 1-2 seconds.
    However, after putting the query into a report region, the APEX page locks up when it runs. I've tried masking it in a view, using other functions. I can places the spatial function in the select clause and it works. However, placing the function in the Where clause causes the page to lock up.
    Any thoughts?
    Thanks,
    John
    select lastname, address
    from changetracking.individuals
    where sdo_nn (spatiallocation, MDSYS.SDO_GEOMETRY(2001,8265,MDSYS.SDO_POINT_TYPE(-87.55728,33.137569,null),null,null), 'sdo_batch_size=10') = 'T

    QImaging is not officially supported in the Measurement & Automation (MAX) toolkit, though you may find some luck with our free legacy QImaging LabView interface here: http://www.qimaging.com/support/downloads/software/windows/QCamLabViewInstaller221.exe depending on the version lf LabView you're using.If you're looking for something that is actively updated and supported, you may want to get back in touch with Fred at +1.800.874.9789 and ask about our SITK LabView interface as well.
      PMQI_Josh,
    Yes I've already installed the LabVIEW interface beforehand. Also the version of LabVIEW I'm currently using is 8.6. I'll get in contact with Fred to see if there's a solution to this problem. Thank you.

  • How use parameters on a html region for report query region

    Hi all.
    I have created a number of report regions which initially query some data.
    The requeriment now is to have a date range (initial and final) and use this range as a parameter for report queries.
    i created a new region containing these two date values. Now i need to:
    - Give this date fields and initial value: say first and last day of current month.
    - Perform a validation to ensure initial date is less or equal to final date.
    - And most importantly, i need to reexecute the queries based on this date range.
    How do i do it...?
    Thanks in advance ...!

    Start here http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21679/toc.htm#
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/concept_ses_val.htm#HTMDB25030
    I can guarantee that it will be easy

Maybe you are looking for