Use Custom Collapsing Images

This example shows how to change the Standard collapsing of images in the Viewer to Custom. For this, you can use the StiOptions static class. It contains a huge set of options for Stimulsoft Reports. To change the collapsing images, please set the UseCustomCollapsingImages option to true, then set the path to custom images using the CollapsedImagePath and ExpandedImagePath options. After these actions you can show the report in the Viewer:

public Window1()
{
StiOptions.Wpf.CurrentTheme = StiOptions.Wpf.Themes.Office2013Theme;
StiOptions.Wpf.Viewer.CollapsingImages.UseCustomCollapsingImages = true;
StiOptions.Wpf.Viewer.CollapsingImages.CollapsedImagePath =
"pack://application:,,,/CustomCollapsingImages;component/Images/Collapsed.png";
StiOptions.Wpf.Viewer.CollapsingImages.ExpandedImagePath =
"pack://application:,,,/CustomCollapsingImages;component/Images/Expanded.png";

InitializeComponent();
StiReport report = new StiReport();

DataSet ds = new DataSet();
ds.ReadXmlSchema("..\\..\\Data\\Demo.xsd");
ds.ReadXml("..\\..\\Data\\Demo.xml");
ds.DataSetName = "Demo";

report.Load("..\\DrillDownGroupWithCollapsing.mrt");
report.RegData(ds);

report.Compile();
report.Render(false);
viewer.Report = report;
}


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

Custom Collapsing Images