Change the Report Viewer Theme

This example shows how to select the report viewer theme. For creating and showing the viewer from code you will need to call the StiViewerFx.initialize() static method. Call this method in the initialize event of the application:

<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
minWidth="1024" minHeight="768" backgroundColor="#e8e8e8"
initialize="onInitialize()" xmlns:viewer="stimulsoft.viewer.*">

...

private function onInitialize(): void
{
StiViewerFx.initialize();

...
}


To change the report viewer theme all you need is to assign a new value for the StiThemeManager.theme static property, for example StiTheme.black value. After this action you can show the viewer:

private function onSetBlackThemeClick(): void
{
// Set Black theme
StiThemeManager.theme = StiTheme.black;
}

private function onShowViewerClick(): void
{
// Create new report object
var report: StiReport = new StiReport();
// Load document from XML string
report.loadDocumentFromString(documentString);
// Show report in Viewer
report.showDialog();
}


In the screenshot below you can see the result of the sample code.

Change the Report Viewer Theme