Click here to Skip to main content
15,896,461 members
Articles / Web Development / ASP.NET

Integrate Reporting Services with Silverlight and RIA Services

Rate me:
Please Sign up or sign in to vote.
5.00/5 (8 votes)
28 Jul 2010CPOL3 min read 93.3K   2.3K   52  
Integrate Reporting Services with your Silverlight Line-of-Business applications.

namespace ReportingServicesDemo.Web
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data.Objects.DataClasses;
    using System.Linq;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;


    // The MetadataTypeAttribute identifies AddressMetadata as the class
    // that carries additional metadata for the Address class.
    [MetadataTypeAttribute(typeof(Address.AddressMetadata))]
    public partial class Address
    {

        // This class allows you to attach custom attributes to properties
        // of the Address class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class AddressMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private AddressMetadata()
            {
            }

            public int AddressID { get; set; }

            public string AddressLine1 { get; set; }

            public string AddressLine2 { get; set; }

            public string City { get; set; }

            public string CountryRegion { get; set; }

            public EntityCollection<CustomerAddress> CustomerAddress { get; set; }

            public DateTime ModifiedDate { get; set; }

            public string PostalCode { get; set; }

            public Guid rowguid { get; set; }

            public EntityCollection<SalesOrderHeader> SalesOrderHeader { get; set; }

            public EntityCollection<SalesOrderHeader> SalesOrderHeader1 { get; set; }

            public string StateProvince { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies BuildVersionMetadata as the class
    // that carries additional metadata for the BuildVersion class.
    [MetadataTypeAttribute(typeof(BuildVersion.BuildVersionMetadata))]
    public partial class BuildVersion
    {

        // This class allows you to attach custom attributes to properties
        // of the BuildVersion class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class BuildVersionMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private BuildVersionMetadata()
            {
            }

            public string Database_Version { get; set; }

            public DateTime ModifiedDate { get; set; }

            public byte SystemInformationID { get; set; }

            public DateTime VersionDate { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies CustomerMetadata as the class
    // that carries additional metadata for the Customer class.
    [MetadataTypeAttribute(typeof(Customer.CustomerMetadata))]
    public partial class Customer
    {

        // This class allows you to attach custom attributes to properties
        // of the Customer class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class CustomerMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private CustomerMetadata()
            {
            }

            public string CompanyName { get; set; }

            public EntityCollection<CustomerAddress> CustomerAddress { get; set; }

            public int CustomerID { get; set; }

            public string EmailAddress { get; set; }

            public string FirstName { get; set; }

            public string LastName { get; set; }

            public string MiddleName { get; set; }

            public DateTime ModifiedDate { get; set; }

            public bool NameStyle { get; set; }

            public string PasswordHash { get; set; }

            public string PasswordSalt { get; set; }

            public string Phone { get; set; }

            public Guid rowguid { get; set; }

            public EntityCollection<SalesOrderHeader> SalesOrderHeader { get; set; }

            public string SalesPerson { get; set; }

            public string Suffix { get; set; }

            public string Title { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies CustomerAddressMetadata as the class
    // that carries additional metadata for the CustomerAddress class.
    [MetadataTypeAttribute(typeof(CustomerAddress.CustomerAddressMetadata))]
    public partial class CustomerAddress
    {

        // This class allows you to attach custom attributes to properties
        // of the CustomerAddress class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class CustomerAddressMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private CustomerAddressMetadata()
            {
            }

            public Address Address { get; set; }

            public int AddressID { get; set; }

            public string AddressType { get; set; }

            public Customer Customer { get; set; }

            public int CustomerID { get; set; }

            public DateTime ModifiedDate { get; set; }

            public Guid rowguid { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies ErrorLogMetadata as the class
    // that carries additional metadata for the ErrorLog class.
    [MetadataTypeAttribute(typeof(ErrorLog.ErrorLogMetadata))]
    public partial class ErrorLog
    {

        // This class allows you to attach custom attributes to properties
        // of the ErrorLog class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ErrorLogMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private ErrorLogMetadata()
            {
            }

            public Nullable<int> ErrorLine { get; set; }

            public int ErrorLogID { get; set; }

            public string ErrorMessage { get; set; }

            public int ErrorNumber { get; set; }

            public string ErrorProcedure { get; set; }

            public Nullable<int> ErrorSeverity { get; set; }

            public Nullable<int> ErrorState { get; set; }

            public DateTime ErrorTime { get; set; }

            public string UserName { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies ProductMetadata as the class
    // that carries additional metadata for the Product class.
    [MetadataTypeAttribute(typeof(Product.ProductMetadata))]
    public partial class Product
    {

        // This class allows you to attach custom attributes to properties
        // of the Product class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ProductMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private ProductMetadata()
            {
            }

            public string Color { get; set; }

            public Nullable<DateTime> DiscontinuedDate { get; set; }

            public decimal ListPrice { get; set; }

            public DateTime ModifiedDate { get; set; }

            public string Name { get; set; }

            public ProductCategory ProductCategory { get; set; }

            public Nullable<int> ProductCategoryID { get; set; }

            public int ProductID { get; set; }

            public ProductModel ProductModel { get; set; }

            public Nullable<int> ProductModelID { get; set; }

            public string ProductNumber { get; set; }

            public Guid rowguid { get; set; }

            public EntityCollection<SalesOrderDetail> SalesOrderDetail { get; set; }

            public Nullable<DateTime> SellEndDate { get; set; }

            public DateTime SellStartDate { get; set; }

            public string Size { get; set; }

            public decimal StandardCost { get; set; }

            public byte[] ThumbNailPhoto { get; set; }

            public string ThumbnailPhotoFileName { get; set; }

            public Nullable<decimal> Weight { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies ProductCategoryMetadata as the class
    // that carries additional metadata for the ProductCategory class.
    [MetadataTypeAttribute(typeof(ProductCategory.ProductCategoryMetadata))]
    public partial class ProductCategory
    {

        // This class allows you to attach custom attributes to properties
        // of the ProductCategory class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ProductCategoryMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private ProductCategoryMetadata()
            {
            }

            public DateTime ModifiedDate { get; set; }

            public string Name { get; set; }

            public Nullable<int> ParentProductCategoryID { get; set; }

            public EntityCollection<Product> Product { get; set; }

            public EntityCollection<ProductCategory> ProductCategory1 { get; set; }

            public ProductCategory ProductCategory2 { get; set; }

            public int ProductCategoryID { get; set; }

            public Guid rowguid { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies ProductDescriptionMetadata as the class
    // that carries additional metadata for the ProductDescription class.
    [MetadataTypeAttribute(typeof(ProductDescription.ProductDescriptionMetadata))]
    public partial class ProductDescription
    {

        // This class allows you to attach custom attributes to properties
        // of the ProductDescription class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ProductDescriptionMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private ProductDescriptionMetadata()
            {
            }

            public string Description { get; set; }

            public DateTime ModifiedDate { get; set; }

            public int ProductDescriptionID { get; set; }

            public EntityCollection<ProductModelProductDescription> ProductModelProductDescription { get; set; }

            public Guid rowguid { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies ProductModelMetadata as the class
    // that carries additional metadata for the ProductModel class.
    [MetadataTypeAttribute(typeof(ProductModel.ProductModelMetadata))]
    public partial class ProductModel
    {

        // This class allows you to attach custom attributes to properties
        // of the ProductModel class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ProductModelMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private ProductModelMetadata()
            {
            }

            public string CatalogDescription { get; set; }

            public DateTime ModifiedDate { get; set; }

            public string Name { get; set; }

            public EntityCollection<Product> Product { get; set; }

            public int ProductModelID { get; set; }

            public EntityCollection<ProductModelProductDescription> ProductModelProductDescription { get; set; }

            public Guid rowguid { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies ProductModelProductDescriptionMetadata as the class
    // that carries additional metadata for the ProductModelProductDescription class.
    [MetadataTypeAttribute(typeof(ProductModelProductDescription.ProductModelProductDescriptionMetadata))]
    public partial class ProductModelProductDescription
    {

        // This class allows you to attach custom attributes to properties
        // of the ProductModelProductDescription class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ProductModelProductDescriptionMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private ProductModelProductDescriptionMetadata()
            {
            }

            public string Culture { get; set; }

            public DateTime ModifiedDate { get; set; }

            public ProductDescription ProductDescription { get; set; }

            public int ProductDescriptionID { get; set; }

            public ProductModel ProductModel { get; set; }

            public int ProductModelID { get; set; }

            public Guid rowguid { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies SalesOrderDetailMetadata as the class
    // that carries additional metadata for the SalesOrderDetail class.
    [MetadataTypeAttribute(typeof(SalesOrderDetail.SalesOrderDetailMetadata))]
    public partial class SalesOrderDetail
    {

        // This class allows you to attach custom attributes to properties
        // of the SalesOrderDetail class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class SalesOrderDetailMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private SalesOrderDetailMetadata()
            {
            }

            public decimal LineTotal { get; set; }

            public DateTime ModifiedDate { get; set; }

            public short OrderQty { get; set; }

            public Product Product { get; set; }

            public int ProductID { get; set; }

            public Guid rowguid { get; set; }

            public int SalesOrderDetailID { get; set; }

            public SalesOrderHeader SalesOrderHeader { get; set; }

            public int SalesOrderID { get; set; }

            public decimal UnitPrice { get; set; }

            public decimal UnitPriceDiscount { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies SalesOrderHeaderMetadata as the class
    // that carries additional metadata for the SalesOrderHeader class.
    [MetadataTypeAttribute(typeof(SalesOrderHeader.SalesOrderHeaderMetadata))]
    public partial class SalesOrderHeader
    {

        // This class allows you to attach custom attributes to properties
        // of the SalesOrderHeader class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class SalesOrderHeaderMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private SalesOrderHeaderMetadata()
            {
            }

            public string AccountNumber { get; set; }

            public Address Address { get; set; }

            public Address Address1 { get; set; }

            public Nullable<int> BillToAddressID { get; set; }

            public string Comment { get; set; }

            public string CreditCardApprovalCode { get; set; }

            public Customer Customer { get; set; }

            public int CustomerID { get; set; }

            public DateTime DueDate { get; set; }

            public decimal Freight { get; set; }

            public DateTime ModifiedDate { get; set; }

            public bool OnlineOrderFlag { get; set; }

            public DateTime OrderDate { get; set; }

            public string PurchaseOrderNumber { get; set; }

            public byte RevisionNumber { get; set; }

            public Guid rowguid { get; set; }

            public EntityCollection<SalesOrderDetail> SalesOrderDetail { get; set; }

            public int SalesOrderID { get; set; }

            public string SalesOrderNumber { get; set; }

            public Nullable<DateTime> ShipDate { get; set; }

            public string ShipMethod { get; set; }

            public Nullable<int> ShipToAddressID { get; set; }

            public byte Status { get; set; }

            public decimal SubTotal { get; set; }

            public decimal TaxAmt { get; set; }

            public decimal TotalDue { get; set; }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer Sigo S.A.
Venezuela Venezuela
Ernesto Herrera is a Senior Developer, Architect with more than 12 years experience, actually working with Silverlight Line-of-Bussiness Applications, he holds a MCTS Web Application 2.0 Certification, and have a wide experience with sql server since the 6.5 version, on his free time he likes to play tennis with his wife,kids and friends, also enjoy playing Wii with his sons, he works at Sigo S.A., a retail business located at Margarita Island, Venezuela.

Comments and Discussions