|
Blogs
Before getting to the nitty gritty of this blog, please note that Crystal Reports (any version, including CRVS 2010 - currently in Beta) has not been tested with Silverlight and thus is not supported. E.g.; if you find issues, Support will not be able to submit these to QA for a resolution. TS will try to help, though even this help will be limited to known solutions outside of Silverlight. In the next release of Crystal Reports for .NET 2010 (CR for VS2010, also known as CRVS2010 and CR2VS2010), there will be a WPF viewer available to embed Crystal Report reports viewing in WPF applications. However, this WPF viewer will not work with Silverlight apps. WPF and Silverlight apps are slightly different type of applications support is only provided for WPF projects. The below is a shameless plagiarism (copy / paste) of a blog I found at the following link: Ok, ok, it's not that bad. I do have the permission of Bill Kratochvil, the author of the blog to duplicate the content here. Only reason I decided to essentially duplicate the content is so that the knowledge is preserved. E.g.; if the above is removed, we loose lots of great, great info. And I have no control over somebody else's published content. However I do have some control over content published on these pages. I love information and I hate to loose it just as much or more. Call me paranoid, but I love the blog and don't want to loose it. Running Crystal Reports from Silverlight The following www.Silverlight.net webcast HTML BROWSER INTEGRATION (http://silverlight.net/learn/learnvideo.aspx?video=65683) provides the key to running Crystal Reports from Silverlight. Once you complete the webcast you'll find it takes only a few steps to get your Crystal Reports up and running. I downloaded the C# Source code from the above referenced link, added the following class (MyClass) to the HtmlInteraction_CS project's Page.xaml.cs file and updated the Button1_Click() to support it: /// <summary> public class MyClass { /// <summary> public override string ToString() /// <summary> private void Button1_Click(object sender, RoutedEventArgs e) { // Invoke the sayGoodbye javascript method HtmlPage.Window.Invoke("sayGoodbye", new string[] {para.ToString()});
With my Silverlight code completed I only needed to prepare the Website code. I renamed the testpage to CrystalReportPrototype.aspx and added the window.open("Report.aspx"+fname, "_blank") to the sayGoodbye(fname) javascript method as shown below:
DemoReport (default), DemoReport1 and DemoReport2. After I saw all was well I used Expression Blend to spiffy up the Silverlight screen (took all of five minutes): A WebCast of the above can be found here:
Ludek Uher
| |||||||||||||||||||||||