Page 1 of 1
Third party controls
Posted: Mon Aug 16, 2010 9:13 am
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
Third party controls
Posted: Tue Aug 17, 2010 1:11 am
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:
Property can accept ImageSource object and DrawingVisual object.
Thank you.
Third party controls
Posted: Fri Aug 20, 2010 8:58 am
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
Third party controls
Posted: Mon Aug 23, 2010 7:48 am
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.
Third party controls
Posted: Thu Aug 26, 2010 5:26 pm
by rchecketts
I have this all working now.
Thanks for all your help and suggestions.
Rick
Third party controls
Posted: Thu Aug 26, 2010 10:26 pm
by Andrew
Great! We are always glad to help you!