🚀 How to Freeze the Columns in the Interactive Report without Plugins (Oracle APEX)
🚩Introduction
In real-world Oracle APEX applications, Interactive Reports often become wide due to data-heavy requirements. Horizontal scrolling is common, but since Interactive Reports do not provide a built-in column freezing option, important reference columns such as IDs or names scroll out of view, affecting readability and usability.
This limitation can be addressed by implementing custom column freezing using JavaScript and CSS without any Plugins. By fixing key columns, Interactive Reports become easier to navigate and offer a spreadsheet-like, enterprise-friendly user experience.
📑 Why Column Freezing is Needed in Interactive Reports
In data-intensive applications, reports often extend horizontally due to the number of attributes required for business analysis. While horizontal scrolling allows access to all columns, it introduces a usability challenge: users lose sight of key reference information when navigating across the report.
To keep important columns (like Name, ID, or Code) always visible
-
To avoid losing track of rows while scrolling horizontally
-
To make wide reports easier to read and understand
-
To reduce repeated left / right scrolling
-
To compare data across many columns without confusion
👉 Steps to create Column Freezing in Interactive Report
Step 1:
Step 2:
Step 3:
function freezeIR(){
const colWidths = [];
const numCols = 3; // No. of Columns to be freezed in the report
// Collecting column widths
for (let i = 1; i <= numCols; i++) {
colWidths[i] = $(`#RG_EMP .a-IRR-table tr th:nth-child(${i})`).width();
}
// Reset all columns first | #RG_EMP => Static ID
$(`#RG_EMP .a-IRR-table tr th,
#RG_EMP .a-IRR-table tr td`).css({
"position": "relative",
"left": "",
"z-index": "",
"background": ""
});
// Setting styles
for (let i = 1; i <= numCols; i++) {
let leftOffset = 0;
for (let j = 1; j < i; j++) {
leftOffset += colWidths[j];
}
$(`#RG_EMP .a-IRR-table tr th:nth-child(${i}),
#RG_EMP .a-IRR-table tr td:nth-child(${i})`).css({
"position": "sticky",
"left": leftOffset + "px",
"background": "white",
"z-index": "3"
}); //css styles for freezing the column
}
}
Step 4:
function freezeIR(){ const colWidths = []; const numCols = 3; // No. of Columns to be freezed in the report // Collecting column widths for (let i = 1; i <= numCols; i++) { colWidths[i] = $(`#RG_EMP .a-IRR-table tr th:nth-child(${i})`).width();
} // Reset all columns first | #RG_EMP => Static ID $(`#RG_EMP .a-IRR-table tr th, #RG_EMP .a-IRR-table tr td`).css({ "position": "relative", "left": "", "z-index": "", "background": "" }); // Setting styles for (let i = 1; i <= numCols; i++) { let leftOffset = 0; for (let j = 1; j < i; j++) { leftOffset += colWidths[j]; } $(`#RG_EMP .a-IRR-table tr th:nth-child(${i}), #RG_EMP .a-IRR-table tr td:nth-child(${i})`).css({ "position": "sticky", "left": leftOffset + "px", "background": "white", "z-index": "3" }); //css styles for freezing the column
} }







Comments
Post a Comment