    84  Crystal Reports 

     5.       Crystal Reports 

            
,       .    , 
 ,      -, , 
   . ..      
   .         
    ,     
.      Visual Basic. 
       Visual Basic 5.0    Crystal 
Reports 4.6  Seagate Software.  ,      
       Microsoft Visual 
Basic (^_._  ,  Borland Visual 
dBase  .),        '. " * 
    Crystal Reports  Visual Basic   ,  
           
.mdb     SQL/ODBC,     
    ,       
Visual Basic. 

     Crystal Reports Pro - [Untitled Report II 
    -l.PI.xl 
    1 file   Edit   insert   Format   ?>atabase   Fjepoft   Window   
Help	-Jfl] x| 
    ~I\ 
    Design j Preview | 
    Today 18:45     Close ] 
    ( 
    !.  i . li 
    .   fr.   ,   .   IB   i  .   IU 
    Title 
    Page header 
     ...."     l               >	Au 
    tti:AtUD-A LJ			Insert 1   Done j    ESrowse Field Data...	/ 
    1               d		jd-J':	 in _	5 

    . 5.1.   Crystal Reports. 


    5.1.  Crystal Reports 

    Crystal Reports       
,       .  
    : 


     5.     Crystal Reports 85 

    	 ; 
    	   ; 
    	 SQL  ODBC; 
    	    ; 
    	     . 
           Options   
File.    File Options.     
  ,    (.  ). 

    File Options 
    Layout jNew Report j Database JSQL j Reporting j Fields j For 
    Grid Options: 
    F Snap To Grid 
    F Show Grid in Design Window 
    F Show Grid in Preview Window 
    F Show Ruler in Design Window F Show Ruler in Preview Window F Show Button 
Bar F Show Format Bar       " At  op F Show Status Bar 
    Grid Size: 
    foToe   cm 
    Preview Pages: 
    Start With:  Full Size F Fit Width <"" Fit Page 
    "	Use Short Section Names 
    "	Show Field Names 
    F	Insert Detail Field Titles 
    OB 
    OK 

    . 5.2.  Layout   File Options. 


    5.1.1.     

      Crystal Reports    
-  ,       
,             
Choose Database File   .  : 
    1.   Database    File Options. 
    2.         
 :      Data Directory ( C:\Crw) 
   Browse      Set Directory. 
    3.    ,     Database. 


    86  Crystal Reports 


    5.1.2.    ,     
Choose Database File 

        ,      
  Choose Database File (      
 Database Add Database to Report      
),     .   File Name  
      .  : 
    1.   Database    File Options. 
    2.    Database Selector     
   ,        Choose 
Database File. 
    3.  OK     Database. 

    File Options 
    Layout j New Report   Database |SQL | Reporting [Fields JFor 
    Database: 
    Data Directory: 
    JCAVB \report Database Selector 
    j".mdb;".db;".dbH Index Selector: 
    Browse.. 
    OK.   I 
    P"	Use Indexes For Speed ! Translate DOS Memcis 
    f?	Use Default Alias           f? Auto SmartLirtking 
    ?	Translate DOS Strings 
    "	Case-Insensitive SQL Data 
    Default Dictionary: 
    Browse... 

    . 5..  Database   File Options. 


    :      (*.db; *.dbf; *.ovd  . .)  
   ,       . 


    5.1.3.   ,   
   

        Preview,      
     .  : 
    1.    File Options   Layout (. . 5.2). 


     5.     Crystal Reports 87 

    2.        Preview Pages  
 : Full Size (  ), Fit Width 
(    )  Fit Page (   ). 
    . 
    3.      . 
          Preview     
 . 

    5.1.4.       

    1.    File Options   Font. 
    2.   Font     ;    
       (Default Field 
Fonts),         (Default Text Fonts). 
       ,     
- .    Font. 
    3.   ,    ,   
   ,   .    
  . 
    4.   ,    . 
             
  . 

    File Options                                                               
                                    S3 I 
    ..                                            ...                   
                                                                           
                                                  
    New Report | Database j SQL j Reporting | Fields  Forts j                  
              j 
    Default Section Fonts:                                                     
            LJ^J    > 
    Default Field Fonts:        =- Default Text Fonts:                      i 
 i 
    i     R    I 
    Title...	I      '            Title... 
    Cancel J 
    Page Header ..	:     Page Header... 
    Group Header...	'           Group Header...	Hslp    [ 
    Detail..	Detail... 
    Group Footer .	i     Group Footer... 
    Grand Total...	Grand Total. .    .... ... .. ......  . 
    Page Footer	:     ;     Page Footer... 
    S ummary . .	Sumniafy... 

    . 5.4.  Font   File Options. 


    5.1.5.   SQL/ODBC     

       SQL/ODBC     
         File 
Options  New Report  SQL: 


    88  Crystal Reports 

    1.   New Report    Prefer to create new reports 
from:   SQL Tables. 
    2.   SQL     Server Type  
  . 
    3.           
 Server Type,    SQL   Skip Server Type dialog. 
    4.   ,         
Server Name, Database  User ID . 
    5.      . 

    :     SQL/ODBC   
    Use Report Gallery for new reports,   
    Report Gallery       
 SQL,          
   . 


    File Options	^^^|_XJ 
    New Report (Database   SQL (Reporting I Fields I Fonts I	HE 
    
    I Server Type:   j SQL Server                                             j*j 
    p* jSkip Server Type dialoq	OK    j 
    .__....... ..    ..   . . 
    Server Name: JNelSrvrl            Diet. Path: J	Cancel 
     Database:      jsklad               DjtaPath: f	Help    | 
    ; ! User ID:          j" I r Allow Reporting On:      --M     ^ Iable*   
                        Table name LIKE: 
    ;      F Views                       ; :|- ---  - -       ^   } Ml |~ 
System Tables            I : ,'   !                                       ;   
Owner LIKE:  Synonyms                         .... 
    [,     Stored Procedures      i   '                        [4'-1 " 
Prompt on every table 

    . 5.5.  SQL   File Options. 


    5.1.6.        

    1.    File Options   New Report. 
    2.   Prefer to create new reports from:   Other 
Reports.  . 


     5.     Crystal Reports 89 

         New Report   File    
 New Report       Create New 
Report,      . 

    Create New Report                                                          
                                        ?3 
     	noose an Expert:  -                                                
            Or:      -.-...
    -~				I   rriK		                ,1 ~"(ƻ	_ _-        i 
    I;          = 
    Standard	Listing		Cross-Tab		Mail Label		Another Report  ] Cancel    I     
 'j 
    ~~		it,:		1-1		a 
    . ""." ^:				j_ 3-			Help      | 
    Summary          Graph            Top N noose Report Type and Data 
Type:					Drill Down		1 
    
    
    i 				*=T """"""  <> 
    r"^l =       5 
    Custom           Custom          Custom Report         Cross-Tab       
Mail Label						Data File       SQL/ODBC        I ; 

    . 5.6.   Create New Report   . 


    5.1.7.      

            
 . 
    1.    File Options   Fields. 
    2.   ,      . 
         . 
    3.           
  Fields.      . 
    4.      . 
            
    (. 5.7). 

    5.2.   

             
Crystal Reports  Visual Basic. 
    : 
    1.  Crystal Reports. 


    90   


    File Options 
    Layout I New Report j Database I SQL (Reporting   Fields JFor 
    SB 
    Field Format: String,..	OK    j -J                                         
                       Cancel 1 
    1 Format Number                                                            
                            ?3 
    
    
    I     Number...	Number Default Options 
    ,--..-.- _ ....,._.., ...... _ .._.-.. ...... 
    ' F jUse Window Default Formatj 
    Currency... 
    Date... 
    Boolean... 
    1" Suppress if Duplicated	I**	Currency Symbol:            fp~ 
    j " Suppress if Zero	f~	One Symbol Per Page 
    . " Hr.:fe i';hrt, P:iri';r.:;	 ("*	Fixed            (  Floating 
    i      Alignment:      j Default	_?]	Position: 
    F^    3 
    Decimals: J1.0Q	_^j Decimal Separator: } Rounding: jrloijrj 17 Thousands 
Separator: j Negatives: 
    .123        _*j      ^ Leading Ze 
    Sample: 
    [~      OK 
    -5 555 555.56. 
    Cancel 
    Help 

    . 5.7.  Fields   File Options    
 . 

    2.   New Report   .   
Create New Report     (. . 5.6.). 
         ( Crystal Reports   
)      . : 
      Another Report,       
   . : 
      Custom    .   
  . 

    5.2.1.    

      Choose Report Type and Data Type    
 : 
        Custom Report      
/     ; 


     5.     Crystal Reports 91 

       Custom Cross-Tab       
 ,         
.         
       ; 
        Custom Mail Label      
  . 

    5.2.2.    

           ,   
   : 
      Data File        . 
   Choose Database File,      
     ; 
       SQL/ODBC,       
      Crystal Reports ( 
  , ^  ).    Log 
On Server,      ,    
        SQL. 

    Crystal Reports User Survey 
    Job: Function: 
    JlJ     No. of Employees:   1101 -500    JJ No. of PC's: 
    d 
    11-50 
    zJ 
    If applicable, what is your company role in the software industry? 
    <" Reseller     Distributor    f* VAR.A/AD/System Integrator     ^ N/A 
    What databases do you intend to (or would like to) access with Crystal Reports? 
    1 Access  DB2->   |  Ingres " R:Base * Base --> I 
     ASCII               AS400            	Btrieve 
    23    Excel              	Gupta 
     Lotus 1-2-3      Scalable SQL I?	Oracle 
    ? SQL Servei     " Superbase      "	Sybase 
    21               "	other-> f 
     Informix  Paradox  WatcomSQL 
    ~3 
    What programming environment(s) do you use or intend to use? 
     C/C++  Pascal 
    ~ dBASEAtfndows 
    f* Visual Basic    P* other --> 
     Delphi	 Paradox 
    ~3 
    OK 

    . 5.8.     Crystal Reports.  
      . 


    5.2.3.     

           ,    
(        ).  
   


    92   

             
 . ,   ,     
 . 
           Visual Linking 
Expert ( 2  Create Report Expert),      
    . 

    Create Report Expert 
    Step 1: Tables  -2:Links J3: Fields 14: Sort | 5: Total j 6: Select | 7: 
Style J 
    Order Details     \			Orders          |			Customers      J	A 
    &OrderlD &ProductlD UnitPrice Quantity Discount	i  -	 >	HOrderlD        
  jv  Customer! D &EmployeelD DOrderDate RequiredDate	^		DCustornerlD    
_^_ HCompanyNarne ContactN arne ContactTitle Address 
    ShippedDate ShipVia           Freight ShipName ShipAddress    T 
j	i-		DCity DRegion DPostalCode Country Phone           j*J 
    Employees      J	 
    Tables... 
    Arrange 
    Smart Linking 
    Back       Next 
    Cancel 

    . 5.9.   Visual Linking Expert. 


      : 
    1.    ,       . 
    2.        .   , 
  ,     .	^ 
    3.   ,       
 Options.    Link Options,     
  
     .?    Smart Linking.  
Smart Linking        . 
   ,    . 

    5.2.4.  Design 

      Design   ,    
     Title, Page Header, Details, Page Footer 
 Summary.            
   . 


     5.     Crystal Reports 93 


    ? Crystal Reports Pro - [c:\vb\report\1.rptj 
    File   Edit   insert   Format   Database   Report   Window 
    :^!   ظ	i| f\ e'C&ljgJ "l<8j|H 
    Design   Preview 
    ;. . . li. . . 12, , , u, , ,  . 
    : . _ :il .... ___ . .__.  ..._ _ .  . 
    Title	  
    Page header	  
    Details                     1	 
    Page footer	  
    Summary	  

    . 5.10.  . 


            : 
    	 Title ( )      ; 
    	 Page Header ( )     ; 
    	 Details ( )      ; 
    	 Page Footer (  )    
 ; 
    	 Summary ( )  ^ . 

    5.2.5.       

      Insert Database Field (. . 5.1)     
  .       Insert | 
Database Field.           
,     .     
    ,      Done. 
      : 
      (),      .  
 : 
         ,   Insert      ; 
              ; 
        <+>     
   <{1+6>~       
   .


    94_____________ ____	  


    :         
   ,        Insert Database Field. 

    Crystal Reports      . 
      :  (XXX...),  (555 ...), 
 ($555 ...)',  (12/31/99)   (Boolean) (T/F).  
     ,      . 
   ,   Options   File   
 Show Field Names   Layout   File Options (. . 
5.2).          . 
    Crystal Reports        
 Page Header    .   
 ,   Insert Detail Field Titles   Layout 
  File Options. 

    5.2.6. ,  ,     

    1.  ,  , ,  
  ,         
       .    
       . 

    :        
 <5+>    Edit   Select Fields.  
Select Fields    ,    
    " . 

    2.     ,   Crystal Reports,   
   . 
             . 
             ,  
    . 
       (,  , ,   
. .)          Change Format  
 .        
 Format,      . 
      ,         
    Change Border and Colors    (. 
5.11).    Change Border and Colors,    
  . 
                
   Change Font.      
 Font. 
           <Delete>. 

    :           
      . 

    :         
        Crystal Reports. 


    5.2.7.    

        .    
, ,       , 
     . 


     5.     Crystal Reports 95 

    pCategoryName 
    Name: Categories. CategoryNarne 
    Change Fort... Change Format... 
    Change Border and Colors.. 
    Change Line Height... 
    Browse Field Data... Select Records Expert... 
    Insert Grand Total... Insert Summary. 
    Send Behind Others Delete Field 
    Cancel Menu 
    J :..J I MUJISIiSu.;' 

    . 5.11.      . 

        Crystal Reports    
  : ,     ,  
  (Ascending ( ),    
 ,  1  9,  False,  True;  Descending ( )). 
           .    
     "  " 
  Windows. 
    ,    ,     
  ,    ,   , 
    ,     
, ,      .   Currency 
    .     
 .   Date    . 
    Crystal Reports        
.      Crystal Reports   
,       ,    
      .      
       , Crystal Reports 
  (  ) ,      
. ,      (  ) 
", "    ,  " , ",   
"Johnson, Nick". 
       : 
    1.   Sort Records   .   
 Record Sort Order.   "" 
    2.   Report Fields   () . 
    3.   Add.        Sort Fields. 
    4.   Ascending  Descending,   
.    . 


    96   

    Record Sort Order 
    Report Fields: 
    Sort Fields: 
    Cateaaries.CateaoruNarne                 ^^^^^^	A -Categories. Category! 
D                I 
    ;i  Add->   j|:i 
    <- Remove I 
    <i              i               H	<l              I               H 
    OK 
    Cancel 
    Help 
    Sort Direction: (*  Ascending " Descending 

    . 5.12.   Record Sort Order. 


    5.2.8.    

    Crystal Reports     .    
,      . ,   
   6>   ,    .  
    - ,   , 
  ,    . 
    Crystal Reports      .  
        . 
       ,      
       .  
      ,        
   .   , ,   
     , Crystal Reports   
,     ,    
   . 
            . Crystal 
Reports ,  ,      , 
    ,     
 ,         . 
              ,  
   ,     .  
 , , ,  ,  ,  
   . . 
      : 
    1.          ,  
   . 
    2.   Insert   Group Section.    
Insert Group Section. 
    3.    Insert Group Section     
    . 


     5.     Crystal Reports	97 

          , Crystal Reports  
    . 

       

             
  . ,       
     , Crystal Reports  
            
    . 
    , ,    ,   
,      : 
          ,     
. -      ,   
  ,     ; 
         ,     , 
      .. 
. ,  ^^   , ^^^^^ 
  ,  ,      
,   ,       
 . 
        Crystal Reports   
  .   
       , 
     . i 
...       
,,,	"~:  " " "* 
     ^  ,     
        in 
specified order (. 5.13).    Defirj^JvlajT^ejdJ^irj^^	 

    5.2.9.      

     Crystal Reports  ,        
      .   
 . ,    ,  : 
      ,     ; 
      ,      ; 
     ,      Ha4?Tbjjg^yjorpj/Tiny; 
     ]5 . 
        (   ;  
   ): 
    1.         Insert Subtotal  
 .    Insert Subtotal. 
    2.  ,       
     . 
    3.   : Ascending ()  
Descending (). 
    4. Crystal Reports    Group Header  Group Footer  
  |^^   Group Footer. 

    4 .   136 


    98   

    Insert Subtotal 
    Insert a subtotal foe the field 
    When the report  printed, the records wil be sorted end grouped by: 
    Order 1$. 
    jasg'SfKiltlfel:-'? ''\ 
    ':   | CategorylD 
    The subtotal wi be      Group Name: |UserGroup1 printed on any  
    d 
    I in specified order:	d 
    | in ascending order.                                    I {in descending 
order.                                  | 
    New Named Group...	[in original order.	1 
    ill. 
    Edk Named Group... 
    
    ^^^^^^1 D ehne Named liroup			LUKE] 
    OK. 
        Catogorie^CategorylD   Categories. Categor^D |<New> | J      jis     
 jj   any v*juft__jjj*l 
    any value equal to one of less than later than 
    Cancel I	Help    | 
    Browse Data... 

    . 5.13.  InMrt Subtotal  Define Named Group    
 () . 

       : 
    1.        (  ,  
  . .)          
Insert Grand Total   .    Insert Grand Total. 
    2.        . 
    3. Crystal Reports   Grand Total,     
  (. 5.14). 
      : 
    1.    ( , , ,  
, , ,   . .)     
        Insert Summary.  
  Insert Summary. 
    2.  ,        . 
    3.   : Ascending ()  
Descending (). 
    4. Crystal Reports   Group Header  Group Footer  
     Group Footer. 


     5.     Crystal Reports	99 

    *; , . . , .^;.,':,^mzmimm^'., "ks'. ,'. P. , 
    
    
    _.. . j-nruiraBuiruri'Me'ra" '   ' ~~"~ 
    Page header	            - 
    ttl: Quantity -A 
    Details	       .                            Quantity 
    ttl: Quantity -A	n of Quantity: 
    Grand total	n of Quantify 
    Page footer LiJ	 ^       i    f 
    JArial Cyr                   *\	10                I] U     A  A"         
                       : 
    Gfoup footer 1: Order Details.Quantity - A 

    . 5.14.   Group Header, Group Footer  Grand Total  
      (.  ). 


    5.2.10.   

         Crystal Reports,  ,  
      .   (   
) , ,       ,  
    . ,    
 '^-       
    ^'   . 
 Crystal Reports    .      
   Crystal Reports      
,     .   
,,   ,      
 . ,> 
      ,     , 
   Select Records Expert.      
,      ,      
  .       
       ,  
    -~! 
       Select Records Expert     : ; 
      Bbi6pj3TbjTane      Select Records , 
     Report | Select Records Expert. 
    Select Records Expert,    
   ; 
         ,   Select Rejojjls   
     Report | Select Records Expert. 
   Choose Field.  ,    
     .    Select Records Expert 


    100   

    ,    : 
    1.   ,     
 . 
    2.          , 
  New        Choose Field. 
    3.    ,    . Crystal Reports 
       . 

    ; Select Records Expert 
    Products.UnitPrice: |<New> I 
    ps       3 I greater Than | [$90 I? or equal to 
    d 
    OK	Cancel              JHelp         Speed Tip...          Biowse...       
  Hide Formula < 
    Formula Editor... 
    {-*~ Record Selection   <""" Group Selection 
    {Products.UnitPrice};-=$90 
    LJ 

    . 5.15.   Select Records Expert. 

      Formula Editor,   Edit Formula    
     .    
 .   "  ". 

     N 

              
     :     
   ;  "" ,   
 ;     . .       
 , Crystal Reports  ,  ' . 
       N ( Bottom N)    Top 
N/Sort Group Expert   Report.   Top N/Sort Group Expert  
      ,    
(N)  . 
        N   ,    , 
  , _1     ,   
    N  Bottom ~1" 
    ,      ,  
   .         
 include Others, with the name (. . 5.16). 


     5.     Crystal Reports     101 

    Top N/Sort Group Expert 
    Analyse report results by taking the Top N or Sort of totals. Products. U 
nitPrice I 
     
    JTopN	J[J   of:   JSum of Products.UnitPrice 
    p where N is:     10 
    P" ijrducje Others, with the name:! jOthers 
    Cancel 
    Help 

    . 5.16.   Top N/Sort Group Expert. 


    5.2.11.  / 

    Crystal Reports     ,    
.         
    . ,    
  ,    ,   ,   
 ^_> . ,     , 
         
 ,    ,     
 . 
         Crystal Reports   
  Graph/Chart Expert.    
    . 
        Graph/Chart Expert,    Insert 
Chart        Insert | Graph/Chart Expert. 
         -,    
     (. 5.17): 
       .        .  
         ; 
       Data.     :    
,    (  ,    
)      ?71^	  
  ;     ,    
 ; 
        Text.        
  , ,  . Crystal Reports  
     .   
 ; 
       Options.     ,  
         . 


    102   

    Giaph / Chdit f xpe 
    HiO; Jypi 12 Dale J3:  J4: Options 
    k 
    fell 
    Side By Side       30 Side      Stacked Bar    3D Stacked 
    IH"! 
    kill 
    |^1^ 
    Percent Bar    3D Percent        Line 
    Area 
    * * *, 
    3D Bars	Re         Multiple Pie   Weighted Re 
    ....pejgdj1'         |	firaph Done~| 

    . 5.17.   Crystal Reports. 
    
    
    a. , . a. , . n. i . is. i . . i . fr. i . . i . i 
    Title 
    Page header 
              
    1995   
    1996 
    1997 

    . 5.18.3-      ( Design). 


     5.     Crystal Reports	103 


    5.2.12.  OLE

    Crystal Reports  - OLE,     
 OLE-.  :
    1.   Object   Insert.    
Insert Object. 
    2.   ,   Create from file   
 ,    ,   Create New   
 . _?  (, Paint  
 " BMP), "  "!~ ~" 
    3.    ,      
   ,      (!  
,    ). 
    4.  ,     Crystal Reports  
   .	 

    5.2.13.   	

    1.         Insert Text Field 
       Insert j Text Field. 
   Edit Text Field. 
    2.           Accept. 
    3.          Title . 

    5.2.14.    

    1.      (Preview)    
,   Preview Report       
 Preview.   Preview   . 
    2.         Preview,   
         Design.  
    .	... . .-., - t vf  

    5.3.    

               ,  
      . ,    
,       . 
    , ,     ,     
 .    ,  , . 
           ,  
          
,         . ., : 
    1.   Insert Formula field      
  Insert | Formula field.    Insert Formula. 
    2.       .   Edit Formula,  
  ,    . 

    :   Edit Formula   ,   
Formula Editor    Select Records Expert    
    (. . 5.15).      
 . 


    104   / 

    3.  ,      Formula text,    
  .     
     Function  Operator ,   Help. 

    :     , ,   
 ,      Formula text.  
    Crystal Reports      
,      ,   
  .        
   .   fy    
  ,    "" 

    :      Browse_?ield Data ( 
 )      . 

    4.     , Accept. Crystal Reports 
   ,   ,   Edit Formula. 
      ,    ,  
        , Crystal Reports 
  Eire  ,  . 
    5.        . 

    ! Edit Formula:	@1			H^^^Vx] 
    Fields: -		Functions:	Operators: 
    |   ReportsTo                       *ji --Order Details--                  
!		Arithmetic:                                  *j j R emainder (rum, denom)   
   ZZJ I	Arithmetic: x +y	Add       ?] 
    OrderlD		i   Abs(x)	x-y	Subtract 
    ProductID	_lj	!    Round (x)	x"y	Multiply 
    I   UnitPrice		;    Round (x, ttplaces)	x J 	Divide 
    >!^^^|	HH^H   V1<	1    Truncate (x)	x%y	Per cent 
    Discount ^	^    ..__         _   ,	Sum (fid)                            
    ,- JiimJfM   !                         _U 1                         
      >|	X <l     1	Negate        i > I 
    Formula text: 
    {Products.LInitPrice} " {Order Details.Quantity)! 
    LJ 
    U 
    Accept   :	Check	Select	irowse Field Data... I	Cancel 
    Help 

    . 5.19.   Edit Formula. 

      Edit Formula: 
        Fields   ,     
 : 
         Functions    Crystal Reports.  
   ,  .   
 -          
 : 
      Operators   (" "),   
      . 
    ^_ ^^^^1___: 
        : 

    {Orders.UnitPrice}*.85   //             15%. 


     5.     Crystal Reports	105 

       : 
    //   Uppercase      CustomerName  
    //     . 
    Uppercase    ({customer.CustomerName}) 
         : 
    (customer.CustomerName} [1] //             : 
    Month({orders.OrderDate})   // ,         

          .   
 Crystal Reports       . 

    5.3.1.     

      ,     ,     
\/_. Crystal Reports       
  ,   ,      
  . 
    , : 

    1*(2+4*6/3-7*12-8) +2*(2+4*6/3-7*12-8) +3*(2+4*6/3-7*12-8) 
+4*(2+4*6/3-7*12-8)= -820 

      (2+4*6/3-7*12-8),   . 
          (@F = (2+4*6/3-7*12-8))  
         
    : 

    1*{@F}+2*{@F}+3*{@F}+4*{@F}   =   -820 

     ,  Crystal Reports   @F,   
 @F    -82  ,    
(2+4*6/3-7*12-8),    . 
     B^gj^^Jqj^njj+joj3jyi^	1:   Fields   
  . 

    :       . 


    5.3.2.    

        ,      
(  ,     . ).  
       .    
    ,   .	""' 
    Bcj^Bj/nbjtiaHeHidfiL   >.    Fields, 
      Formula text. 
    : -       
     Fields. 

    5.3.3.   

       ,     
    . 


    106	'                                              

             ,   
     Edit Formula.    
   ,   ,    . 
     '    Formula text.  
     ,         
 . 

    :        
(//).         Operators. 

    ,     : 

    //              . 
    //     ,          . 
    //                      . 
    //  - Crys'fral';</'Re'pbr'E'fe''!d6pa6oTaeT     ,   
   
    //  , ' '1':'''''    . 
    If   {Orders.OrderAmount} in  (100.00   to  250.00) Then .10 * {orders.OrderAmount} Else	.     ..  -. >        -:- 
    0.	-,v .,,
    //  -    . If {Orders.OrderAmount} > 10.00 Then 
    "" //   -  . 
    Else	?:.,..lO-'.p ''-. -;'' 
    "  " 

    5.3.4.   

    Crystal Reports ,"      
   ,   . 
    ,    ,      
.        
  . 
       (, ,    . .) 
      . 
     ^   
         , 
  . 
           : 

     
    : ""  ''	.      >,         (  
'' -" ") 
               
 .           
 . 

    
    : 23134.567 
    ,   ,       
 ,    ."  


     5.     Crystal Rupert  107 

      

    : {.} 

               
 {}   , ,      
.    . : 

    (Customer.Region} 

      Region   Customer. 

     

    : 1+1 
               
.        ,    
 (  1 + 1). 

     

    : _() 
              
   . ,  Sum(x)    
   . : 

    Average({Order.Amount}) 

             Amount. 


       

        Crystal Reports     
.          
   : 
    {}          : 
    {Customer.Region}, {@sum} 
    [ ]         : 
    {Customer.CustomerName}    [1]	. ()      
 : 

    Round(x),   Abs() 


    :        
   . 


    5.3.5.     

      ,     ,  
 ,   Crystal Reports    
.     . 
           
: ,  ,    ,   
  . : 

    5+10*3 = 35 

       10*3,  30   5. 


    108	   

    ,    5   10      
3,        . 
    : 

    (5+ 10)*3 = 45 

    ,       ,   
, ,   .    . 

    :     , : @Summa * 107.5%, 
    , @Summa,   
 ,       . 

    5.3.6.     

            Crystal Reports  
 ,    ,     
   ,     .     
   . 
       ^^!^,?^^]^^__ 
_ ,    ,    
  . 
         : 
    1.     . 
    2.   <Delete>  <Del>   . 

    :          
   .     
  Insert Formula     ,  
     . 

       : 
    1.  ,       Insert Formula 
  ".    Insert Formula. 
    2.   ,      
Formula Name. Crystal Reports   Delete. 
    3.   Delete; Crystal Reports   . 
    :   \,    
 .

    :        ,  
        . 


    5.3.7.      

    Windows          
.      ,  .   
,     Edit Formula,   , 
  ,      Edit 
Formula       . 
         : 
    1.    Edit Formula     ( 
Help,   F1  . .)   Crystal Reports. 
    2.    Search (),   ,   
  .  . 


     5.     Crystal Reports	109 

    3.      ,   . 
    4.        Edit | Copy. Windows 
      . 
    5.   Edit Formula        
Ctrl-V,       . 
    6.  . 

    5.3.8.  

         ,   
    .   
 Crystal Reports      ;  
      .  
,     .  Crystal Reports 
    .      Functions  
 Edit Formula,     : , 
,  ,   . 

    5.3.9.  

         ,     
,      .    
. Crystal Reports       
 . 
        Operators   Edit Formula,   
  : , , , 
, , , ,   . 

    5.3.10.  

        ,    
 .    ,  
  ,     . 
     Crystal_ReE2Et5    ^/  : 
NumberVar (), CurrencyVar (), StringVar ()1 
(), DateVar (). 

      

         , __,.,.  
   .  : 

    NumberVar x; CurrencyVar ; StringVar x; BooleanVar x; DateVar ; 

    : 
      Amount,       
  : 

    NumberVar Amount^ 


    110	               Crystal 

      YeslSlo,     FALSE  TRUE: 

    BooleanVar  YesNo;"    

    ,  Last^arne,     : 

    //  1 -^1.<'&'1'<: '    
StringVar'"LastName' ':*= '""; - ' 

    5.4.   Crystal 

        ^  , Crystal 
Report   ,   ,1   
 Visual Basic. ,~ Visual Basic 5.0,  
        ,  
      . 
     Crystal Report Effglne    , 
         
,    Crystal Reports; f- ^ .>;,"  
      Report Engine   Visual Basic   
 ^  Crystal.       
Crystal,   <>~ '' Report )'.! 
,   ,     -  
 ,        
-/ .       
   '   , , 
    ,     
 . 
    Report Engine        
Crystal   ^^^'^ Visual Basic.    
  ,    ,   
   . 

    5.4.1.      Crystal 

       '  Crystal,  , 
 Report Engine   .   Report Engine  
   .      Crystal Reports. 
        Visual Basic,   
Crystal Report Engine,   : 
        ,     .  
,         
 ;    .    
  ,     ,    
   ; 
      '   Visual Basic,   
   Repdrt Engine; 
           Crystal. 

    5.4.2.    

    ,     ,   
    .    
 


     5.     Crystal Report	111 

  Crystal,   .  Crystal Reports  
         
   . 
      Report Engine    ,  
  ,  ,     
   ,      
,     .     
,       .   
       : 
       ; 
      ,   ; 
       ,       
 ; 
                  
 . 

    5.4.3.    Crystal   

      ActiveX   ,  
-! *       
        
 . Crystal Reports   ActiveX   
 Crystal. 
      Crystal ( Crystl32.ocx)    
\Windows\System   Visual Basic 5.0. ^]  
 Crystal   Visual Basic ,   Components 
 Project.   Components (. . 1.3)   Controls   
 Crystal Report Control 4.6. 
       Visual Basic    
Crystal   .

    Piojecll     Fuiml (Form) 
    || 
    d! 
    Copj*te>1997 Seagate Software Information Management Group. Inc. 
    800-877-2340 (US.1 800-663-1244 (C*wda) 
    601-3435 $afc$@fng.seagate?oftwaie.com 
    Current version information available on our home page 
    http://www.img seagatesoRware. com 
    or GO REPORTS on CompuServe 

    . 5.20.   Crystal  . 

    5.4.4.    Crystal 

        Crystal   (   
  )       Crystal 
Reports.        
      .   
  : 
       ,         ; 
          ( Preview,  ,   
 );	. 


    112   Crystal 

    	 ,    (   
 ): 
    	   (     ); 
    	     Preview (   
  
     ); 	    ( 
    );   , | 
    	 ;                                                   
    	  . 
       Crystal     
_.,    .  , ,  
 ,1,_   .     
     . 

         

          Crystal   
    ,      Property Pages. 
    1.    Crystal,   ,  
 . 
    2.   Crystal Properties   .  
  Property Pages. 
    3.         ,  
   ActiveX. 

    Database         j         Selection General       j      prjnt Window 
    ReportFileName: fCAV'E \reportVI rpt 
    :  Destination 
    |     Window	( [foPrinlel 
    <" To MAPI 
    Print to File 
    Q 
      File 
    OK			 

    . 5.21.   Property Pages    Crystal. 


         

        Crystal     
,       .  
    ,     . 
     Action   PrintReport     
  '       . 


     5.     Crystal Reports	113 

             
     .     
      Visual Basic. 

    5.5.    Crystal 


    Action 

    ,   .    Visual Basic  
 : [. jCrystalReport.Action = 1 : 
    CrystalReportl.Action  =   1   '            
   
    '           . 
     :  . 

    BoundReportFooter 

      True  False ,     
 Page Footer  Default Bound Report ( 1^). 
       Visual Basic   : 
[qbopMa.]CrystalReport1 .BoundReportFooter = True : 
    CrystalReportl.BoundReportFooter  =  True  : 
, . 

    BoundReportHeading 

     String,      
.    Visual Basic   : 
[qbop/wa.]CrystalReport1 .BoundReportHeading = "" : 
    '               
CrystalReportl.BoundReportHeading  =   "    " 
     : , . 

    Connect 

       SQL. 
       Visual Basic   : 

    [. ]CrystalReport.Connect[= _ 
"_;_; _ ; _"] 

    : 

    CrystalReportl.Connect = "DSN = Accounting;UID = 734;PWD = _ bbbl;DSQ = Administration" 


    114	   Crystal 

            Administration  
 Accounting     734   . 
          : DSN = _; = 
_', _ PWD = ;050 = _ 

    :       ,    
 SQL    ,    ODBC. 

     : , . 

    CopiesToPrinter	W^b    >. $.     -*,*, 

      ,   ,   
    ( ,    
Destination, 1  Printer). 
       Visual Basic   : 
[0opMa.]CrystalReport.CopiesToPrinter[= _ ] : 

    CrystalReportl.CopiesToPrinter = 3 '    
    '  . 

     _       . 
 : , . 

    DataFiles 

          ,   
.    Visual Basic   : 
[qbopMa.]CrystalReport.DataFiles(i/HdeKC_/waccuea)[= ] 
                , 
    . 
           ,   
  . 
             .  
 Crystal Reports         Set 
Location ( Set Location   Database). 
         _ (0),    (1)  . . 
    ,          
(1 .dbf  S.dbf)   c:\new,    : 

    CrystalReportl.DataFiles(0)   =   "c:\new\l.dbf" 
CrystalReportl.DataFiles(2)   =   "c:\new\3.dbf" 

    DataFiles  -,      . 
       ,      
  ,      . 
             
  .       
      . 


     5.     Crystal Reports 115 

     DataFiles     _.  
    ,      
  ,     . 
     :  . 

    DataSource 

    ,    Data     
     Crystal. 
    :    . 

    Destination 

        (Window, Printer  File).   
 Visual Basic   : [c)bopMa.]CrystalReport.Destination[= 
] : 

    CrystalReportl.Destination   =   0     : 

              . 

    		 

    0	Window (    )	crptToWindow 
    1	Printer (   )	crptToPrinter 
    2	File (         
      .     
 Destination,     PrintFileName  PrintFileType).	crptToFile 
    3	EMail  MAPI (      MAPI 
Email (Microsoft Mail).     EMail  , 
  PrintFileType).	crptMapi 

     : , . 

    DetailCopies 

        ,     
  Details .	~~          " 
       Visual Basic   : 
[0opMa.]CrystalReport.DetailCopies[= _ ] : 
    CrystalReportl.DetailCopies  =  3   '   ,         
 '        '      (3)        
      DetailCopies  ,    , 
        1    
    : , . 


    116    Crystal 


    DiscardSavedData 

      i   ,   
   (TrueforiepraeT .	'       '""                               
                          i 
       Visual Basic   : 

[0op/wa.]CrystalReport.DiscardSavedData[= TrueFalse] : 
    CrystalReportl.DiscardSavedData = 1 '  ,  
    '   . 

      TrueFalse  : False = 0, True = 1. 
: , . 

    EMailCCList 

      "",      
 . 
       Visual Basic   : 
[qbopMa.JCrystalReport.EMailCCList [= _] : 

    '       E-mail      . 
CrystalReportl.EMailCCList   =   ";" 

      MAPI. 
         . 
    : , . 

    EMailMessage 

     ,     . 
   Visual Basic   : 
[qbopMa.]CrystalReport.EMailMessage[=coo6u4ewe] : 

    CrystalReportl.EMailMessage   =   "      18:00     " 

      MAPI. 
    : , . 

    EMailSubject 

       ()   . 
   Visual Basic   : 
[0opMa.]CrystalReport.EMailSubject[= ] : 

    CrystalReportl.EMailSubject = "   " 

      MAPI. 
    : , . 


     5.     Crystal Reports	117 


    EMailToList 
       "",     
  . 
       Visual Basic   : 
[qbopMa.]CrystalReport.EMailToList [=_] : 

    CrystalReportl.EMailToList   =   ""   '         ""   -   
   

      MAPI. 
       ^^^__^. 
    : , . 

    Formulas 

          .  
  Visual Basic   : 
[0op/wa.]CrystalReport.Formulas(t/H(3eK'c_Maccuea)[= "_= _"] 
              ,  
     . 
    ,    COMMISSION  {file.SALES} M,   
 TOTAL   {file.SALES} + {file.COMMISSION},   : 

    CrystalReportl.Formulas(0) = "COMMISSION {file.SALES} * .1" 
CrystalReportl.Formulas(1) = "TOTAL= {file.SALES} + {file.COMMISSION}" 

     : 
      Formulas  -,      ; 
       ,   ,    
  ; 
              (0), 
    (1)  . .; 
            Crystal Reports; 
             
.       , 
   . 

    : ,  ^ , ^--..     
        
 . 

    :  @         . 

    :     
[^/^^^^.    
6~'  .	~" 
     :  . 

    GraphData 

       ,    
.    Visual Basic   : 
    [.]1!1.1((/<-_)[:::<_; _ 
_; ; ; ; ] 


    118    Crystal 

    	 

    _	 ,      
(.     _). 
    _	   ,   
.       ,   v  
 . 
    	   ,      , 
 GROUP1, GROUP2, GROUPS, . . ., GROUP9 
    	   ,      
,  GROUP1, GROUP2, GROUPS, . . ., GROUP9. 
    	 ,  ,     
     (,   .).  
 ,   ,   0,   1  . . 
    	,      : 
,        .     :   ROWS,   COLS, ROWANDCOL 
 COLANDROW. 
           _: 

    	 		  

     	ALL	Group Footer 1	GF1 
     	TITLE	Group Footer 2	GF2 
    Page Header	HEADER	Group Footer 3	GF3 
    Group Header 1	GH1	Group Footer 4	GF4 
    Group Header 2	GH2	Group Footer 5	GF5 
    Group Header 3	GH3	Group Footer 6	GF6 
    Group Header 4	GH4	Group Footer 7	GF7 
    Group Header 5	GH5	Group Footer 8	GF8 
    Group Header 6	GH6	Group Footer 9	GF9 
    Group Header 7	GH7	Grand Total	GRNDTTL 
    Group Header 8	GH8	Page Footer	FOOTER 
    Group Header 9	GH9	 	SUMMARY 


     	DETAIL 
    : 

    CrystalReportl.GraphData(0)= "DETAIL; 1; GROUP1; GROUP2; 0;COLANDROW" 

       GraphData      
     .      
 "Action=1".   GraphData    
 .  , : 

    CrystalReportl.GraphData (0) = "DETAIL; 3; Groupl; Group2;666; COLANDROW" 

       ,   

    CrystalReportl.GraphData(0)   =   "HEADER;   3;   Groupl;   Group2;666; COLANDROW" 


     5.-    Crystal Reports 119 


    CrystalReportl.GraphData(1)   =   "DETAIL;   3;   Groupl;   Group2;666;   
_ COLANDROW" 
          .  : 
 . 

    GraphOptions 

           . 
   Visual Basic   : 
    [0opMa.]CrystalReport.GraphOptions(wHde/fc_Maccivea)[= _; _ 
_; ; _; __; _ _;;;] 

    	 

    _	  ,     . 
    _	,      . 
      ,     . 
    	   (  ,  Arial), 
     . 
    _	  ( )  
 .  :  = , V = , 
X =  . 
    _	,       
   .  :  = , F = , X = . .^. 
    _	,      . 
 :  = , F = , X =  . 
    	,     .  
:  = , F = , X =  . 
    max	  ,     . 
    min	  ,     . 
    : 

    CrystalReportl.GraphOptions(0) ="FOOTER;0;Arial;H;T;F;X;max;min" 

    (  Page Footer       
  Arial,    , 
      (_ = )  
  .) 
       GraphOptions      
     .    
    "Action=1".  _  
GraphOptions     . 
     :  . 


     120	   Crystal 


    GraphText 

           
 . 
       Visual Basic   : 

    [0opMa.]CrystalReport.GraphText(uH6e/<pc_Maccuea)[= _; __ 
_;; ; _; ; ; ; ; z] 

    , : 

    CrystalReportl.GraphText(0)   =   "HEADER;   0;;;;;;__;   _ 
___;   ^^   " 

        ,   z      Page Header. 
       GraphText      
     .    
    "Action=1".  _  
GraphOpfiohs   -^' .  
, : 
    CrystalReportl.GraphText (0) = "DETAIL; 1;  ; _  
;  ;  ; _  ;  ; 
 ;  z" 
         ,  : 
    CrystalReportl.GraphText (0) = "DETAIL; 1;  ; _ 
     ;  ;  ;  ; 
     ;  ;  z" 
    CrystalReportl.GraphText (1) = "DETAIL; 1;  ; _ 
     ;  ;  ; _ 
     ;  ;  ;  z" 
      ,    .  
:  . 

    GraphType 

        ,     
 . 
       Visual Basic   : 
    [.]1!.(_)[=_;_ 
_;_]      ' ~
    : 
    CrystalReportl.GraphType(0)=   "GHl;   0;   PIE" 
       (graphNum = 0)   Group Header 1  . 
       GraphType      
     .    
    "Action=1".  _  
GraphOptions     .  
, : 

    CrystalReportl.GraphType(0)    =   "DETAIL;    0;   PIE"   
   ,  : 
    CrystalReportl.GraphType(0)    =   "HEADER;    0;   PIE" 


     5.     Crystal Reports 121 

    CrystalReportl.GraphType(1) = "DETAIL; 0; PIE"   
    .       ,  
   . 
              
 : 
     	 

     	SIDEBYSIDE 
    3-D 	3DSIDE 
      	STACKEDBAR 
    3-D  	3DSTACKED 
      	PERCENTBAR 
    3-D  	3DPERCENT 
    	LINE 
      	AREA 
    3-D 	3DBARS 
    	PIE 
     	MULTIPLEPIE 
     	WEIGHTEDPIE 
     :  . 
    GroupCondition 

    ,         
.    Visual Basic   : 

    [$opMa.]CrystalReport.GroupCondition(uH<3eKC)[= ; ; ; _ _] 

    , : 

    CrystalReportl.GroupCondition(0)="GROUP1;{Header.Ordernum};ANYCHANGE;A" 

    ,      Ordernum  Groupl   . 

     : 

    	 

    	,      . 
     GROUP1 ,    GROUP2  . . 
    	 ,       
.       : (. ] 
    	,    (.  ). 
    _  	,     :  
= , D = . 


    122    Crystal 

           : 

    	  

      Date 

                        /	DAILY 
    	WEEKLY 
       	SEMIMONTHLY 
    	MONTHLY 
    	QUARTERLY 
      	SEMIANNUALLY 
    	ANNUALLY 

      Boolean 

        Yes	TOYES 
        No	TONO 
      Yes	EVERYYES 
      No	EVERYNO 
      Yes	NEXTISYES 
      No	NEXTISNO 
         
     	ANYCHANGE 

     :  . 

    GmupSelectionFormula 

     ,      . 
   Visual Basic   : 
[qbopMa.]CrystalReport.GroupSelectionFormula[= "__"] 

          ,     Edit 
Formula. ,        
   {Header.Amount},  10000 (   
   {Header.CustNum}),       
  : 

    CrystalReportl.GroupSelectionFormula  =  Sum   (   {Header.Amount},   _ 
{Header.CustNum}}   <   10000 

          ,    
           
  . 

    :           
 ,   ,      
       "AND".  , 
        . 

     : , . 

    GrgupSortFields 

      () ,   ,  
    . 

     5.     Crystal Reports	123 

       Visual Basic   : 
[0opMa.]CrystalReport.GroupSortFields(iyHde/<c_Maccuea)[= "{+|-}"] 

    , ,         Crystal 
Reports 	I  __,,)?_.  
    *    ,  
rpyflny     . . ( QJ  ],   
  : 

    CrystalReportl.GroupSortFields(0)   =   "-Count({Customer.Customer},   _ 
{Customer. Sity})"	*"       "~ 

     : 
     GroupSortFields  -,     ; 
             
   ; 
            ,    
 . ,  ,     
    ,     , ,    
  ; 
             
^- 0,    1  . .      ; 
              
  ,   

    CrystalReportl.GroupSortFields (O) =.... 

        ,      
,    ,      ; 
       GroupSortFields  ,   
 ,    ; 
            ,  
  :
   
   CrystalReportl.GroupSortFields    

      ,    ,   
 .       
 -,     . 
    :        
  (+  -)  . 
    :         , 
 Crystal Reports  Visual Basic,    Insert 
Formula field,       Insert Formula,   
,    Fields   Formula Edit    , 
 . 
    Crystal Reports       Formula text.   
           
 . 

     :  . 

    LastErrorNumber 

       ,     . 
   Visual Basic   : [qbopMa.JCrystalReport. LastErrorNumber 


    124	   Crystal 

    : 

    '   ,    Error Handler 
    ErrorHandler: 
    MsgBox CrystalReportl.LastErrorNumber 

      ,      , 
     . 

    :  LastErrorNumber     ,  
   Action.        
    (  ).      
, LastErrorNumber = 0. 


     :      . 

    LastErrorString 

           . 
   Visual Basic   : [qbopwaJCrystalReport. 
LastErrorString : 

    '        ,         Error  Handler 
    ErrorHandler: 
    MsgBox  CrystalReportl.LastErrorString 
     :  . 
    MarginBottom, MarginLeft, MarginRight, Margin Top 
        : 
    MarginBottom     . 
    MarginLeft     . 
    MarginRight     . 
    MarginTop     .    Visual 
Basic   : [. ]CrystalReport.MarginBottom[=3Ha4eHue] : 
    '                   1/2    \f      
  ' (1     =   1440   ) 
    CrystalReportl.MarginBottom  =   720 


     : , . 

    Password 

     ,       Access 
(.)  . 
       Visual Basic   : 

[qbopMa.]CrystalReport.Password[= ] 

: 

    CrystalReportl.Password  =   "PPP4"  : , . 


     5.     Crystal Reports 125 

    PrintDay 

         (    , 
   ). 
       Visual Basic   : 

    [$opMa.]CrystalReport.PrintDay[=deHb] 

    : 

    CrystalReportl.PrintDay  =   23 

     :  PrintYear, PrintMonth  PrintDay  
 .  ,    ,  
    .    ,  
,   .      ,   
    . 

    : , . 

    PrinterCollation 

          (  
PrinterCopies),  PrinterCollation , ^^!^_ . 
       Visual Basic   : 

    [qbopMa.]CrystalReport.PrinterCollation[=KO<3] 

    : 

    CrystalReportl.PrinterCollation  =   1   '       '   
    

            : 

    Q 
      	  	 
     	0	crptUncollated 
    	1	crptCollated 
     	2	crptDefault 
    : , . 
    PrinterCopies	*--4u f v' 

       ,   . 
   Visual Basic   : 
[qbopMa.]CrystalReport.PrinterCopies[=4i/cno_KOu] : 

    CrystalReportl.PrinterCopies   =   3   '        
    '      (3)      

     _       . 
: , . 

    PrinterDriver, PrinterName, PrinterPort 

      , ,   ,  
   ,     . 


    126	'               Crystal 

       Visual Basic   : 
[qbopMa.]CrystalReport.PrinterDriver[= _] 
[qbopMa.]CrystalReport.PrinterName[= _]	 
[qbopMa.]CrystalReport.PrinterPort[= _]                            

    :

    CrystalReportl.PrinterName= "Epson LQ-850" '   
    ' Epson LQ-850	i 
    CrystalReportl.PrinterPort= "LPT1" '    
    '  LPT1 

     PrinterDriver, PrinterName  PrinterPort  .  
        .   
   ",   ,   
.       ,   
  . 

     : , . 

    PrinterStartPage 

     ,      .  
  Visual Basic   : 
[qbopMa.]CrystalReport.PrinterStartPage[= StartPage] : 

    CrystalReportl.PrinterStartPage = 7 '    
    '  7-  

      StartPage    0,     
    1. 

    : , . 

    PrinterStopPage 

      ,    . 
   Visual Basic   : 
[cpopMa.]CrystalReport.PrinterStopPage[=StopPage] : 

    '              12   
CrystalReportljPrinterStopPage  =  12 

     ,       ,  
 PrinterStopPage    -1. 

    : , . 

    PrintFileCharSepQuote 

        ,    
-         
  . 
       Visual Basic   : 


     5.     Crystal Reports	127 


    [gbopMa.]CrystalReport.PrintFileCharSepQuote[=Kaeb/4Ka] 

    : 

    CrystalReportl.PrintFileCharSepQuote   =   "   '    " 

     : 
     ̸,   PrintFileType = 5  ". ^^ 
"; t ,    Destination = 2    
3  EMail; 
        PrintFileCharSepQuote  ,   
 ,        . 

    : , . 

    PrintFileCharSepSeparator 

      (),     
           . 
       Visual Basic   : 

    [qbopMa.]CrystalReport.PrintFileCharSepSeparator[=pa3dem/m^b] 

    : 

    '                    " 
  @   " CrystalReportl.PrintFileCharSepSeparator=   "@" 

     : 
      ,   PrintFileType = 5   "  "; 
      ,    Destination = 2    3  EMail. 

     : , . 

    PrintFileName 

      ,       . 
   Visual Basic   : 
[.]CrystalReport.PrintFileName[= _] : 

    '              "cust_rpt.txt"         c:\crw 
CrystalReportl.PrintFileName   = ":\crw\cust_rpt.txt" 

     : 
           ,      
   Property Pages        Choose 
Output File     ,      ; 
          ,    
   (   Destination = 2  ). 

    :    PrintFileName   
,      . 


     : , . 

    PrintFileType 

      ,      .   
 Visual Basic   : 


    128    Crystal 


    [0opMa.]CrystalReport.PrintFileType[= _] 

    : 

    CrystalReportl.PrintFileType  =   1   '         

               ( 
  Destination = 2  ): 

     		 

    0  	  ( ).    
.     .	crptRecord 
    1   	    . 
-     ,    .	crptTabSep 
    2  	     ASCII   
,  .      ,     
 .	crptText 
    3  DIF	                DIF    (data interchange 
format    ).       
     .	crptDIF 
    4  CSV (Comma separated values)	  . 
-     ,    .	crptCSV 
    5   	      
ASCII   .      , 
  PrintFileCharSepSeparator.	crptCharSep 
    6   	      
ASCII   .	crptTabSepText 
    7   Crystal Reports RPT	               
Crystal Reports.        
  EMail.	crptCrystal 
    8  Excel 2.1 XLS	      Microsoft 
Excel 2.1.	crptExce!21 
    9  Excel 3.0 XLS	      Microsoft 
Excel 3.0.	crptExcelSO 
    10  Excel 4.0 XLS	      Microsoft 
Excel 4.0.	crptExceWO 
    11 Lotus 1-2-3 WK1	      Lotus 1 
-2-3 WK1.	crpt123wk1 
    12  Lotus 1-2-3 WK3	      Lotus 1 
-2-3 WK3.	crpt123wk3 


     5.     Crystal Reports 129 

     		 

    13  Lotus 1-2-3 WKS	      Lotus 
1-2-3 WKS.	crpt123wks 
    15  RTF	    RTF (Rich Text Format).	crptRTF 
    1 7  Word  Windows	            Word    Windows.	crptWinWord 
    19  Excel 5.0 XLS L	      
Microsoft Excel 5.0.	crptExcelSO 
    20  HTML 3.0	    HTML.	crptHTMLSO 
    21  Internet Explorer	    Internet Explorer.	crptlntExpl 
    22  Netscape	    Netscape.	crptNetscape 

     : , . 

    PrintFileUseRptDateFmt 

        ,      
 ,    ,     
     .	" ,,.,.,...-..^ 
       Visual Basic   : [. 
]CrystalReport.PrintFileUseRptDateFmt[= TrueFalse] : 
    '                   , '     
     . CrystalReportl.PrintFileUseRptDateFmt   =   I 
     : 
      ,    PrintFileType = 0,1,3,4  5; 
      ,    Destination = 2    3  EMail. 

    : , . 

    PrintFileUseRptNumberFmt 

        ,         
 ( ,    . .),  
  ,        
  . 
       Visual Basic   : 

[qbopMa.]CrystalReport.PrintFileUseRptNumberFmt[=7rtyeFa/se] :	'   7 

    '                 , '     
       CrystalReportl.PrintFileUseRptNumberFmt   =   1 
     : 
      ,    PrintFileType = 0, 1, 3, 4  5; 
      ,    Destination = 2    3  EMail. 
    : , . 

    5 .   136 


    130	   Crystal 

    PrintMonth, PrintYear 

    , ,       ( 
      ). 
       Visual Basic   : 
[0op/wa.]CrystalReport.PrintMonth[= ] 
[qbopMa.]CrystalReport.PrintYear[=aod] : 

    CrystalReportl.PrintMonth=   7   '          
    CrystalReportl.PrintYear   =   1997   '       

    '          1997 
     : 
             1  12 ( = 1,  = 12); 
           ; 
       PrintYear, PrintMonth  PrintDay  . 
   ,      . 
       ,   . 
      ,    . 

    : , . 

    RecordsPrinted 

        .    
Visual Basic   : [. ]CrystalReport. RecordsPrinted : 
       ?                   
:'-Printed=   CrystalReportl.RecordsPrinted 
             , 
,   RecordsPrinted,     
,  
     RecordsSelected.      RecordsSelected. 

     :  . 

    RecordsRead 

        .    
Visual Basic   : [qbopMa.JCrystalReport.RecordsRead : 
    '                        
 Readl   =  CrystalReportl.RecordsRead 
        Crystal Reports Engine   SQL,  
     SQL, RecordsRead    
,   .      , 
  ,      . 

     :  . 


     5.     Crystal Reports	131 RecordsSelected 

      ,  ^_    
  . 
       Visual Basic   : 

    qbopMa.JCrystalReport.RecordsSelected 

    : 

                          
 elected  =  CrystalReportl.RecordsSelected 
    <ecordsSelected      ,  
 RecordsRead.	"" --  
    ,   RecordsSelected,    
     . 

     :  . 

    ReportDisplayPage 

    ,        
     Preview. 
       Visual Basic   : [qbopMa.]CrystalReport.ReportDisplayPage 
    : 
                       

-suit  =T"rystalReportlDisplayPage 

     :  . 

    ReportFileName 

     ,    .    Visual 
Basic   : [qbopMa.]CrystalReport.ReportFileName[= _] : 

    CrystalReportl.ReportFileName   =   "c:\crw\company.rpt" 

          ,      
   Property Pages        Choose 
Report     ,       
  . 

    :    ReportFileName   
,          . 

     : , . 

    ReportLatestPage 

      ^    . 
   Visual Basic   : [. ]CrystalReport. ReportLatestPage 


    132	   Crystal 

    : 
    '      
    '      

    Latest = CrystalReportl.ReportLatestPage 

     :  . 

    ReportStartPage 

      ,    . 
   Visual Basic   : [0op/wa.]CrystalReport. 
ReportStartPage : 

    '             
    '   ~          
    StartPage   =  CrystalReportl.ReportStartPage 

     :  . 

    SectionFont 

            
.    Visual Basic   : 

    [0opMa.]CrystalReport.SectionFont(uH<3eKc)[= _; _; 
_: ; ; ; ] 

    : 
    '               '         12   
,   Arial,    CrystalReportl.SectionFont(0)="FOOTER;Arial;12;N;N;N;Y" 
       SectionFont      
      .    
    "Action=1". 
        SectionFont  
1_^ .  , :	~ " ~ 

    CrystalReportl.SectionFont(0)=   "DETAIL;Arial;12;N;N;N;Y"  
    DETAIL,  : 
    CrystalReportl.SectionMinHeight(0)   =   "HEADER;Arial;12;N;N;N;Y" 
CrystalReportl.SectionMinHeight(1)   =   "DETAIL;Arial;12;N;N;N;Y" 
      . 

    SectionLineHeight 

         .   1/1440 ;    
20 .    Visual Basic   : 

    [.]CrystalReport.SectionLineHeight(uH<3eKC)[= _; _; 
; _ ] 


     5.     Crystal Reports 133 

     
    _ 
     
     
     

     

        () ,   
    . 
       (),     . 
     0. 
        .   1/1440 ;    20 . 
        .       
   ( )    . 
      .  
   0,    ?~" 
 ;       ,    
,       .  
       . 

    : 
    '                   '   
        500           300    
CrystalReportl . ^'('0')'"=""GHO;   I;   500;   300" 
       SectionLineHeight     
       .   
    "Action=1".    
 SectionLineHeight    .	^^    

     :  .

    SectionMinHeight 

         . 
   Visual Basic   : 
[.]\1.51\\\͸\)[=_;1_] : 

    '                    500   
 CrystalReportl.SectionMinHeight(0)   =   "ALL;   500" 

       SectionMinHeight     
       .   
    "Action=1".    
 SectionMinHeight    . 

     :  . 

    SelectionFormula 

     ,      . 
   Visual Basic   : 
[qbopMa.]CrystalReport.SelectionFormula[= ] 
           ,    Edit Formula  
Crystal Reports. ,       ,   
 {file.Qty}  


    134	   Crystal 

    ,  5,      "{File.Qty} > 5", 
  CrystalReportl.SelectionFormula = "{File.Qty} > 5" 
     : 
              ; 
            , : {File.Sity} 
= "",          
         : "{File.Sity} = ''" 
               ,   
     SelectionFormula,    
  .  ,      
   . 

     : , . 

    SessionHandle

       ,     
    UserName  Password   .mdb. 
       Visual Basic   : 
[qbopMa.]CrystalReport.SessionHandle[= ] 
       Visual Basic    Jet,    
SessionHandle       .   
  Password  UserName     Jet. 
    : 

    CrystalReportl.SessionHandle   =  CurrentSessionHandle 

        ,  -  
        CurrentSessionHandle. 

     :  . 

    SortFields 

      (),      
   . 
       Visual Basic   : 
[0opMa.]CrystalReport.SortFields((VHdeKC_Macctyea)[= "{+|-}"] 
    ,          
     ,     ,   
  : 

    CrystalReportl.SortFields(0)   =   "+{0rders.Customer}" 
CrystalReportl.SortFields(1)   =   "+{0rders.Orderdate}" 

     : 
       SortFields  -,     ; 
              
  ; 
             ,    
 ; 
       ^       0,  
  1  . ; 
             ;   
 (0,1,3 = ); 


     5.     Crystal Reports	135 

               
, ,     SortFields,   
 ; 
          ,    
,    ; 
               
(CrystalReportl .SortFields (0) = ""); 
            ; 
               .  
    ,      
@,   @_. 

     :  . 

    SQL Query 

      SQL,    . 
   Visual Basic   : 
!^opMa.]CrystalReport.SQLQuery[=3anpoc_SQL] : 

    CrystalReportl.SQLQuery  =   "SELECT   authors.au_id, 
    authors.au_lname,   authors.au_fname 
    FROM pubs2   authors 
    WHERE   authors . au__lname   >   ''" 

       SQL  ,     
,      '',   
 .        ' , 
        WHERE  FROM  SQL.   
    SQL,  SELECT     
 . 

     : , . 

    Status 

        .    
Visual Basic   : [qbopMa.]CrystalReport.Status : 
    '                       
rptStatus   =   CrystalReportl.Status 
     Status      : 
    	0         ; 
    	3    ; 
    	5      . 

     :  . 

    StoredProcParam 

      ,     SQL, 
     . 
       Visual Basic   : 
op/Ma.]CrystalReport.StoredProcParam(uHde/fc_napaMempa)[= _] 


    136    Crystn 

    : 
    '                 '      
14      1996    CrystalReportl.StoredProcParam(O)   =   "06/14/1996" 
            
  SQL,     .  , 
 ! ,__  ,     
    ,    396 
   "396". _-   
   Crystal Reports Engine. 

     :   . 

    UserName 

     ,        
 .mdb.     . 
       Visual Basic   : 

    [0opMa.]CrystalReport.UserName[= ] 

    : 

    CrystalReportl.UserName   =   "" 
     :      . 
     :  . 
    WindowBorderStyle 

         .    Visual Basic  
 : [qbopMa.]CrystalReport.WindowBorderStyle[= _] : 
    '              (   #2) 
CrystalReportl.WindowBorderStyle   =   2 
              : 

    		 

    0	 (   ).	CrptNoBorder 
    1	Fixed Single (      
).	crptFixedSingle    ' 
    2	  ( ,     ).	crptSizeable 
    3	Fixed  Double (      ).	crptFixedDouble 

     : , . 

    WindowControlBox 

    ,           
() . 
       Visual Basic   : 


     5.     Crystal Reports	137 

    [<JtopMa.]CrystalReport.WindowControlBox[= {True\False}] : 
    CrystalReportl.WindowControlBox  =  True   '        

 : 
      True,  ,     . 
  False; 
       ^^       
 ( Destination = 0).	"               " 

     : , . 

    WindowControls 

    ,    Preview      
 .    Visual Basic   : 
[qbop/wa.]CrystalReport.WindowControls[=To/e|Fa/se] : 
    '              Preview     
CrystalReportl.WindowControls   =   1 

    : , . 

    WindowHeight 

       ,      . 
   Visual Basic   : 
[qbop/wa.]CrystalReport.WindowHeight[= ] : 
    '                300    
CrystalReportl.WindowHeight   =   300 
     :    ,    
   (  Destination = 0). 

     : , . 

    Window/Left 

              
 .       ,    
   . 
       Visual Basic   : 

[0opMa.]CrystalReport.WindowLeft[= ] : 
    '        100  '   
  CrystalReportl.WindowLeft = 100 

     :    ,    
   (  Destination = 0). 

     : , . 


    138    Crystal 


    WindowMaxButton, WindowMinButton 

    , ,         
 Maximize  Minimize. 
       Visual Basic   : 
[.JCrystalReport.WindowMaxButton^ {True\False}] 
[qbopMa.]CrystalReport.WindowMinButton[= {True\False}] : 

    CrystalReportl.WindowMaxButton  =   False   '     Maximize 
    '         
    CrystalReportl.WindowMinButton   =  True   '        
    '     Minimize 

     :   WindowMaxButton  WindowMinButton 
        (  Destination = 0). 

     : , . 

    WindowParentHandle 

       ,      
  . 
       Visual Basic   : 
[0opMa.]CrystalReport.WindowParentHandle[= ] : 

    CrystalReportl.   WindowParentHandle  =   Forml.hWnd 

       WindowParentHandle   Forml. 
  ,        Forml. 

     :  . 

    WindowState 

       Preview: ,   
 ,      Preview. 
       Visual Basic   : 
[qbopMa.]CrystalReport.WindowState[= ] : 
    '                Preview 
CrystalReportl.WindowState=   2 
       WindowState    : 

    		 

    0	 Preview    ,  .  
        ,     
   Windows.	crptNormai 


     5.     Crystal Reports 139 

    		 

    1	 Preview        
  .         
 (0) .	

     crptMinimized 

    2	 Preview     .	

    crptMaximized 


     : , .                              

    WindowTitle 

               
.    Visual Basic   : 
[qbopMa.]CrystalReport.WindowTitle[= ] : 

    CrystalReportl.WindowTitle   =   "   "  : 

           ; 
        WindowTitle  ,    
   (  Destination = 0). 

     : , . 

    WindowTop 

               
 .       ,  
    . 
       Visual Basic   : 
[qbop/wa.]CrystalReport.WindowTop[= ] : 
    '         100              
    '             CrystalReportl.WindowTop   
=   100 
     :   WindowTop  ,   
    (  Destination = 0). 
     : , . 

    WindowWidth 

         .    Visual Basic  
 : [qbopMa.]CrystalReport.WindowWidth[= ] : 

    CrystalReportl.WindowWidth  =   480 

               480    


    140	   Crystal 

      WindowWidth  ,     
  (  Destination = 0). 

    5.6.    Crystal 


    PrintReport 

      . 
       Visual Basic   : 

    [qbopMa.]CrystalReport.PrintReport 

    : 
    '          Result  =  
CrystalReportl.PrintReport    
     : 
        PrintReport    0,   ,  
  =  20,    ; 
          ,   Action. ,  
-  , '    
,   .      
   . 

