

This blog encompasses articles, tutorials , trainings about Crystal report generation, troubleshooting and solution to the problems that occurs in different environment (windows and web). This blog also publishes articles and reports on business intelligence and its usage in the market.
"Crystal Reports 2008 brings excitement into reporting. With this release we are addressing the needs of both the report designers and the consumers of the reports. The reaction from our beta customers and partners has been overwhelmingly positive. People are telling us that the game-changing Crystal Reports 2008 has the power to transform decision-making and improve careers."
• Flexible, interactive report viewing
• Advanced report designer
• More professional looking and persuasive reports
• Comprehensive set of deployment options
• Reduced report proliferation and maintenance
• Reduced design time
• improved designer productivity
“ We have entered to a new era, today business marvels are changing, investors are demanding greater transparency, organization are responding to new social responsibilities and companies everywhere are striving to find new ways to serve the customers, better than anyone else business objects understands that they navigate these changes everyone in the organization needs accurate timely information in order to make more effective decisions , and over the years millions of people have relied on the crystal reports , a number one trust reporting software in the world to do just that. Well! a new era calls for a new solution, Introducing Crystal report 2008, a new kind of reporting solution, One that help s you to respond the changes easily and knowledgably , one that enables more informed decisions instantly , one that ensure that you and your colleagues are more productive , more competitive and one that delivers more compelling information directly with the people that matter the most your business, the customers , the crystal reports 2008 isn’t simply about helping you locate the right information. Today you need tools to help you interact with different types of data in brand new ways, you want to see information in a whole new life , and you want reports design to reduce your reliance on IT or developers , of course you also want these software to be backed by award winning technical support team, and provided by the number one business ntelligence company on the planet, Business Objects! Welcome to the new era of information enlightment, welcome to Crystal Reports 2008 “
1. In Solution Explorer, right-click the project name that is in bold type, point to Add, and then click Add New Item.
Note Xtreme.mdb is the sample database that is provided with Crystal Reports. To
locate xtreme.mdb on your hard drive for your version of Crystal Reports
Note Another way to display the Field Explorer is to go to the Crystal2. In the Field Explorer, right-click Parameter Fields and select New...
Reports menu, and then click Field Explorer.
You now use the Select Expert to set a formula that connects the City database column to
your newly created City parameter field.
To connect the City parameter to the City database column
1. On the Crystal Reports toolbar, click Select Expert.
2. In the Choose Field dialog box, under Report Fields, select Customer.City, and
then click OK.
3. In the Select Expert dialog box, within the Customer.City tab, set the dropdown list
to "is equal to."
4. In the new dropdown list that appears to the right, select the first choice in the list,
{?City}, and then click OK.
Note This selection, {?City}, is the City parameter that you created earlier.
5. From the File menu, select Save All.
You are now ready to bind the report to the CrystalReportViewer control and set the city
parameter with two initial values, Paris and Tokyo.
Binding the Report
It is assumed that you have already placed a CrystalReportViewer control on the Web or Windows Form. In the previous steps, you added a CustomersByCity report to the project.
In this section, you bind the file directory path of the CustomersByCity report to the
CrystalReportViewer control. Then you test whether the report displays correctly when
current values have not been set for its parameter field.
To bind the file directory path of the CustomersByCity report to the
CrystalReportViewer control
1. Open the Web or Windows Form.
2. From the View menu, click Code to view the code-behind class for this Web or Windows Form. 3. Locate the Form Load method (Or any other method where you want to place the code).
4. Declare a string variable, name it reportPath, and assign to it a runtime path to the
local report. This path is determined differently for Web Sites and Windows projects:
For a Web Site, pass the name of the local report file as a string parameter into the
Server.MapPath() method. This maps the local report to the hard drive file
directory path at runtime.
For a Windows project, concatenate the Application.StartupPath property with
[C#]
string reportPath = Server.MapPath("CustomersByCity.rpt");[Visual Basic]
Dim reportPath As String = Server.MapPath("CustomersByCity.rpt")
5. Assign the file directory path of the CustomersByCity report to the ReportSourceNote At compile time you will copy the report to the directory containing
the executable file.
[C#]
string reportPath = Application.StartupPath + "\\" +
"CustomersByCity.rpt";[Visual Basic]
Dim reportPath As String = Application.StartupPath & "\" & "CustomersByCity.rpt"
[C#]
crystalReportViewer.ReportSource = reportPath;[Visual Basic]
myCrystalReportViewer.ReportSource = reportPath
You are now ready to build and run your project. It is expected that the report loading will fail, because code has not yet been written to set a value for the City parameter field.
To test the loading of the CustomersByCity report
1. From the Build menu, select Build Solution.
2. If you have any build errors, go ahead and fix them now.
3. If you use a non-embedded report in a Windows project, locate the compiled Windows
executable in the \bin\debug\ subdirectory, and then
copy the report to that subdirectory.
Note To have the non-embedded report loaded by the Windows executable
at runtime, the report must be stored in the same directory as the Windows
executable.
4. From the Debug menu, click Start.
Note If you are developing a Web Site in Visual Studio 2005, and this is the
first time you have started debugging, a dialog box appears and states that
the Web.config file must be modified. Click the OK button to enable
debugging.
The CustomersByCity report does not display. It displays after you add a value for the
City parameter field later in this tutorial.
Note Results may vary, depending on the version of Crystal Reports that
you use. In more recent versions, you can see a form requesting that you
provide parameter values for that report. In earlier versions, a "Missing
parameter field current value" exception is thrown. In either case, you must
add further code to create a fully functional application.
5. Return to Visual Studio and click Stop to exit from debug mode.
Select Report type from Crystal Reports gallery.
Imports CrystalDecisions.CrystalReports.EngineNOTES: cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt") The Crystal Reports is in your project location, there you can see CrystalReport1.rpt . So give the full path name of report here. After you run the source code you will get the report like this.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As
System.EventArgs) Handles Button1.Click
Dim cryRpt As New ReportDocument
cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
End Sub
End Class
OrderMasterThe following picture shows the relations of each table :
OrderMaster_id
OrderMaster_date
OrderMaster_customer
OrderMaster_createduser
OrderDetails
OrderDetails_id
OrderDetails_masterid
OrderDetails_productid
OrderDetails_qty
Product
Product_id
Product_name
Product_price
Imports CrystalDecisions.CrystalReports.Engine
Imports
CrystalDecisions.Shared
Put the following source code in the button click
event
VB.NET Source Code
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Form1
Private Sub
Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Handles Button1.Click
Dim cryRpt As New ReportDocument
Dim
crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New
TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables
As Tables
Dim CrTable As Table
cryRpt.Load("PUT CRYSTAL REPORT PATH
HERE\CrystalReport1.rpt")
With crConnectionInfo
.ServerName = "YOUR
SERVER NAME"
.DatabaseName = "YOUR DATABASE NAME"
.UserID = "YOUR
DATABASE USERNAME"
.Password = "YOUR DATABASE PASSWORD"
End With
CrTables = cryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo =
crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
End Sub
End Class