locked
IReportViewerMessages for toolbar icons RRS feed

  • Question

  • The text for the toolbar icons can be customized with IReportViewrMessages. Is there any thing similar for the customization of the toolbar icons?

    Tuesday, February 25, 2014 3:31 AM

Answers

  • After some research, the "only" way I can see for changing toolbar images or size is to use JavaScript to change the HTML generated by the toolbar control. Code snippet below changes the size of the next page button from original size of 16px to 24px.

    var obj = document.getElementsByTagName("INPUT");    
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].type == "image" && obj[i].title == "Next Page") {
                        obj[i].style.height = "24px";
                        obj[i].parentNode.parentNode.parentNode.style.height = "24px";
                        obj[i].style.width = "24px";
                        obj[i].parentNode.parentNode.parentNode.style.width = "24px";
                    }
                }

    • Marked as answer by bmarvey Friday, February 28, 2014 5:25 PM
    Friday, February 28, 2014 5:24 PM

All replies

  • Hello,

    See http://msdn.microsoft.com/en-us/library/microsoft.reporting.winforms(v=vs.100).aspx => Interfaces for a list of available interfaces; there are only some for the message textes, none for the UI controls.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Tuesday, February 25, 2014 7:52 AM
  • Is there anyway to simply change the size of the toolbar icons?
    Tuesday, February 25, 2014 7:25 PM
  • After some research, the "only" way I can see for changing toolbar images or size is to use JavaScript to change the HTML generated by the toolbar control. Code snippet below changes the size of the next page button from original size of 16px to 24px.

    var obj = document.getElementsByTagName("INPUT");    
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].type == "image" && obj[i].title == "Next Page") {
                        obj[i].style.height = "24px";
                        obj[i].parentNode.parentNode.parentNode.style.height = "24px";
                        obj[i].style.width = "24px";
                        obj[i].parentNode.parentNode.parentNode.style.width = "24px";
                    }
                }

    • Marked as answer by bmarvey Friday, February 28, 2014 5:25 PM
    Friday, February 28, 2014 5:24 PM
  • Sounds interesting, but how/where do you embed the JavaScript snippet?

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Saturday, March 1, 2014 8:33 AM
  • Include it on the page that host the report viewer and have it initially run from a timer.
    Tuesday, March 4, 2014 3:57 PM