Unit 15: Introduction to BCB QuickReport 3.0 - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Unit 15: Introduction to BCB QuickReport 3.0

Description:

Unit 15: Introduction to BCB QuickReport 3.0. Overview of QuickReport 3 ... Can upgrade to Professional version (QR 5.0) QReport Component Palette ... – PowerPoint PPT presentation

Number of Views:194
Avg rating:3.0/5.0
Slides: 14
Provided by: conest
Category:

less

Transcript and Presenter's Notes

Title: Unit 15: Introduction to BCB QuickReport 3.0


1
Unit 15 Introduction to BCB QuickReport 3.0
  • Overview of QuickReport 3
  • A Simple Report Customer Listing
  • Exercise Creating A Simple Report
  • Adding Group Header/ Functions
  • Assignment 8 Employee Type Listing

2
Overview of QuickReport 3.0
  • Qusoft (3rd-party) components
  • Generate reports quickly
  • Reuse BCB data module
  • Components is Dataset-aware (i.e., links to
    TADOTable or TADOQuery)
  • Using QuickReport 3.0 for BCB
  • Pro easy to learn and use bundled with BCB
    print preview capability
  • Con limited capability (e.g., Expression
    Wizard) some BCB bugs be prepared to do some
    rework!
  • Can upgrade to Professional version (QR 5.0)

3
QReport Component Palette
  • TQuickRep and band components
  • Printable components

TQRDBText
4
Simple Report Demo
  • Customer Listing

5
A Simple Report (1)
  • Create a New Application
  • frmMain (save as frmMainC.cpp)
  • Create a New Data Module (DM)
  • TADOConnection C\Program Files\Common
    Files\Borland Shared\Data\bcdemos.mdb (conDemo)
  • TADOTable customer (tblCustomer)
  • OnCreate event tblCustomer-gtOpen()

6
A Simple Report (2)
  • Create a New Report
  • File New Other Report (New tab)
  • Name repCustomer
  • save as repCustomerC.cpp
  • Link to tblCustomer DataSet
  • Include DMs header
  • Dataset DM-gttblCustomer
  • Set BandsHasDetail item to true
  • Add a TQRDBText component
  • DataSet DM-gttblCustomer
  • DataField Company

7
A Simple Report (3)
  • To Preview at design time
  • In repCustomer design right-click and Preview
  • To Preview at run time
  • In frmMain Add a button and include repCustomer
    header
  • OnClick Event repCustomer-gtPreview()
  • Trouble-shooting
  • In repCustomer.h Manually rename the constructor
  • __fastcall TrepCustomerTrepCustomer(TComponent
    Owner)
  • Note Constructor must have the same name as the
    class name. This is a known BCB/QuickReport bug

8
Layered Architecture
  • frm can use rep and DM rep can use DM
  • rep should not use frm DM should not use rep and
    frm
  • Data controls (e.g., TDBEdit) uses DataSource
  • Report controls (e.g., TQRDBText) uses DataSet

Functions
9
Your Turn
  • Using bcdemos.mdb, generate a Customer Listing
  • Refer to previous slides for details
  • Also, read and study
  • BCB6 Help Quick Reports
  • Quick Report User Guide
  • Your First Report (use ADOTable instead)

10
Extra 1 Adding Group Header to Customer Listing
  • Add TQRGroup (for group header)
  • To group by first character of Company
  • Set Expression to COPY(Company,1,1)
  • Add TQRExpr to group header
  • Set Expression to COPY(Company,1,1)
  • In data module (DM)
  • Set tblCustomers IndexFieldName to Company
  • Recommendation
  • Regularly backup and preview your report/project

11
Extra 2 Adding Group Functions on Group Footer
  • Add TQRBand (for group footer)
  • Set BandType to FooterBand
  • Set Name to footerTblCustomer
  • In group header
  • Set FooterBand to footerTblCustomer
  • Add TQRExpr to group footer
  • Set Master to repCustomer
  • Set Expression to COUNT
  • This will count the number of records per group
  • Set ResetAfterPrint to true

12
Extra 3 Adding Summary Band
  • Summary band / section allows you to add group
    functions that applies to all records in the
    dataset.
  • Set repCustomer.HasSummary item to true
  • Add TQRExpr to Summary band
  • Set Master to repCustomer
  • Set Expression to COUNT
  • This will count the number of records for the
    entire dataset

13
Assignment 8 Employee Type Listing
  • Before you start
  • run the Assignment 8 demo in K\Scratch
  • Useful Printable Components
  • TQRSysData
  • Key Property Data
  • TQRShape
  • Key Property Shape, Height
Write a Comment
User Comments (0)
About PowerShow.com