Senin, 09 Februari 2009

Using Crystal Reports


By Anne-Marie Wright

'Crystal Reports' is a popular third party package that is included with Visual Basic, which allows you to create reports for your application. The package consists of a designer - where you can design and test the reports, Crystal Reports API calls and Crystal Reports control.

Note: Crystal Reports is shipped and installed as part of the VB installation package except in VB6. This can be found in \common\tools\crysrep double click on crystl32.exe to install.

Creating a Report
VB5 or less
To access the Crystal Report Designer, select the Report Designer from the Add-In menu in the VB environment

VB6
To access the Crystal Report Designer, a Start menu group and shortcut will have been automatically created.

Lets have a quick look at the Designer

Using Crystal Reports in VB
When you have designed your report, the saved file should have an extension .rpt. You can use this report with the Crystal Report control to display or print your report in a VB application.

Note:Check the crystal report help files for the files you need to distribute with the control. You will also need any .rpt files that you have created

You will have to add the Crystal Report control to the toolbox, this is done by going to the Project menu and selecting Components, then looking down the list for the control and clicking on it

To use the control add it to a form and set the following properties

ReportFileName - The path and the filename of the .rpt file you have created
DataFiles(0) - The path and the filename of the database that you want it to use.
If this is left blank it will use the one in the report.
SelectionFormula - The formula to select the subset of data that you want.
Destination - 0 to Preview, 1 to Print
To display the report use the .printreport method i.e CrystalReport1.PrintReport

There is alot more to crystal reports than I have covered here, but I hope it gives you an idea of how Crystal Reports works. I have not used the new features in Version 8, but it should still work.



source: http://www.vbexplorer.com/VBExplorer/VBExplorer.asp


---------------------------------


Related :

UsingCrystalReports6
VerifyUserEmailAddressPHP-1
VerifyUserEmailAddressPHP-2
viewinformationvb2005
WatermarkImagesFlyPHP-1
WatermarkImagesFlyPHP-2
WhatAretheIssues
What-isMySQL
WhatSQLServerExpress
writefileinvb2005
WritingFileDialogBox
SimpleDatabasevb6
SQLServer2005fromVisualBasic6
SQLServer2005withPHP
SQLServerSecurityGuidelines
TransferringFiles
UsingCrystalReports6