To modify automatically a report column

hi,
I have created a report (standard report) with two columns "state" and "date_state".
The column "state" is modified manually with the values 'elaboration' and 'pending', while I would want that the column "state" comes modified automatically to "date_state" = ' sysdate' when the value of "state" is = ' pending'.
how I can make?
thanks for your aid
Luigi

Luigi,
Your question has been answered. Use a trigger (at the database level) or a process (at the application level). Either will work. Which one you choose depends on your circumstances.
Here is an example of a trigger you might consider:
create or replace trigger "MY_TABLE_BU"
BEFORE
update on "MY_TABLE"
for each row
begin
if :new.state = 'pending' then
  :new.state_date := sysdate;
end if;
end;This is a very basic trigger that says something along the lines of: if I'm doing an update on a record in the table called MY_TABLE and the state column is being set to a value of 'pending' then before the record is committed, set the state_date column to todays date.
Again, this is one way to accomplish what you want. Other options are available to suit your particular needs.
Earl

Similar Messages

  • SQL report - column wrapping

    I've created quite a wide SQL report (over 20 columns) and for some reason the data in some columns is being wrapped which looks quite scruffy. Is there any way to set all the column widths to automatically expand to accommodate the contents?

    Hi ,
    You can make a copy of the report template that you are using and modify it to unwrap columns. To do so go to the report page and on right hand side under Templates you would see Report template name that you are currently referencing. click on the copy icon next to the template and give it a new name. Now edit the new template and add no wrap to the Column template 1 section.
    sample code
    <td headers="#COLUMN_HEADER_NAME#" #ALIGNMENT# class="t20data" nowrap>#COLUMN_VALUE#</td>Now all you have to do is reference this template in your report. Click on report and under Layout and Pagination -> Report Template , select new template from drop down list and click on apply changes.
    Hope this helps.
    Thanks,
    Manish

  • How to automatically send report after it is created?

    Hello,
    I am beginner and I would appreciate if someone could tell me general information.
    I found this tutorial how to save and access report.
    Storing and Accessing Reports in the Database
    In that tutorial report is saved onclick.
    Is there a way to automatically email report everytime report is generate or I should first save it (PDF, CSV,..) with SQL script and then email it?
    I also found that in Interactive report there is page process that can send e-mails. Is it possible that page process send e-mail with report or report should be also saved before sending?
    The reason for this is that we want to have a history of created reports.
    Thank you in advance.

    874887 wrote:
    The reason for this is that we want to have a history of created reports.
    Save report, then email it.
    I usually call COMMIT between the two steps.
    Use the APEX_MAIL package to send out an e-mail with an attachment.
    You should be able to modify the PL/SQL to do it all in one step
    declare
      l_report blob;
    -- Added this for APEX_MAIL
    l_mail_id NUMBER;
    begin
      l_report := apex_util.get_print_document (
      p_application_id => :APP_ID,
      p_report_query_name => 'blobquery',
      p_report_layout_name => 'blobquery',
      p_report_layout_type => 'rtf',
      p_document_format => 'pdf'
      insert into report_archive (
      filename,
      mimetype,
      report,
      created_date,
      created_by
      ) values (
      'BLOB Query Search Results ('||to_char(sysdate,'DDMonYYYY')||')',
      'application/pdf',
      l_report,
      sysdate,
      :USER
    -- COMMIT the insert so you don't e-mail out a report
    -- that was never saved
    commit;
    -- create e-mail here
    l_mail_id := APEX_MAIL.send( ... ); -- see document for usage
    APEX_MAIL.ADD_ATTACHMENT( .. ); -- see document for usage
    end;
    MK

  • How to display data in interactive report column without colons (:)

    Dear Apex gurus,
    I'm a newbie and have just created an Apex application from a spreadsheet. I've created a named list of values and used it in a checkbox against a field in the default page 3 Create form.
    When I've selected multiple values in my check box in the form, the data in the interactive report appears as one line with colons separating the selected values like this: Dog:Cat:Bird
    What I would like is to have the data appear in the interactive report column as a multi-line list like this:
    Dog
    Cat
    Bird
    I can work around this by modifying the SQL code in the Region Source of the Region Definition of the report (Default Page 1 interactive report) to replace the colons with <br>
    SELECT replace("PETS_CHOSEN",':','<br>') "PETS_CHOSEN", FROM "MYAPP" Note: this doesn't format properly in the posting. I replace the colon with a html br
    This works, but seems to be a hack to me. I am guessing that I've missed a simple option setting somewhere, but I can't find it.
    The other problem with this solution is that when I export the report to Excel, what is exported is Dog<br>Cat<br>Bird, which is seems worse than colons.
    Thanks,
    - Morgan
    Edited by: mnrussel on 16-Feb-2009 04:13

    Hi Morgan,
    I think you have at least two choices:
    1 - Replace the colons with ', ' (comma and space) - sort of reasonable on screen and in an export
    2 - Create a second page that has the same report but uses the "export: csv" template. Create a manual link to this page to replace the standard Export link. When such report pages are requested, they download immediately instead of displaying. You can, therefore, use commas in this one and &lt;br&gt; tags in the on-screen report version
    Andy
    ps - To display tags in a post, use &amp;lt; for &lt; and &amp;gt; for &gt;

  • How to refresh a report column value alone.

    Hi All,
    If we have a static report and for one of the columns of report, if I need to give a feature to click on it and a popup appears and there is a checkbox to select values on that popup page and finally after making changes and I press on apply changes, It should close the popup window and then come and change the value of that column alone in original report instead of refreshing the whole page.
    The column of the report is of type "Standard Report Column".
    How can I achieve this functionality?
    Thanks & Regards,
    Vikas
    Edited by: Vikas Krishna on Sep 29, 2009 9:47 PM

    Vikas,
    I slightly modified on of my older examples and you will find everything here:
    http://apex.oracle.com/pls/otn/f?p=31517:241
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • How to send values from a "Report Column" instead of a "Page Item" ?

    Hi there,
    Here's my case: Two pages A and B.
    Page A is used to view each employee from a selected department.
    Page B is used to created/modify employees.
    I have a create button on page A which redirect to page B.
    By default, page B is blank (as of course we have to fill the blanks to create a new employee).
    However, there is 2 values I want to send to page B (as I'd like to pre-fill some blanks) : The department ID and the Manager ID (there is one manager per department).
    ---- I succeed with the department ID because it's a page item and in the "Action When Button Clicked" of the button I filled "Set These Items" -> Item From Page B "With These Values" -> Item from Page A.
    ---- I'm confused with the Manger ID because it is not a page item but a report column and there is nothing to do like I did for the Department ID in the create button.
    I'm a bit lost cause I don't know how to transfer/send this value to the second page.
    Do you have any clue ?
    Thanks again for your time !
    BR
    Ulrich

    Ulrich,
    Maybe I have misunderstood your requirements, from those I assumed that Page 4 was already being populated with a Department ID. So my plan was to look-up the Manager ID via the known Department ID
    Here's my case: Two pages A and B.Page A is used to view each employee from a selected department.
    Page B is used to created/modify employees.
    I have a create button on page A which redirect to page B.
    By default, page B is blank (as of course we have to fill the blanks to create a new employee).
    However, there is 2 values I want to send to page B (as I'd like to pre-fill some blanks) : The department ID and the Manager ID (there is one manager per department).
    ---- I succeed with the department ID because it's a page item and in the "Action When Button Clicked" of the button I filled "Set These Items" -> Item From Page B "With These Values" -> Item from Page A.
    ---- I'm confused with the Manger ID because it is not a page item but a report column and there is nothing to do like I did for the Department ID in the create button.>
    Have you verified that you have the :P4_DEPARTMENT_ID in session?
    Does your SQL run in SQL Commands when provided a Department ID?
    Have you tried altering when the Computation fires? I recommended to start with After Regions, try some other firing points.
    Jeff

  • Read, Modify and Apply Report XML using Java Script

    Hi Guys,
    Is there any way that we can Pragmatically Read, Modify and Apply Report XML using Java Script or some other way.
    Thanks
    Kaushik
    Edited by: Kaushik K on Jun 20, 2012 8:36 PM

    Requirement ::
    Users should be able to add Column to the Report Dynamically at Runtime.
    (There are around 1000+ Users, Answers Approach is not acceptable)
    So we are planning to provide a Multi Select / Shuttle Box Option for Users to add Columns dynamically. (Only for Table View)
    What we planned to DO ::
    Create a Presentation Variable Prompt, Which reads the Metadata Table (Presentation Table.Column Name, populated using the Metadata Dictionary)
    And Create a report with One Column and the Column Fx like @{var_dynamic_columns}{'"Time"."Year","Time"."Month"'}
    With this, OBIEE is rewriting the Logical SQL Currently as "Select "Time"."Year","Time"."Month" from "A - Sample Sales" "
    But getting an error
    The number of columns returned in retrieving column metadata was invalid (expected: 1; received: 2)
    So we want to see, if we can rewrite the Advanced XML of the Report to have dynamic columns based on the Values from the Presentation Variable.
    Please help me if this is a viable solution or any other better solution.

  • Tamplate based button in  Report Column

    Hi there,
    Is there any way to put tamplate based button into report column. I have a "sliding doors" css button in my theme's CSS file and I would like to use in in the report column.
    Thanks

    Yes, I can set "Strip HTML to No" but how would I use my button template. I did create a button template under Apex and modifying theme css file, right now I would like to use this button in my report colum, basically this button will delete uploaded files from the table.
    I took this idea to reate my button template: http://woork.blogspot.com/2008/06/beautiful-css-buttons-with-icon-set.html

  • How to (un)hide report columns based on checkboxes?

    Hello,
    I have a simple report that selects 4 columns from a table.
    I would like to create 2 check boxes (at the report level, not at the row level) corresponding to 2 of the 4 report columns: When they are checked, the corresponding columns are visible. When they are unchecked, the corresponding columns are NOT visible.
    Two questions:
    1.
    This would require submitting the page automatically upon (un)checking either check box. How do I do that?
    2.
    I have attempted to use the Conditional Display properties of the report columns with hard coded values, but they don't seem to work whether the Show property of the columns is on or off. Any idea why and how to get around it? (I am using 3.2. Could this be a bug that has been fixed in 4?)
    Thanks!
    Gabor

    Hi,
    I can not find post where I have explain how sample works.But here it goes:
    You need load jQuery in page template or page HTML header if you are not using Apex 4.
    Create new blank page. In my case new page id is 70.
    Create HTML region to new page called Columns. Use wizard defaults
    Create hidden item Px_REPORT_REGION_NAME. Use wizard defaults.
    In my case hidden item name is P70_REPORT_REGION_NAME .
    Create computation before header for hidden item. Computation Type "Static Assigment".
    In computation write name you like use to your report. My case I did write "Employee report".
    Create SQL Report. In region title place your hidden item like
    &P70_REPORT_REGION_NAME.In my case I did use query
    SELECT *
    FROM empCreate check box. In my case it is called P70_SHOW_HIDE.
    Use from LOV query
    SELECT heading,
      display_sequence
    FROM APEX_APPLICATION_PAGE_RPT_COLS
    WHERE application_id = :APP_ID
    AND page_id          = :APP_PAGE_ID
    AND column_is_hidden = 'No'
    AND region_name        = '&'||'P70_REPORT_REGION_NAME'||'.' -- Change P70_REPORT_REGION_NAME to your hidden item name
    ORDER BY 2Place to report region footer
    <script type="text/javascript">
    function hideCol(pThis){
       var lRepId = '#report_data_#REGION_ID#';
       var lCol   = pThis.value;
       if(pThis.checked){
         $(lRepId + ' td:nth-child(' + lCol + ')').show();
         $(lRepId + ' th:nth-child(' + lCol + ')').show();
       }else{
         $(lRepId + ' th:nth-child(' + lCol + ')').hide();
         $(lRepId + ' td:nth-child(' + lCol + ')').hide();
    </script>Edit checkbox item and place to HTML Form Element Attributes
    CHECKED onclick="hideCol(this);"Your report template most inner table tag must have id attribute
    id="report_data_#REGION_ID#"Then you have result like this
    https://apex.oracle.com/pls/otn/f?p=40323:70
    Regards,
    Jari
    Edited by: jarola on Oct 27, 2010 11:13 PM
    Note about Apex 4 and jQuery added

  • Automatic renaming of columns

    Hi,
    Due to new busines requirements, I have to comment couple of tables in the query object. When I start compiling after commenting out the conditions and tables, it starts throwing errors BAD BIND VARIABLE xxx NOT DEFINED. Report has automatically renamed a lot of columns by itself, for e.g. a column called name has been renamed to name1. There are PL/SQL programs which refer the column name. Now when I attempt to compile the report it starts throwing the error BAD BIND VARIABLE name NOT DEFINED because it has been renamed to name1, automatically by reports. I am baffelled at this as the columns does not have any relationship to the commented out tables. Is there a way to avoid this.
    Thanks,
    Bharath

    The best way to avoid this is to alias the columns in the query. Whenever you make a change to the query, reports reparses the query. If other columns exist with the same name then a numeric suffix will be added. You could also apply the latest patch set (patch 10), as some fixes were made in this area.
    Thanks,
    Danny

  • I HAVE ENCOUNTERED A PROBLEM IN MODIFYING THE DEPARTMENTS REPORT

    I am a new learner database developer. I am now using Oracle 11g. Following the Developer tutorial on MODIFYING THE DEPARTMENTS REPORT I have encountered the following problem.
    Scroll down to Source, and replace the default Region Source script with the
    following:
    SELECT d.DEPARTMENT_ID,
    d.DEPARTMENT_NAME,
    (select count(*)from oehr_employees where department_id = d.department_id)
    "Number of Employees",
    substr(e.first_name,1,1)||'.'||e.last_name "Manager Name",
    c.COUNTRY_NAME "Location"
    FROM OEHR_DEPARTMENTS d,
    OEHR_EMPLOYEES e,
    OEHR_LOCATIONS l,
    OEHR_COUNTRIES c
    WHERE d.LOCATION_ID=l.LOCATION_ID
    AND l.COUNTRY_ID=c.COUNTRY_ID
    AND d.DEPARTMENT_ID=e.department_id
    AND d.manager_id=e.employee_id
    AND instr(upper(d.department_name),upper(nvl(:P2_REPORT_
    SEARCH,d.department_name)))>0
    6. Click Apply Changes.
    7. Click Apply Changes to confirm.
    8. Right-click Departments and select Edit Report Attributes.
    9. Click the Edit icon next to Number of Employees.
    10. Under Column Definition, select center for Column Alignment.
    11. Click Apply Changes.
    When I did it there was an error message as follows:
    ErrorRegion Source
    Query cannot be parsed, please check the syntax of your query. (ORA-00909: invalid number of arguments)+
    Unable to show report.
    Below is the syntax that was to be replaced:
    select
    "DEPARTMENT_ID",
    "DEPARTMENT_NAME",
    "MANAGER_ID",
    "LOCATION_ID"
    from "OEHR_DEPARTMENTS"
    Now; how should I correct it? I cannot move forward
    Regards
    DAVID GODIS-TEI
    Ghana

    In your post, the bind variable :P2_REPORT_SEARCH has a carriage return before the word SEARCH. Make sure this is not the case in the report.

  • Interactive report column filters to display differently than column values

    Greetings...
    We use images a lot in our interactive reports to provide a visual representation to a status, or something locked for update, or what-have-you. By default, when a user clicks the column heading of a column which contains images, the drop-down list that shows up displays the actual images, which is nice for the user to identify exactly which thing they want to filter on. The problem is when the user selects on of the options in the filtering drop-down, the resulting condition that is displayed under the interactive report search bar is the HTML code of the image. I'd like something else to display there because showing the user the HTML code is atrocious.
    I didn't think what I want is possible, but then I came across the Page Locks page within ApEx (page 4000:291 in ApEx 4.0.1) which displays a list of all the pages of an application and whether they are locked or not. It also allows you to bulk lock or bulk unlock a bunch of pages. That page uses an interactive report with a column called "Status" which contains images that represent whether the page is locked or not. When you click the "Status" column heading to filter, instead of seeing the images of an open and closed lock, you see the words "Page Locked" and "Page Unlocked." And even better... when you select on of them, the condition that is displayed to the user is very user-friendly.
    Can someone tell me how this is done so I can replicate it in my own apps?
    Shane.

    Why not create the IR using the text you require e.g. 'Lock', 'Unlock' and then use JQuery to replace the text in the report with the image you want. All the filters should then show the plain text and the report will display the image. e.g.
    http://apex.oracle.com/pls/apex/f?p=46801:1
    Here's what I did:
    Firstly make sure the IR has a region template.
    Then create a Dynamic Action with the following attributes:
    1. Advanced
    2. Event: After Refresh
    3. Selection Type: Region
    4. Region: [select the IR Region]
    5. Action: Execute JS Code
    6. Fire on page load: [checked]
    7. Code:
    $('td [headers="TEST"]').each(function(index) {
      if ($(this).text() == 'Lock') {
        $(this).empty().html('<img src="/i/htmldb/icons/locked_small.gif" alt="Lock" />');
      else {
        $(this).empty().html('<img src="/i/htmldb/icons/unlocked_small.gif" alt="Unlock" />');
    });Where TEST is the column name.
    That's it, this may also be of interest:
    http://simonhunt.blogspot.com/2011/10/adjusting-interactive-report-column.html
    I hope it helps
    Shunt

  • Display an alert message through javascript when report column item is null

    Hello,
    I have a report column item which is an select list item and now i want to display an alert message when value is null, I mean no value is selected, this alert message should be fired when update button is clicked.
    Can anyone please help me with this issue.
    Thanks,
    Orton

    You could try something like this:
    declare
      x        INTEGER;
      err_ct  INTEGER   := 0;
    begin
      x  := 5;  -- number of rows displayed
      for i in 1 ... x (
        IF wwv_flow.g_f08(i)) IS NULL THEN err_ct  := err_ct + 1;
        END IF;
      end loop;
      IF err_ct = 0 THEN
         RETURN NULL;
      ELSE
        RETURN 'Nice error message: you must supply a value.';
      END IF;This would be used with a PL/SQL validation: Function Returning Error Text.

  • Cannot edit a field that is "Standard Report Column" when new row added

    Hi everyone,
    I have created a master-detail form from the wizard and within the detail report region source I have used apex_item.xxx API
    example;
    select C1, C2,
    CASE when C2 ='N' then
    apex_item.select_list_from_query(3, C3,'select a1 d, a2 r from table1', 'ENABLED', 'NO',null,null, 'f03_#ROWNUM#')
    else
    apex_item.select_list_from_query(3, C3,'select a1 d, a2 r from table1', 'DISABLED', 'NO',null,null, 'f03_#ROWNUM#')
    END C3
    from table;
    All columns C1,C2,C3 are defined as "Standard Report Columns".
    The results allows the column C3 field to be enabled or disabled for input depending on a condition.
    The problem is when you hit the default button "Add Row" to add a new row. The row is non-editable and is populated with null values.
    What I want is to allow input when a new row is inserted into the multi-row detail form.
    Can any one help?
    Is there a way to change the Display As field for the new row columns to "text field" from "standard report column" dynamically?

    I think you will need to use the old way of adding rows instead of the new one. I remember having headaches trying to get it working.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How can i define the width of report column in report region ?

    Hi,
    I have report region and i want to have a static width for each column ( not based on column name of column data ), how can i do it ?
    Thanks in advance ,
    Yoel

    Can you provide more details pls? I am also trying to change widht of report columns and I do not see anywhere in reports atrributes where it allows me to do that...Thanks so much!

Maybe you are looking for

  • Itunes closing after 1 minute of sycnhing

    I have a very strange problem, i have an ipod touch 4th generation and itunes 10. When i plug in my ipod it starts synchronizing, but after 1 minute of synching itunes closes and it stops synching. First i didnt have any problems but now i do. I also

  • Bluej package problem

    Hi, can anyone help im trying to get a pakage to work in bluj compiler but keep getting the error package does not exist this is how the import statement is write the other query I have is do where do I put the package as the package I am using is fr

  • Validating Opportunity close date

    I was requested to create a validation for Opt. Close Date - Something like: If changed from the previous value it should be in the same quarter. Other than that it would be invalid. I still trying but started using PRE(JulianQtr([<CloseDate>])) and

  • Hardlocked

    Hi, my bb 8520 got hard locked and displaying 0mep left, so plz help me out asap. Regards.

  • Standlone weblogic server error

    Use jdev 11.1.1.3 My application runs well in embedded server. But when deployed in a standalone server, I get this error. This happens after I click a checkbox / save and then scroll through the rest of the rows. This does not happen in the embedded