Archive for July 2015

How to make database connection in iReport

Friday 10 July 2015
Posted by Akshay Patil
Start with iReport :

1.Download and install iReport version 4.6.0
        
 2.Load required .jar file (ex. ojdbc14 driver for oracle database) using below navigation.
    From Menu bar:  Tools => Options

 3.Click on Add Jar Button to load library files.


4. If you do not load Oracle JDBC driver it will show below Error Message.


5. To make database connection go through below image.



6. Below window will appear. Click on New button to add new connection.



7. Select type of data source and click on Next button.


8. Enter required details in given fields and click on Test button.
JDBC Driver: For Oracle Database choose Oracle Driver.
JDBC URL: localhost is the name of the machine where database reside.
Database Port: 1521
Database: XE
Use Database user credential as database username and password.




  
9. It will show successful message if you have entered correct information.


Consider below IR report:

I want to highlight only those rows whose LOB’s value is ERP.



Create dynamic action:
  1. Name: Highlight based on LOB/Department Column
  2. Event: After Refresh
  3. Selection Type: Region
  4. Region: {select your report region}
  5. Condition: No Condition
  6. Action: Execute JavaScript code
  7. Fire On Page Load: True
  8. Code: 
 this.affectedElements.find('table.apexir_WORKSHEET_DATA td[headers="DEPARTMENT_LOB"]').each(function(i){

 var lThis=$(this);
 if(lThis.text()=="ERP"){
  lThis.parent().children().css({"background-color":"#C0C0C0"});

  lThis.parent().children().css({"color":"#CC0000"});

 }

}); 
  var lThis=$(this); if(lThis.text()=="ERP"){  lThis.parent().children().css({"background-color":"#C0C0C0"});   lThis.parent().children().css({"color":"#CC0000"});  }
}); 

  1. Selection Type: Region
  2. Region: {select your report region}

  • Result :


Note : You need to modify dynamic action JavaScript part td[headers="Column_Name"] according your report column alias.



Welcome to My Blog

Study Basics

Oracle APEX Oracle SQL Oracle PL/SQL

Popular Post

Blogger templates

Total Pageviews

Powered by Blogger.

Unordered List

Follow us on Facebook!

- Copyright © TechnicalBits -Robotic Notes- Powered by Blogger - Designed by Johanes Djogan -