ASP.NET(vb.net) & ReportViewer - rsweb:ReportViewer - The ReportViewer encapsulates the methods and properties used for the ReportViewer control.
ShotDev Focus:
- ASP.NET(vb.net) & ReportViewer - rsweb:ReportViewer
Reporting Control
Tag Control :
<asp:ReportViewer ID="ReportViewer1" runat="server"></asp:ReportViewer>
Drag ReportViewer Control to ASP.NET Web Form. On ReportViewer Tasks -> Design new report.
Choose Your Data Connection or Create New Connection…
If new connection select Data source:
Click Next go to next step.
Save a ConnectionString to the configuration file.
Choose your database object. or table name.
DataSet Properties -> Choose the DataSet (Name,Data source,Available dataset)
Arrange fields , Row groups , Column group and Values.
Choose the layout.
Choose a style. and Click Finish to save Report.
On ReportViewer Tasks -> Choose Report (From creating.)
Drag ScriptManager Control to ASP.NET Web Form.
Example Code
Reportviewer.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Reportviewer.aspx.vb" Inherits="Reportviewer" %> <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.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>ShotDev.Com Tutorial</title> </head> <body> <form id="form1" runat="server"> <div> <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="643px" Height="329px"> <LocalReport ReportPath="Report1.rdlc"> <DataSources> <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" /> </DataSources> </LocalReport> </rsweb:ReportViewer> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetData" TypeName="mydatabaseDataSetTableAdapters.customerTableAdapter"> </asp:ObjectDataSource> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> </form> </body> </html>
Reportviewer.aspx.vb
Partial Class Reportviewer Inherits System.Web.UI.Page End Class
Screenshot
2promotion…
…