Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4 Crystal Report Presenter: PEN PHIROM (MscIT) Phone: 012 602908

Similar presentations


Presentation on theme: "Chapter 4 Crystal Report Presenter: PEN PHIROM (MscIT) Phone: 012 602908"— Presentation transcript:

1 Chapter 4 Crystal Report Presenter: PEN PHIROM (MscIT) Phone: 012 602908 E-mail: penphirom@yahoo.com

2 Content Report Design Concept Introduction To Report Step to create report in crystal report Formatting Record Selection Sorting, Grouping, and Totaling Running Totals Formulas Parameter Fields Embed crystal report with VB

3 Report Design Concept The basic report design –Deciding on the content of the report –Developing a prototype on paper

4 Deciding on the content of the report Stating the purpose: –What is the overall purpose of the report? –Who is going to read the report? Determining the layout of the report: –What is the report title going to be? –What identifying information is needed in the header and footer? Finding the data: –What data do you want to use in the report? –What specific data should appear in the body of the report? –Does the data exist or does it need to be calculated? –What types of fields contain data?

5 Deciding on the content of the report Manipulating the data: –Do you want the data organized into groups? –Do you want the data sorted based on record or group values? –Do you want the report to contain only specific records or groups? –Do you want to summarize the data? –What information should be flagged on the report? –How do you want information flagged? Determining printing area characteristics –In what order will the areas print on the report? –How often do report objects print? Report Header Page Header Group Header Details area Group Footer Report Footer Page Footer

6 Developing a prototype on paper To design a paper prototype 1.Get the same size paper you will be using for the finished report. 2.Position the title and other descriptive header information, using boxes or lines to represent report elements. 3.Position the footer information. 4.Review the page layout for balance. 5.Look at the information you intend to include in the body of the report. 6.Use small boxes to indicate group values and totals. 7.Place random flags in the column where you want flags to appear. 8.Darken any elements you want highlighted to make them stand out from the rest of the prototype. 9.Review the finished product for layout and balance, and make changes as needed.

7 Introduction To Report Crystal Report provide feature for create report: –Report creation options –Choosing data sources and database fields –The report design environment

8 Report creation options Crystal report provides 3 option for create report: –Use a Report Creation Wizard. –Use another report as a model. –Create a report from scratch.

9 Choosing data sources and database fields The Database Expert provide 2 tabs: –Data Tab: shows a tree view of possible data sources you can select when creating a report. Data tab have: Current Connections: shows a list of data sources you are currently connected to. Repository: shows a list of data source connections that have been stored in the Crystal Repository. Favorites: shows a list of data sources you commonly use and have maintained in your Favorites list. History: shows a list of data sources you have used recently. The last five data sources used are displayed. Create New Connection: shows subfolders for various data sources you can connect to. –Links tab: database tables are linked so records from one database match related records from another.

10 The report environment Design Tab: is the place you do most of the initial work when creating a report. Design Tab area consist of: –Report Header: This section is generally used for the report title and other information you want to appear at the beginning of the report. – Page Header: This section is generally used for information that you want to appear at the top of each page. –Details: This section is used for the body of the report, and is printed once per record. –Report Footer: This section is used for information you want to appear only once at the end of the report. –Page Footer: This section usually contains the page number and any other information you want to appear on the bottom of each page. –Group Header: This section typically holds the group name field, and can be used to display charts or cross-tabs that include data specific to the group. –Group Footer: This section generally holds the summary value, if any, and can be used to display charts or cross-tabs.

11 Design Tab Area

12 Step to create report in crystal report To create report you must follow these step: 1.select a data source 2.add a table (Link Table) or query 3.Placing data on the report 4.Formatting data 5.Record selection 6.Grouping, sorting, and summarizing data

13 Formatting Formatting: refers to changes in the layout and design of a report, as well as the appearance of text, objects, or entire report sections. You can use formatting to do many things, including: –Dividing sections of a report. –Calling attention to certain data. –Changing the presentation of dates, numbers, Boolean values, currency values, and text strings. –Hiding unwanted sections. –Giving the report a professional appearance.

14 Formatting Using the Report Design Environment –To create a multiple-column report –Hiding report sections: Hide (Drill-Down OK) Suppress (No Drill-Down) Suppress Blank Section –Hiding report objects by using Suppress If Duplicated (Common tab) –To set specific margins To add borders, color, and shading to a field To specify default formats for fields Working with conditional formatting –To change conditional fonts –Using the Highlighting Expert

15 Record Selection Record selection: shows you how to filter the records you want included in a report. Record selection provides two ways to do: –Using the Select Expert –Using formulas

16 Sorting, Grouping, and Totaling Sorting, grouping, and totaling: are the steps that turn disorganized data into useful information on a report. –Sorting data: means placing data in some kind of order to help you find and evaluate it. –Grouped data: is data that is sorted and broken up into meaningful groups. –Summarizing grouped data: the way that grouped, sort, and make calculate the data. –A subtotal: is a summary that totals or sums numeric values in a group.

17 Running Totals Running totals: are a flexible and powerful way to create specialized summaries and continually incrementing totals. Running total fields are specifically suited to perform the following totaling functions: –Show values of a total accumulate as it is calculated record by record. –Total a value independent of the report's grouping. –Total a value conditionally. –Total a value after a group selection formula has been applied. –Total a value from the driving table in a one-to-many linking relationship. Running Total can be created such as: –Creating running totals in a list –Creating running totals for a group –Creating conditional running totals –Creating running totals in a one-to-many linking relationship –Creating running totals using a formula

18 Formulas Formula: is used create a calculation field. Typical uses for formulas: –Creating calculated fields to add to your report –Formatting text on a report –Pulling out a portion, or portions, of a text string –Extracting parts of a date –Using a custom function Formulas contain two critical parts: –Components: are the pieces that you add to create a formula. –Syntax: is the rules that you follow to organize the components.

19 Formula components You can use any of the following components in your formula: –Fields: ( {customer.CUSTOMER LAST NAME} ) –Numbers: ( 1,1.5, -50 ) –Text: ( “John” ) –Operators: ( +, -, *, /,….) –Functions: ( Trim(x) ) –Custom functions: –Control Structures: ( if, select, for ) –Group field values: ( Average(x) ) –Other formulas: ( {@GrossProfit} )

20 Formula syntax In crystal report formula support 2 types of syntax: –Crystal syntax: is the formula language included in all versions of Crystal Reports. –Basic syntax: is modeled on Visual Basic except that it has specific extensions to handle reporting.

21 Specifying formulas There are several different kinds of formulas in Crystal Reports: –Report formulas: are formulas that you create to stand alone in a report. –Conditional formatting formulas: change the layout and design of a report, as well as the appearance of text, database fields, objects, or entire report sections. –Selection formulas: specify and limit the records and groups that appear in a report. –Search formulas: help you locate data in your report. –Running Total condition formulas: let you define the condition upon which your running total will be evaluated or reset. –Alerting formulas: help you define conditions and messages for report alerts.

22 Parameter Fields By using parameter fields in formulas, selection formulas, and in the report itself, you can create a single report that you can modify whenever your needs change. Feature of parameter field: –Support with multiple values –Support both discrete and range value –Incorporating a parameter into a formula –Defining sort order using parameter fields –Support Default value

23 To create a parameter field 1.Open report in the Design tab. 2.On the View menu, click Field Explorer 3.Select Parameter Fields and click New 4.Enter a name for the parameter in the Name field 5.Enter the desired prompting text in the Prompting text field 6.Select the appropriate Value type from the list 7.Click Set default values 8.Chose Option for parameter field 9.Click OK 10.Drag and drop parameter field into your report

24 Embed crystal report with VB To embed crystal report with VB follow these step: 1.Copy a designed report to VB project folder 2.Open VB Project 3.Click on Project  Add Crystal Report 9 4.Select on From an Existing Report 5.Select on Report you want to embed 6.Click OK


Download ppt "Chapter 4 Crystal Report Presenter: PEN PHIROM (MscIT) Phone: 012 602908"

Similar presentations


Ads by Google