1

I have this situation in my SL4 application: We create some User Accounts in the Silverlight APP, now we want to generate printable reports for the generated accounts which we will hand out to the users. The idea is to save the information from the created account to a database, redirect from the Silverlight App to an ASP.NET page passing the ID of the stored account information and display the data in a report viewer control in asp.net from where it can be printed and exported. Is this possible or am I completely wrong? How can I redirect from silverlight to the asp.net page and how can I pass the ID?

hoetz
  • 2,368
  • 4
  • 26
  • 58
  • I have something that will work for you: http://stackoverflow.com/questions/4744457/how-to-remove-all-children-in-htmlelement-with-silverlight-c – Rumplin Nov 24 '11 at 11:38

2 Answers2

0

You can use Window.Navigate to do the same. For example,

// Navigate to the web page
System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(”http://www.xyz.com/report.aspx”));

//Open in a separate window
System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(”http://www.xyz.com/report.aspx”), “_blank”);

You can pass the id using the query-string.

See this SO question that discusses other options: redirect to another page from Silverlight

Community
  • 1
  • 1
VinayC
  • 47,395
  • 5
  • 59
  • 72
0

I have a different way of showing reports in a Silverlight application. I make use of the Acrobat Reader plugin to do the displaying for me. It does require a different method depending on whether your application is running inside or outside the browser (I check if the application is running inside the browser and change the means of display accordingly). If running inside the browser, I overlay the application with an IFrame, as I describe in this article: http://www.silverlightshow.net/items/Building-a-Silverlight-Line-Of-Business-Application-Part-6.aspx. Otherwise, I use the WebBrowser control. I have a control which does this all for you in the source code that accompanies my book, which is downloadable from the Apress website here: http://www.apress.com/9781430272076/.

NOTE: I copied this answer from my previous response to a similar question here: Show pdf inside silverlight application. PDF to XAML

Community
  • 1
  • 1
Chris Anderson
  • 8,279
  • 2
  • 20
  • 18