tailieunhanh - Crystal Reports For Visual Studio 2005 phần 9

Lưu ý xem trước này của Windows Form là một tính năng mới được gọi là thời gian thiết kế Xem trước. Để biết thêm thông tin, xem Phụ lục: Thiết kế Thời gian Xem trước. Khi chạy, khi bạn xây dựng và biên dịch Crystal Reports có sẵn để mua như một ứng dụng riêng biệt, hoặc là một phiên bản được cài đặt như là một phần của hầu hết các phiên bản của Microsoft Visual Studio | Walkthroughs Dim gradeA quarter The type of gradeA is set to Number Range gradeA 90 To 100 The type of quarter is set to Date Range quarter CDate 1999 10 1 To CDate 1999 12 31 Variable Scope Basic Syntax Variable scopes are used to define the degree to which variables in one formula are made available to other formulas. There are three levels of scope in Crystal Reports Local Basic Syntax Global Basic Syntax Shared Basic Syntax Every variable has a scope and this scope is specified when the variable is declared. Local Variables Basic Syntax Variables with local scope also known as local variables are declared using either the Dim or Local keywords. Local x As Number equivalent to Dim x As Number Local variables are restricted to a single formula and a single evaluation of that formula. This means that you cannot access the value of a local variable in one formula from a different formula. Example Rem Formula A Local x as Number x 10 formula x Rem Formula B EvaluateAfter @Formula A Local x as Number formula x 1 The function call EvaluateAfter @Formula A ensures that Formula B will be evaluated after Formula A is evaluated. Formula A returns a value of 10 and Formula B returns a value of 1. Formula B does not have access to Formula A s x and thus cannot use the value of 10 and add 1 instead it uses the default value for the uninitialized local variable x found in Formula B which is 0 and adds 1 to it to get 1. You can also create local variables with the same name but different types in different formulas. For example the type declarations in formulas A and B do not conflict with Rem Formula C Local x as String Copyright 2004 Business Objects Page 473 Walkthroughs x hello formula x Local variables are the most efficient of the three scopes. In addition they do not interfere with one another in different formulas. For these reasons it is best to declare variables to be local whenever possible. Global Variables Basic Syntax Global variables use the same memory block to