1

Using Apex 4.2.1

Actually I have a Apex (IR) report and want to create a javascript function where user can see message if two report columns date are not matched. for example, in report I have column date1 and date2 so date1 can not be less than date2. so I have create a link and when click on link then popop window should comeup (javascript) message box where function compare those two dates. so i m struggling how to get report column values in javascript function.

Thx.

1
  • 2
    Do you really want to use JavaScript? I think there may be more simple solutions available. Perhaps you can remove the link, and add a new column to the report that uses a CASE statement to compare the two dates. Or if you really want a popup, perhaps make the popup display a simple apex page which compares the values using PL/SQL. A JavaScript workaround is probably possible, but it will require more work. Commented May 14, 2013 at 2:17

1 Answer 1

1

Instead of click-popup solution you could use the Highlight and Compute features of IR:

  1. Add a computed column X representing a result of comparison to your report. Actions->Format->Compute, use DECODE or CASE expressions to return 1 when date1 is lesser than date2.
  2. Highlight report rows with X=1. Actions->Format->Highlight, select a condition and a color.
  3. Optionally hide the computed column. Actions->Select Columns.
  4. Save report as default. Actions->Save Report->Save As Default Report Settings.

If you steel want to check column values by JS, use Dynamic Action for report region on After Refresh event. For example, next code goes through rows of IR based on DEPT table and alerts DNAME and LOC columns:

var $dnames = $( 'td[headers=DNAME]', this.triggeringElement );

$( 'td[headers=LOC]', this.triggeringElement ).each( function( indx, El ) {
  alert( $( El ).html() + " - " + $dnames.eq( indx ).html( ) );
} )

As you can see, I use report column aliases to filter cells.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.