Third party controls

Stimulsoft Reports.WPF discussion
Post Reply
rchecketts
Posts: 13
Joined: Mon Aug 16, 2010 6:32 am
Location: UK

Third party controls

Post by rchecketts »

I am in the process of evaluating Stimulsoft Reports Wpf for use with a Business Objects data source in C#, and am using version 2010.2.749.0 in VS2008 using .NET V3.5.

So far so good, I can display the text data required but I have a need to include in the report a custom wpf control. This control will use WPF drawing primitives to display a simple diagram that I will draw from the data.

In the notes of Changes in v2010.1 you state: "Now you can use the third party controls on forms of reports."

Can you explain how this is done. I have not found any documentation or sample showing this.

Thanks

Rick
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Third party controls

Post by Jan »

Hello Rick,

As i understand you need draw custom primitives on page of report? Please get latest prerelease build. After this you can use new ObjectToDraw property of Image component. You can assign this property from BeforePrintEvent of image component. For example:

Code: Select all

Image1.ObjectToDraw = myDrawing;
Property can accept ImageSource object and DrawingVisual object.

Thank you.
rchecketts
Posts: 13
Joined: Mon Aug 16, 2010 6:32 am
Location: UK

Third party controls

Post by rchecketts »

Thank you for your idea.

In my code I now have a class:

public class LevelsPageVisual
{
public DrawingVisual Drawing { get; set; }
public int ID { get; set; }
}

and a collection:

ObservableCollection levelsPageVisuals = new ObservableCollection();

I then register this collection:

stiReport.RegBusinessObject("Descriptor", "LevelDrawings", levelsPageVisuals);

So I have a number (say between 1 and 8) of DrawingVisual each of which I want rendered on a page in the report, each image is a full page.

I guess what I want is a DataBand set to LevelDrawings with an Image on the DataBand that somehow and somewhere we do Image.ObjectToDraw = Drawing;

First problem is although I see LevelDrawings in the Dictionary it only has the ID property, the Drawing property is missing.

Can you help.

If possible I would like the page(s) of drawing shown in both the Designer and the Viewer.

Thanks
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Third party controls

Post by Jan »

Hello,

Drawing property is complex object so it does not synchronize automatically in list of columns, but you can add it manually. Please check Sample1.png.

Thank you.
Attachments
562.Sample1.png
562.Sample1.png (124.97 KiB) Viewed 3194 times
rchecketts
Posts: 13
Joined: Mon Aug 16, 2010 6:32 am
Location: UK

Third party controls

Post by rchecketts »

I have this all working now.

Thanks for all your help and suggestions.

Rick
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Third party controls

Post by Andrew »

Great! We are always glad to help you!
Post Reply