Archive for November, 2012

Remove the Stimulsoft Reports WinRT Charms

Usually when you prepare you’re Application for publishing on the Windows Store you make the finishing touches and add the Settings Charms and the About and Settings dialogs.

But on the Page where the Stimulsoft ReportViewer is present you have a surprise, it has his own charms for Localizations and About, so how do you remove that?

Just add this line on page initialization :

StiSettingsPaneHelper.Destroy();

Happy codding!

Advertisements

Leave a comment

Customize the Stimulsoft Reports WinRT ReportViewer control

The Stimulsoft Reports are great especially that they are the single reporting solution for WinRT ( at the moment ) so in order to remove the orange border and the report background I had to  use tools like Silverlight Spy or XAML Spy to have a look at the Visual Tree to identify the border and the Background Path and then make a method that will get that object and change it or remove it.

I do have my own visual tree helpers but I also found a good and simple solution that will help me get each visual element.

You can find more details on how this works from here .

I am guessing that you’ve already installed the Stimulsoft Reports.WinRT and that you already have the library’s that you need and have all the project setup , or you can have a look at this  video .

Now I used the XAML spy, took a look and so that my border is the second Border and the container that have the background is the first Grid.

private void RemoveBorderFromReport()
{
IEnumerable<Windows.UI.Xaml.Shapes.Path> paths = ViewerControl.GetVisuals().OfType<Windows.UI.Xaml.Shapes.Path>();
//remove background
if (paths != null)
{
paths.ElementAt(0).Data = null;
}
Border border = ViewerControl.GetVisuals().OfType<Border>().ElementAt(1);
 
if (border != null)
{
border.BorderThickness = newThickness(0);
}
if (border != null)
{
border.CornerRadius = newCornerRadius(0);
}
Grid grid = ViewerControl.GetVisuals().OfType<Grid>().ElementAt(0);
grid.Background = newLinearGradientBrush();
}
 
Before                                          After
                    
 
 Is a bit Hacky but is the only solution I know.
Happy codding!

Leave a comment