How to Customize Sorting Icons in Bold Reports Report Viewer
How to Customize Sorting Icons in Bold Reports Report Viewer
To customize the interactive sorting icons in the Bold Reports Report Viewer, override the three built-in sorting-icon CSS classes with your own images. Target .e-reportviewer-sortingUpDown, .e-reportviewer-sortingUp, and .e-reportviewer-sortingDown, set each one’s background to your icon URL, and add the rules to a <style> block in your application.
When to use this
Use this when a report has interactive sorting enabled and you want the ascending, descending, and unsorted arrow icons in the column headers to match your application’s theme or brand. The result is the same sorting behavior with your own icons in place of the defaults.
Steps
-
Identify the three sorting-icon CSS classes used by the Report Viewer:
.e-reportviewer-sortingUpDown— the combined up-and-down (unsorted) arrow icon..e-reportviewer-sortingUp— the ascending (up) arrow icon..e-reportviewer-sortingDown— the descending (down) arrow icon.
-
Override each class with your own image. Add the rules to your application’s stylesheet, or to a
<style>block on the page. Replace each<your-icon-url>placeholder with the path to your icon:.e-reportviewer-sortingUpDown { background: url("<your-icon-url>") !important; background-repeat: no-repeat !important; background-size: contain !important; } .e-reportviewer-sortingUp { background: url("<your-icon-url>") !important; background-repeat: no-repeat !important; background-size: contain !important; } .e-reportviewer-sortingDown { background: url("<your-icon-url>") !important; background-repeat: no-repeat !important; background-size: contain !important; }The
!importantflag is required so your rule wins over the viewer’s default icon style.background-repeatandbackground-sizekeep a single icon from tiling or overflowing its box. -
Load this CSS after the Report Viewer styles, then refresh the report. The column headers now show your custom icons.
Note: The URLs above are placeholders. Point each one at an icon your users can load — a hosted HTTPS image or a path bundled with your application. Icons served over HTTP on an HTTPS page are blocked as mixed content.
Result
The sorting controls in each enabled column header display your custom icons: the unsorted state, the ascending state, and the descending state. Clicking a header still sorts the column in ascending or descending order as before.
Troubleshooting
The custom icon does not appear after adding the CSS
The viewer’s default style is overriding yours, or your stylesheet loads first. Keep the !important flag on each rule, and make sure your CSS is applied after the Report Viewer’s own styles.
The icon area is blank or shows a broken image
The icon URL cannot be loaded. Confirm the path is correct and publicly reachable, serve it over HTTPS when the page is HTTPS to avoid mixed-content blocking, and check the browser console for a 404 or CORS error.
The icon is the wrong size or repeats across the header
The background image has no size or repeat rule. Add background-size: contain; and background-repeat: no-repeat; to each class, as shown in the steps.