


It is advisable to display a new report on screen before sending it to the printer or a file. After this set the ∝estination property to ∐ - crypToWindow. In the properties window set the ReportFileName to the file name of the crystal report (*.rpt). This control, like the timer, will be a small square rectangle which is hidden at run-time. Select the crystal reports control icon from the toolbox and place it on a form in the usual way. To do this select ∜omponents. from the Project pull-down menu in Visual Basic. If the crystal reports icon is not visible in the toolbox then it needs to be added. On this tab make sure that the Refresh data on every print is checked. To avoid this problem go to ∟ile/Options. and select the Reporting tab. Important: By default crystal reports do not alter when the underlying data in the database changes (this is highly stupid!). When you are happy the report is complete and well designed you can save it (see ∟ile menu). If the resulting report seems a bit small, go to the Report menu and select Zoom. Īfter completing all the formatting you can check the report by clicking the Preview tab.Position this text field in the Title section of the report design and increase the font to a suitable size. This can be done by selecting Text Field. from the Insert menu and entering a suitable title in the dialog box which pops up.

So users will know what the report is for it is a good idea to give it a title. Thus, delete all text fields from the Page header section. By default the crystal report designer includes all column headings, but these can seem a bit redundant if the meaning of the data is obvious (which in this case it is). To make the publisher names standout, select the field in the report design and then change its font style to bold and italic. Once all the data fields have been included on the report the layout and format can be considered. To do this select ∝atabase Field. from the Insert menu and drag the PublisherName field from the floating window into the top section on the report design. The next step is to put a new field into this section to display the publisher names. The ∜ustom Report should stay depressed once clicked next click on the ∝ata File icon further to the right. For those not experienced with crystal reports it is probably easiest to click on ∜ustom > and then select ∜ustom Report (see screenshot below). Once in crystal reports select New. from the ∟ile menu to start creating a new report. Note: The first time crystal reports is run the application will ask for various user details, this only needs to be completed once. Start the crystal report designer by selecting Report Designer. from the √dd-Ins pull-down menu in Visual Basic. This crystal report file can then be accessed by a Visual Basic application by using the crystal report control. Instead, an application called the Crystal Report Designer must be used to open the Access database (other database formats can also be handled), set the tables and fields the report will use, graphically design the layout of the report, and then save this report into a separate crystal report file. Although an Access database can contain built in reports Visual Basic is not able to access them. Preview or print a Crystal Report from a Visual Basic application.Īfter creating a front-end to an Access 97 database in Week 12, it is likely that most applications of any complexity will need to use one or more reports to summarise or print the data.
#Crystal reports runtime designer how to
How to create a Crystal Report based on an Access database. Understand what Crystal Reports are and when to use them. The objective of this tutorial is to learn how to create and use from Visual Basic a Crystal Report:
