ASP.NET(vb.net) & CrystalReportViewer - The CrystalReportViewer control allows a Crystal Report to be viewed in an application. this an example how to create and using CrystalReportViewer control.
ShotDev Focus:
- ASP.NET(vb.net) & CrystalReportViewer
Drag control CrystalReportViewer to ASP.NET Web Form and Click CrystalReportViewer Tasks -> Choose Report Source -> <New data sourceā¦>
Input specify a name for the CrystalReportSource control. You can select an existing report Or create new report.
If create new report. Input a name for the new report.
Select a Using the Report Wizard and Click OK.
Create New Connection.
This sample a Access Database. Select Database Name :
Choose the data you want to report on.
Choose the information to display on the report.
Design on Report.
Example Code
Default.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <%@ Register assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %> <!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> <CR:CrystalReportViewer ID="CrystalReportPartsViewer1" runat="server" AutoDataBind="True" Height="1106px" ReportSourceID="CReportSource1" Width="876px" /> <CR:CrystalReportSource ID="CReportSource1" runat="server"> <Report FileName="CReport1.rpt"> </Report> </CR:CrystalReportSource> </div> </form> </body> </html>
Default.aspx.vb
Partial Class _Default Inherits System.Web.UI.Page End Class
Screenshot
1materials…
…