Page 1 of 1

StiWpfViewerControl background color

Posted: Thu Jun 21, 2012 7:36 am
by ratige
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#

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;
        }

StiWpfViewerControl background color

Posted: Thu Jun 21, 2012 8:38 am
by Alex K.
Hello,

We made some improvements in that direction. You can set the DockPanelMain property for StiWpfViewerControl.
Please check the next prerelease build.

Thank you.

StiWpfViewerControl background color

Posted: Thu Jun 21, 2012 8:44 am
by ratige
Aleksey wrote:Hello,
You can set the DockPanelMain property for StiWpfViewerControl.
Thank you.
What do u mean under setting DockPanelMain property? which property I should set? I want to change that gay blue style background color when displaying report inside StiWpfViewerControl

Screenshot

StiWpfViewerControl background color

Posted: Thu Jun 21, 2012 3:11 pm
by ratige
Can someone confirm this bug? as We are in a situation which really requires from us to solve this issue ASAP.

StiWpfViewerControl background color

Posted: Fri Jun 22, 2012 1:54 am
by Alex K.
Hello,

This is the DockPanel, which we set Background. You can set the
wpfViewerControl.DockPanelMain.Background = null,
and get what you need.

Thank you.

StiWpfViewerControl background color

Posted: Fri Jun 22, 2012 5:49 am
by ratige
Ok I check this but there is no such property neither in stiWpfViewerControl1 XAML nor in code Our version of Stimulsoft is 2012.1

Could you please provide information where I can find this property?

That I found it but it is not e property it is a private field which gets its' value during constructor call so it seems there is no way to set it. ideal solution would be to set background from XAML style

StiWpfViewerControl background color

Posted: Fri Jun 22, 2012 7:22 am
by Alex K.
Hello,

This property will be available in prerelease build which will be available today.

Thank you.

StiWpfViewerControl background color

Posted: Fri Jun 22, 2012 9:35 am
by ratige
I managed to remove that background, but the only way this is possible is to write this code

Code: Select all

                var panel = (DockPanel)stiWpfViewerControl1.FindName("dockPanelMain");
                if (panel != null) panel.Background = null;

StiWpfViewerControl background color

Posted: Mon Jun 25, 2012 2:20 am
by Alex K.
Hello,

Yes, you can use or this or our method for this task.

Thank you.