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

Create Matrix Report using ReportViewer in ASP.NET 2.0

Rate me:
Please Sign up or sign in to vote.
4.75/5 (11 votes)
7 Feb 2010CPOL3 min read 91.7K   2.8K   43  
This article creates matrix reports with ObjectDataSource using the ReportViewer in ASP.NET 2.0.
<%@ Page Language="C#" AutoEventWireup="true"  Title="Sample Matrix Report" CodeBehind="MatrixReport.aspx.cs" Inherits="MatrixReport._Default" %>

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
            Font-Size="8pt" Height="800px" Width="1000px">
            <LocalReport ReportPath="Report.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSourceOrders" Name="Order" />
                </DataSources>
            </LocalReport>
        </rsweb:ReportViewer>
    
    </div>
    <asp:ObjectDataSource ID="ObjectDataSourceOrders" runat="server" 
        SelectMethod="GetOrderList" TypeName="MatrixReport.OrderList">
    </asp:ObjectDataSource>
    </form>
</body>
</html>

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
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions