StiWpfViewerControl background color
Posted: Thu Jun 21, 2012 7:36 am
Today I tried to change background color of StiWpfViewerControl in our WPF application, but trying all the possible solutions We did not manage to accomplish this. this control is placed inside DockPanel and we want to make its background color transparent.
here is sample code for both XAML and c#
here is sample code for both XAML and c#
Code: Select all
Code: Select all
public MainWindow()
{
DataSet ds = null;
InitializeComponent();
try
{
var report = new StiReport();
StiOptions.Viewer.Windows.BackgroundColor = System.Drawing.Color.Transparent; // works only if ShowWithWpf() method called
stiWpfViewerControl1.Background = new SolidColorBrush() { Color = Colors.Red }; // Does not work
report.Load("DemoReport.mrt");
report.Compile();
report.Render(false);
//report.ShowWithWpf();
stiWpfViewerControl1.Report = report;
}