Submit Crystal Reports Questions to Computer Education Techniques CETi

Submit Crystal Reports Questions Computer Education Techniques - CETi

Submit Crystal Reports Questions

Home

Submit Crystal Reports Questions

Technology Update

Knowledge Base


Submit Crystal Reports Questions to Computer Education Techniques CETi Advanced search
     

Interrelated Information Technology

Database Questions .NET Questions
Java Questions Computer Applications Questions

The Computer Education Techniques knowledge base is a service for answering questions, inclusive of the research and validation of the accuracy of information in the public domain. Citation of source documentation and examples are used to provide answers to the questions. Utilization of the information of this service and reliance on the answers, information or other materials received through this web site is done at your own risk.

Q I am experienced with MS Access; however, this is my first full-time job information technology where I have to support business professionals.  Do you have any guidelines for designing reports?
A Effective report design is built upon two fundamental principles:

1 - Identifying the information processing requirements of the target audience.
2 - Making reports relevant to the target audience.

Our staff of system consultants support the following guidelines:

  • Determine the audience. Provide a straightforward way for the audience to provide reasonable and efficient feedback on what is required in a report.
     
  • Determine the purpose of a report. Ascertain from users what data is required and in what format. Once the report design has been implemented, periodically have the users assess the functionality in the database (preferably in writing) and consider incorporating their feedback into redesigning reports which will meet their evolving needs.
     
  • Remain focused on the purpose of report. Do not make the mistake of allowing the scope of a successful report to grow. In most situations, it will be more effective to create separate subreports.
     
  • Graphics should be selectively incorporated into a report.
     
  • Clarity and simplicity is a virtue. Do not overburden a report with boilerplate, meaningless graphics, or other things that don't serve the purpose of the report.

Q Management at the organization that I work for have placed a premium on the effective utilization of date formats in our implementation of Crystal Reports.  Do you have any recommendations on how they should be used?
A In many situations, a preferred date format is specific to the organization e.g. American Fortune 2000 companies, United State military, United States government, airlines, and international organizations.

Consider the confusion inherent in the following two formats when communicating with someone who does business internationally and asks for an item to be delivered "on 02/03/2008.":

MM/DD/YYYY

02/03/2008  

DD/MM/YYY

03/03/008

 

A reasonable solution is to use MMM to indicate the month. The three upper case letters in the date format are the three-letter designation for the month. However, the mixing of alpha and numeric will not be uniformly effective method within a database or spreadsheet; this is because calculations will typically need to be performed on the dates.  In order to meet this requirement the following formats are utilized:

Format Utilization
YYYYMMDD When working with data.
YYYY-MM-DD When working with data.
DDMMMYYYY When working with information.
MMDDYYYY Do not use.

Our staff of system consultants supports the following guidelines:

  • Use four digits for the year, not two.
  • When imposing a format for data validation purposes, provide a legend for a date mask.
  • When a legend is provided for a date mask, lower case letters indicate hours, minutes, and seconds:
  • When using a 12-hour clock, consider going to a 24-hour time standard.

 


Q

We are using an older release of Crystal Reports.  Is it worthwhile to upgrade in order to avail ourselves of the improvements in the group expert?

A1 The Group Expert provides a convenient way to ascertain which fields are being used for groups in a report. It also provides a straightforward way to move and sequentially order groups.

In release Crystal Reports 9 and above:

  • An undo can be performed after a delete group.
  • A group can be performed on the same field more than once. This allows a field to be used for a specified order and then within that group perform a grouping by individual values of the fields.
A2

Earlier versions of Crystal Reports require that a formula be created which uses the group field. It then would be possible to group on the formula. In most situations, it is in the best interest to be using the latest/newest version of the software.


Q Do you have recommendations on how to use the Crystal split function?
A A) Array values can be displayed better with "Join" functions.

Example:

      Join ({?Country}, ", ") // array, delimiter

If the {?Country} parameter contains the values ["Australia", "New Zealand", "Hong Kong"] the result of this function will be "Australia, New Zealand, Hong Kong".

The split function can be used to achieve the opposite result:

    taking "Australia, New Zealand, Hong Kong" and returning an array.

This can then be used to pass a multi value parameter to a subreport by performing the following steps:

1) Create a formula to join the list together.

2) Link that formula to a single value string parameter in the subreport.

3) Modify the record selection formula in the subreport with the split function to:

    {Customer.Country} = split({?Pm-@Country List}, ", ")


Q

I am experiencing problems with blank pages in reports.  How can I address that problem?

A1 Use "Keep Together" to avoid blank pages.
A2 Exercise judgment when using objects.

The following three objects can change size dramatically inside a report.

Memo field Crosstab object Subreport

When these objects are placed on a report and they become very large, the "Keep Together" property can result in the entire object being relocated to the next page. In these situations, it may well be necessary to have a portion of the object on the current page and then have the remainder displayed over subsequent pages.

Deselect the "Keep Together" on the formatting for the section the object is in.

On subreports and memo fields it also will be necessary to deselect "Keep Together" on the object format.


Q I am working on a project and we have a data column in a SQL db table that has a large varchar string separated by commas. I will refer to the column name as *raw_data*.

Example:

55 NE HAGY ST, , CAMAS, ZZ, 94407-. , , , ,P , -, .

or

188/8 MVP CCD TR, , VIZ, DD 52201-. EFFECTIVE DATE: 11/21/2007. , , , ,P , -, . EFFECTIVE DATE: 11/21/2007.

This data is very confusing.  Programmatically, the requirement is to extract a single piece of data (say where the P is) always between the 8th and 9th commas. The data and lengths vary from record to record so all I have to go by are the commas.

Do you have any recommendations?

A Our recommendation would be to utilize the following code snippet:

   Local NumberVar StrLoc := 1;
   Local NumberVar i;
   For i := 1 to 8 Do
   (StrLoc := InStr(StrLoc,",",{raw_data}) +1);
   If {raw_data}[StrLoc] = "P" Then
   True
   Else
   False;


Q How should numeric arrays be declared in order to allow for the efficient accessing of a single element?
A In order to declare a numeric Array in CR, create a formula similar to the following:

   Numbervar Array MyArray := [1, 2, 3, 4, 5];

In order to assign a new value to one particular element of the Array, create a formula similar to the following:

   Numbervar Array MyArray := [1, 2, 3, 4, 5];
   MyArray [3] := 25

The element 3 was reassigned with the value 25.


Q What is the Preserve option on the Redim statement?
A The format of the Redim is:

   Redim Preserve x[n]

This function will re-dimension the array x to size n, while preserving the initial values in x. The array is x and n is a positive whole number specifying the new size of n.


Q Does Crystal Reports support stored procedures?
A Crystal Reports supports stored procedures from most of the common databases. Stored procedure support depends on whether the report is connecting to the database through Crystal's direct database drivers or through an ODBC connection.

Q Is there any way to programmatically change the printer orientation at runtime using API calls?
A The printer orientation of a report can be changed at runtime by using the PESelectPrinter function call.

Q I am getting error messages indicating that "a date is required here" or "a string is required here", in my formulas that are doing Date conversions. How can I correct resolve this question?
A These errors indicate that the likelihood is that your date or date/time fields are being returned in an incorrect format that has been coded in your formula. This can be corrected in two ways. Either correct the formula, or go under the File menu, select Report Options, and select "Convert Date/Time to Date" or "Convert Date/Time to String". The selection in the second method will be based upon the incorrect result which is currently being returned.

Q

I took both Visual Basic and Crystal Reports courses from SYS-ED in year's past and I require some assistance on my current assignment. In one of my report screens, the user presses a command button to generate a report. When the user presses the command button for a second time, the message will need to pop up saying "report already open." How can this be implemented?

A There are a couple of ways of coding a solution.

1 - As long as the data is identical, the button should be deactivated after clicking on it. This will prevent the report from being generated more than once

2 - Another approach would be to declare a window variable and initialize it to zero. Next place a check on the value of this variable. If the value is zero the report should be generated. After the report is
    generated/shown add 1 to the variable. This means that when the value is checked, the code that generates the report will not run.


Q

Do SYS-ED's Crystal Report courses teach the Repository?

A The repository is a central library for storing common report objects for use across multiple reports and single point updating. Yes, we cover both the subject and provide examples for Crystal Reports - version 10 and higher.

The Repository was updated in version 10 in order to create a managed system for report design and maintenance. Repository objects can be secured and shared through Crystal Enterprise and are made available through the Crystal Reports designer.

Schedule