StiWpfViewerControl background color

Stimulsoft Reports.WPF discussion
Post Reply
ratige
Posts: 5
Joined: Thu Jun 21, 2012 7:24 am

StiWpfViewerControl background color

Post 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;
        }
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

StiWpfViewerControl background color

Post 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.
ratige
Posts: 5
Joined: Thu Jun 21, 2012 7:24 am

StiWpfViewerControl background color

Post 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
ratige
Posts: 5
Joined: Thu Jun 21, 2012 7:24 am

StiWpfViewerControl background color

Post by ratige »

Can someone confirm this bug? as We are in a situation which really requires from us to solve this issue ASAP.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

StiWpfViewerControl background color

Post 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.
ratige
Posts: 5
Joined: Thu Jun 21, 2012 7:24 am

StiWpfViewerControl background color

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

StiWpfViewerControl background color

Post by Alex K. »

Hello,

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

Thank you.
ratige
Posts: 5
Joined: Thu Jun 21, 2012 7:24 am

StiWpfViewerControl background color

Post 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;
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

StiWpfViewerControl background color

Post by Alex K. »

Hello,

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

Thank you.
Post Reply