We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to save and load report from a SQL Server Database

We can able to save and load the report set into a SQL server database. The reports has been saved and loaded through stream by getting the report stream/string using XML serialization from the report collection. Then that stream has been saved into database using WCF Service. Please follow the steps below to achieve the same.

 

Steps to Create a SQL Service for connecting to database

  1. Create a Silverlight Project along with Web application.
  2. Add the OlapCient control and two buttons as “Save report to DataBaseandLoadReport from Database” in Mainpage.xaml
  3. Create a WCF service as “OlapManager.svc” and inherit the IOlapDataProvider interface.
  4. Explicitly implement the IOlapDataProvider. The connection to the cube database is done with the help of this WCF service.
  5. For connecting to the SQL server database, create another WCF Service namely “ReportService.svc” and inherit the IReportService interface.
  6. The IReportService interface contains the following codes.

C#

 

  1. Add the following codes in ReportService.svc which helps to connect with the Database for saving and loading the report stream

C#

 

  1. Add the ServiceReferences for the ReportService.svc in Silverlight Project.
  2. Create a Silverlight ChildWindow as ReportNameLoaderChildand add the following code in the design page.

XAML

 

                      

Figure: “ReportNameLoaderChild” child window

 

  1. Initialize the connection with the OlapManager service and assigning the OlapDataManager to OlapClient.
  2. Add the following code in the Click events of Save and load buttons.

 

C#

 

  1. The following output has been displayed while running the application.

 

 

Figure: OlapClient with Save and Load Buttons

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
2760 11/21/2014 11/25/2014 Silverlight OlapClient
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.