Crystalreport 121016050519 Phpapp02
Crystalreport 121016050519 Phpapp02
This model also allows the shaping and filtering of data before it
reaches the report.
Steps to create a crystal report
• Create a new website and right click on solution explorer >
add new Item > Select Crystal Report
In the dialog box choose blank report.
• Now click on CrystalReports Menu in VS and select DataBase
Expert
• In database expert dialog box expend create new connection
> OLEDB(ADO) section
• Now select Microsoft OLE DB provider for sql server
• Connection information
• Selected data base you choose was selected
• In next screen Expend your database objects in left pane and
add the tables you want to use in right pane
• Then after next step view the field explore shown like this
• Now design the report , drag and fields from Database fields
in field explorer and which you want to show in report and
drop them in Section3(Details), and preview the report, it
should look like show below.
• Report preview look like this
Create a aspx page
• <form id="form1" runat="server">
<div>
<CR:CrystalReportViewer ID="CrystalReportViewer1"
runat="server" AutoDataBind="True" Height="1039px"
ReportSourceID="CrystalReportSource1" Width="901px" />
<CR:CrystalReportSource ID="CrystalReportSource1"
runat="server">
<Report FileName="CrystalReport.rpt"> </Report>
</CR:CrystalReportSource>
</div>
</form>
Code Behind
• Protected Sub Page_Load (ByVal sender As Object, ByVal e As
EventArgs)
Dim crystalReport As New ReportDocument()
crystalReport.Load(Server.MapPath("CrystalReport.rpt"))
crystalReport.SetDatabaseLogon ("amit", "password",
"AMIT\SQLEXPRESS", "TestDB")
CrystalReportViewer1.ReportSource = crystalReport End Sub
Thank you
Disclaimer: This presentation is prepared by trainees of baabtra as a part of
mentoring program. This is not official document of baabtra – Mentoring Partner
baabtra – Mentoring Partner is the mentoring division of baabte System Technologies Pvt. Ltd
Contact Us