Using Crystal Reports

This chapter provides an overview of Crystal compatibility issues and describes how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding Crystal Compatibility Issues

The following lists the compatibility issues that you should be aware of when upgrading to Crystal Reports version 9:

Click to jump to top of pageClick to jump to parent topicConfiguring Crystal Reports

This section describes how to:

Note. These configuration options are relevant only if you have installed Crystal Reports.

Select Start, Programs, PeopleTools 8.4, Configuration Manager to access PeopleTools Configuration Manager. Alternately, you can go to <PS_HOME>\bin\client\winx86\ and launch pscfg.exe.

Click to jump to top of pageClick to jump to parent topicSpecifying Crystal/Business Interlink Options

Use the Crystal/Bus. Interlink tab to specify the locations of Crystal Reports executables and default location for Crystal Reports generated through PeopleSoft Query; the latter must be a directory to which the user has write access. This tab also lets you specify the location of Business Interlink drivers.

Crystal EXEs Path

If you have Crystal installed locally on the workstation, the Crystal EXEs Path is populated automatically. But, if you have Crystal installed on a network drive, set the Crystal EXEs Path parameter to reflect the location of the Crystal Reports executables, for example:n:\hr880\bin\client\winx86\crystal.

Default Crystal Reports

The Default Crystal Reports option allows you to specify the default location of your customized reports.

Note. If you are creating a Crystal report from PeopleSoft Query and this path is invalid, you will receive an error message. If a path is not specified, PeopleSoft Query tries to write the file to the language directory beneath the directory containing Crystal Reports (CRWRPTPATH).

Use trace during execution

When this option is selected, Crystal writes the trace statements to a log file that you specify in Trace File field. This file is written to the workstation's %TEMP% directory by default.

Note. When you are tracing Crystal reports through the Process Scheduler, edit the settings in the Crystal section of the psprcs.cfg configuration file. (This file is located in <PS_HOME>/appserv/prcs/<dbname> for UNIX and in <PS_HOME>\appserv\prcs\<dbname> for Microsoft Windows.) Change Trace=YES and specify a location for TraceFile, supplying a full path and file name.

Click to jump to top of pageClick to jump to parent topicSpecifying the Path for Production Crystal Reports

In the Configuration Manager, select the Profile tab, select a profile to edit, and then select the Process Scheduler tab.

See Configuring User Profiles.

In the Crystal Reports [CRWRPTPATH] field, enter the path to your Crystal production reports.

Note. CRWRPTPATH is a read-only directory intended to hold production reports.

Click to jump to top of pageClick to jump to parent topicRunning Client Setup

If you've installed Crystal Reports on your Windows-based development workstation, you need to use Configuration Manager's Client Setup tab to configure your workstation to run successfully with your PeopleSoft system.

Note. Keep in mind that the Client Setup tab is not the only tab that contains essential values for the PeopleSoft workstation. You should make sure that all of the tabs reflect the correct values for your site, especially the Process Scheduler tab for the Default profile.

The Client Setup tab:

Important! These Client Setup functions are performed when you click OK or Apply on Configuration Manager only if the Install Workstation check box on the Client Setup tab is selected.

Note. Any files installed by Client Setup on the workstation from the file server, including ODBC driver files, use the paths specified in the default profile.

To run Client Setup:

  1. In the Configuration Manager, select the Client Setup tab.

  2. In the Group Title text box, enter the name of the program group for the icons you want on the client workstation.

    You can call the program group anything you want, but this book refers to it by its default name, PeopleSoft 8.

  3. Select check boxes to create shortcut links for any PeopleSoft applications that you wish to access from the workstation.

    When you run Client Setup, it uninstalls any existing shortcuts in the PeopleSoft 8 program group, and installs shortcuts for the applications that you have selected. If you subsequently want to install or uninstall shortcuts, you can always rerun Client Setup.

  4. Select the Install PeopleSoft ODBC Driver check box if you wish to install the PeopleSoft ODBC driver and set up a user ODBC DSN required by PeopleSoft Open Query and by Crystal Reports.

  5. Select the Install Workstation check box.

    This check box determines whether Client Setup runs when you click Apply or OK in Configuration Manager. If this box is not selected, Client Setup either creates or updates settings in the registry, but does not set up the PeopleSoft 8 program group or install local .dlls.

  6. Click Apply to run Client Setup and apply the other Configuration Manager settings.

  7. To view a list of the files installed and actions taken by Client Setup, you can open the psinstal.log file in your TEMP directory.

Click to jump to top of pageClick to jump to parent topicSigning into a PeopleSoft Database

You must sign in to a PeopleSoft database before you can generate a PeopleSoft report from Crystal Reports. When you open Crystal Reports and create a new report, Crystal prompts you to sign into a PeopleSoft database using Crystal's sign-in dialog. When you run a preexisting report, you sign in to a PeopleSoft database using PeopleSoft's sign-in dialog. After successfully signing in to a database, you have full reporting flexibility.

Click to jump to top of pageClick to jump to parent topicCreating and Formatting Crystal Reports

This section describes how to:

Click to jump to top of pageClick to jump to parent topicCreating Crystal Reports

To create a new report using Crystal:

  1. Select Start, Programs, Crystal Reports 9 to display the Welcome to Crystal Reports window.

  2. Click the Using the Report Wizard radio button.

    The Report Wizard guides you through the creation of a typical report.

  3. Click the OK button.

    You will see the Crystal Reports Gallery dialog.

  4. Click the OK button to select the Standard wizard.

    The Standard Report Creation dialog appears.

  5. Click the + sign to the left of the Create New Connection folder to display its contents.

  6. Click the + sign to the left of the ODBC (RDO) folder.

    The ODBC (RDO) dialog box appears.

  7. Select PeopleSoft PeopleTools as the DSN.

    Note. When signing in to two-tier, make sure that the Server Name and other three-tier fields are not populated in the PeopleSoft PeopleTools DSN. These will be picked up as defaults for the connection information you enter them.

  8. Click Finish.

    The PeopleSoft Signon screen appears.

  9. Enter the database name, user ID, and password, and click OK.

  10. If needed, click the + sign to the left of the PeopleSoft PeopleTools folder under ODBC (RDO), and then click the + sign to the left of QUERY to display a list of queries.

    The list contains all the queries from which you can create a report.

  11. Highlight a query from the list and click the > button.

    The query you selected appears in the Selected Tables group box, indicating that it has been added.

  12. You can select additional queries if necessary. When you have completed your selections, click the Next button to navigate to the Fields dialog.

    Note. If you have selected multiple queries, clicking Next at this point takes you to the Link dialog box.

  13. Highlight one or more fields and click the > button, or click the >> button to add all the fields from the query that you want to appear on your report.

    When fields have been added, the < and << buttons become active.

  14. (Optional). Click the Next button and select from the following dialog boxes:

  15. Click Finish and click the Design tab or Preview tab to format your report.

Click to jump to top of pageClick to jump to parent topicFormatting Crystal Reports

To format a new report using Crystal Reports:

  1. With the new report on screen, click the Design tab.

  2. Enter the appropriate values:

    Note. In most cases, you need to enter the appropriate field type (text field, and so on) before you can enter information.

  3. Click the Preview tab to preview your report.

    The page orientation defaults to portrait or landscape according to the number and width of the columns in your query. If the query columns do not fit in landscape, Crystal displays as many columns as fit on the page and does not display the others.

    You can make any adjustments to the formatting, such as resizing headings, from within the print preview window. For example, if the report title is not centered properly, you can move it. You can click the Design tab to return to the report template.

  4. Click the Refresh button to refresh your data after making changes.

  5. Click the Save button to save your report.

Important! If your reports contain numeric fields that are formatted to have single- or double-line borders at the top of the container, you may experience incorrect justification of numbers in the HTML output. To resolve this issue, either draw lines above the numeric fields using the line drawing tool, or insert summary fields into a blank text object and then format the container text object to include borders above the text.

See Crystal Reports documentation.

Click to jump to top of pageClick to jump to parent topicPrinting Reports

After saving the file, you can print the report by clicking the Print button or selecting File, Print, Printer. As with many Microsoft Windows applications, you can choose to print the entire report or only a few pages, specify the number of copies to print, and indicate whether you want the copies collated.

Note. To run your report directly from PeopleSoft Query, the query and report names must match in order to use the formatting you have just created in Crystal Reports every time you print the report. If you always update and print the report from within Crystal Reports, it does not matter.

Note. If you print reports using the PeopleSoft Process Scheduler, you must define the appropriate paper size in the Crystal process type definition.

See Entering Global Definitions for Processes.

To print HTML reports from Crystal, open the appropriate HTML file and print it from the browser. Crystal uses the default page setting to print the report. Sometimes, the right side of the report will be cut off when it is sent to the printer, even though it appears in the Crystal Report viewer.

To change your default page settings to print HTML reports:

  1. Select File, Page Setup.

  2. Change the left and right margin settings to create smaller margins.

Click to jump to top of pageClick to jump to parent topicModifying Crystal Reports Defaults

You can set a number of different defaults in Crystal Reports.

Note. If you modify a query to include additional fields, you need to modify the report definition in Crystal to include the new fields in your report. To modify the definition, select Database, Verify Database.

Changing Crystal Default Column Headings and Report Titles

To edit column headings:

  1. Click the Design tab and, in the Page Header section, double-click the heading that you want to change. (You can also click the text object and select Edit, Edit Text.)

    A ruler appears above the text object, and a hatched box appears around the text. The Crystal text formatting features (such as font, bold, italics, and so on) are available in this mode.

  2. Edit the column heading text, and then click a blank area of the report to deselect the text object.

    The system displays the new column heading in the display window.

    Note. You can make the column headings as long as you like. However, if you make them much longer than the current heading, you will need to enlarge the text box to fit the heading.

Changing Fonts

To change font attributes:

  1. Make sure that the item is selected and select Format, Format Text.

    The Format Editor dialog box appears.

  2. Click the Font tab.

  3. Choose the font, style, size, and color that you like.

Adding a Print Date Field

To add a print date field:

  1. If Field Explorer is not already displayed, select View, Field Explorer to display it.

  2. If necessary, click the + to the left of Special Fields.

  3. Drag the Print Date field from the Field Explorer to the appropriate area of the report.

    A box with Print Date appears where you dragged.

    To modify the format of the Print Date field, right-click the date box and select Format field.

Click to jump to top of pageClick to jump to parent topicRunning Crystal Reports

This section discusses how to:

Note. If you have access to the Microsoft Windows version of Query Designer—that is, if you have a Microsoft Windows-based workstation set up as a PeopleTools development environment—you can run queries directly to Crystal Reports from Query Designer. This option is not available from web-based Query Manager or Query Viewer. However, users who do not have access to Windows Query Designer can schedule a predefined Crystal Report to run on a Process Scheduler server, and the results can be routed to PeopleSoft Report Manager.

Note. If you want to run Crystal jobs in background mode, you need to update some values in the system registry. See the red paper “PS/nVision in the PeopleSoft Internet Architecture” on Customer Connection for the details. The section “Running Multi-Concurrent PS/nVision Reports” covers system settings that are relevant to all programs that you can run in the background—including nVision and Crystal.

Click to jump to top of pageClick to jump to parent topicRunning Crystal Reports From PeopleSoft Process Scheduler

If you submit a process request, you can run the report on a client workstation or on a Microsoft Windows server without having to exit the PeopleSoft system or use a third-party scheduling program. If you schedule processes to run on a Microsoft Windows server, you can run the report at a future date and time.

When Crystal reports are run through Process Scheduler, you can either:

See Submitting and Scheduling Process Requests.

Note. You cannot run alias Crystal reports—either from the Crystal Reports application or from Process Scheduler—if the alias name contains certain characters. If your alias Crystal report will not run, check the InvalidAliasCharList entry above the following directory of the registry: HKEY_LOCAL_MACHINE\Software\Crystal Decisions\9.0\Crystal Reports\Database\ . If any of the characters in your alias tablename are listed in the entry, either change these characters to characters that are not listed in the entry or change the entry to remove any characters that you want to be able to include in your alias tablename. Please note that the entry must contain at least one character.

Note. When running Crystal reports through Process Scheduler, you are prompted for parameters if the PeopleSoft ODBC driver for the version of PeopleTools that you are running is not installed.

Note. If you use Process Scheduler to run a report, and select the File/XLS option, you may find that the totals do not align with the detail columns that the totals represent. If so, you can address these alignment issues by following the guidelines provided in the document “Exporting to Microsoft Excel.”

See “Exporting to Microsoft Excel” http://www.businessobjects.com

Runtime Prompts

When you are running a Crystal report that has runtime prompts in PeopleSoft Pure Internet Architecture, the prompt values need to be passed using the Command Line. You can do this either by hard-coding static values in the Process Definition page, or by creating a PeopleSoft Pure Internet Architecture page to gather values from the users and dynamically pass them into the Command Line.

Note. The number and order of the prompt values must be exact.

For example, if you have a report whose query prompts on Business Unit, and you only want the report to run for Business Unit BU001, you could hard-code that prompt value into the Process Definition in quotes:

The resulting Command Line would look similar to this:

C:\PT845\BIN\CLIENT\WINX86\PSCRRUN.EXE -CTMICROSFT -CDPT845 -COUSER1 -CPOPRPSWD -I45 -RP"Employees by Department for BU001" -OT5 -OPDistribution List -LGENG -OF8 -ORIENTL "BU001"

To allow users to dynamically select prompt values at runtime:

  1. Using PeopleSoft Application Designer, create a PeopleSoft Pure Internet Architecture Run Control page.

  2. Insert an edit box for each prompt field.

  3. Click the newly inserted edit box to display the Edit Box Properties dialog box.

  4. Use the drop-down list boxes to select the record and field you are prompting on.

  5. Save your changes.

  6. Go to Process Scheduler and modify the process definition parameter list to include your prompt field using the format :RECORD.FIELD

    See Enterprise PeopleTools 8.46 PeopleBook: PeopleSoft Process Scheduler.

Note. The resulting Command Line would look the same as above except, instead of BU001 it would contain the selected value.

Click to jump to top of pageClick to jump to parent topicRunning Standard Reports From Within Crystal Reports

To run standard reports from within Crystal Reports, the system uses a query created in PeopleSoft Query and a report definition created in Crystal. All the elements are predefined—all you do is view and print the reports.

To run a standard report:

  1. Select Start, Programs, Crystal Reports 9.

    The Welcome to Crystal Reports dialog box appears.

  2. Select the Open an Existing Report option, if it is not already selected.

    Crystal displays a list of report files, which use the .rpt file extension.

  3. Double-click the name of the report you want to open, or highlight it and click OK.

    Crystal opens the selected report template and displays it as it is formatted for printing.

  4. Select File, Print Preview or click the Print Preview button on the Crystal Reports toolbar to view the report before you print.

    Once you've signed in to your database, Crystal Reports displays a print preview containing the rows of data that will appear in the printed report. You can perform the following actions:

Click to jump to top of pageClick to jump to parent topicLaunching Crystal Reports With PeopleSoft Query

You can export queries to Crystal to create default reports. Default Crystal reports are generated in the following ways:

If you want to run your report directly from PeopleSoft Query, the query and report names must match in order to use the formatting you have created in Crystal Reports every time you print the report. If you always update and print the report from within Crystal Reports, it does not matter.

Note. End users should create and maintain reports in Crystal. PeopleSoft Query is used to create and maintain the queries that generate report contents.

To run a query with Crystal Reports output:

  1. Launch Application Designer, and then select Go, Query.

  2. Select File, Open or click the Open Query button to display the Open Query dialog box.

  3. Click the down arrow to the right of the Name box to display a list of existing queries.

  4. Highlight the name of the query that you want to base the report on and click OK.

    If none of the saved queries meets your needs, you can create a new query.

  5. Click the Run Query button to run the query.

  6. Click the Run to Crystal Report button to run the query to Crystal Reports.

    The system automatically opens the Crystal Reports application and creates a new Crystal report.

  7. Use Crystal Reports to format your data, add a report title, modify column headings, and so on.

Repeated Query Prompts

PeopleSoft Query cannot supply values to Crystal at runtime. Crystal stores the default values as NULLs and does not allow you to change stored procedure values, so you must enter the prompt values twice.

When queries include prompts, you are prompted once at design time and once at runtime to enter the appropriate values. This behavior is related to the definition of a stored procedure.

Most databases can return any number of result-set columns based solely on the input to a stored procedure. For Crystal to create a static report template, it must execute the stored procedure with the default parameter values once before it can request the definition of the result set. Because of this, the stored procedure (the query) is executed once at design time (to fill in the result set descriptions) and again at runtime (as expected).

Note. You should also expect to be prompted when verifying the database in the report. The issue is the same as the design-time prompt followed by the runtime prompt issue just described. Fill in the appropriate values after choosing to verify the database.

See Also

Creating and Running Simple Queries

Click to jump to top of pageClick to jump to parent topicWorking with Multiple Languages

This section discusses:

Click to jump to top of pageClick to jump to parent topicUnderstanding Data Returned by the Report

Data returned by Crystal Reports is fetched from the database using PeopleSoft Query, and therefore is already language-sensitive due to the automatic joining to related language tables that PeopleSoft Query performs. No special logic is required to ensure that appropriate descriptions from related language tables are returned in Crystal Report output.

Click to jump to top of pageClick to jump to parent topicUnderstanding Report Layout and Boilerplate Text

The Crystal Reports .rpt file contains the layout of the report and any text that is hard-coded into the layout, such as column headings, headers, and footers. Because Crystal Reports does not provide any ability to maintain multiple translations of this boilerplate text in a single .rpt file, you must maintain separate copies of the report layout for each language.

On the file and report servers, PeopleTools maintains separate directories within the <PS_HOME>\CRW directory that correspond to the language codes available for your PeopleSoft implementation. Each directory contains the appropriate report in the specified language, if the report has been translated. PeopleTools tries to read the report from the directory that corresponds to the user’s preferred language. If it cannot find the report there, Crystal uses the report in the base language directory <PS_HOME>\CRW. Finally, if the report is not in the directory corresponding to the user’s current language or in the base directory, PeopleTools uses the copy of the report in the <PS_HOME>\CRW\ENG directory.

Click to jump to top of pageClick to jump to parent topicUnderstanding Crystal Reports Designer/Runtime Language Versions

Crystal Reports is available in several different language editions. You receive the appropriate language edition of Crystal Reports based on the languages you license when you purchase PeopleSoft software. Each language version of Crystal Reports is functionally identical, the primary difference being the language of the Crystal Reports Designer user interface. You do not need to match the language of the Crystal Reports design or runtime engine to the language of the report you are creating unless you are using the Crystal ToWords function. This limitation can be overcome by using the PSToWords or PSToWordsLoc functions.

Using PSToWords and PSToWordsLoc

PSToWords and PSToWordsLoc are similar to the Crystal ToWords function in that they convert a numerical amount into a textual representation of that amount, as you see on checks. But unlike ToWords, these functions are independent of the installed language of Crystal Reports Designer. After configuring the location of the supporting .dlls, these functions appear in the Crystal Function Editor as new Additional Functions.

Configuring Crystal Reports Designer to Use PSToWords

PSToWords and PSToWordsLoc functionality is contained in three files called psicuuc22.dll, psicudt22l.dll, and psicuin22.dll, which are located in your <PS_HOME>\bin\client\winx86 directory. To use these functions in Crystal Reports Designer, you need to either add the location of these .dll files to your PATH environment variable so that Crystal Reports can find and load them, or else copy them to your local directory where crw32.exe is installed, by default C:\Program Files\Crystal Decisions\Crystal Reports 9. For Process Scheduler to use these functions in a scheduled report, you do not need to configure anything, because <PS_HOME>\bin\client\winx86 is the current directory for the Process Scheduler.

You can type PSToWords or PSToWordsLoc directly in the Function Editor, or choose them from the list of Additional Functions in the Function Editor of the Crystal Reports 9 Designer. To confirm that the .dlls are loaded in Crystal Designer, navigate to Help, About, More Info, and check that the three psicu files are listed.

Syntax for PSToWords and PSToWordsLoc

The syntax for PSToWords is PSToWords(number,places), where number is a numeric amount and places is the number of decimal places or precision to print. For instance, PSToWords(12.345,2) prints twelve and 35 / 100.

The syntax for PSToWordsLoc is PSToWordsLoc(locale,number,places), where the locale parameter specifies an ISO language or locale code. For examples of ISO locales used in PeopleSoft, see the cross references below. For instance, PSToWordsLoc("es",12.345,2) prints doce y 35 / 100.

See Determining PeopleSoft and ISO Codes for Your Language.

See Using Browser Language Settings to Determine the Sign-in Language.

Converting Entities to Characters

Crystal Reports 9 is Unicode-enabled, except in Application Protocol Interface (API) function calls. To work around this limitation, PSToWords and PSToWordsLoc return any non-USASCII characters as HTML decimal entities. To convert these entities to Unicode characters, you need to include a report custom function in your .rpt file. In Crystal Reports Designer Formula Workshop, create a new Report Custom Function called PSToUChar and paste in the following code:

Function (StringVar instring) local StringVar outstring := ""; local NumberVar i; local StringVar curtoken; local NumberVar toklen; local StringVar widechar; //Convert Entities to ChrW for i := 1 to (Length(instring)) Do ( curtoken := mid(instring,i,2); toklen := instr(i+2,instring,";")-(i+2); if curtoken = "&#" then widechar := chrw(val(mid(instring,i+2,toklen))); if curtoken = "&#" then outstring := outstring + widechar; if curtoken = "&#" then i:=i+toklen+2; if curtoken <> "&#" then outstring := outstring + mid(instring,i,1); ); outstring;

A report-defined function enables you to define a function to be saved within the .rpt file. The syntax for this function is

PSToUChar(PSToWords(number,places))

or

PSToUChar(PSToWordsLoc(locale,number,places))

Limitations

The largest number converted to words is 999,999,999.999 for most languages. Numbers higher than that amount, or where the encoded string of words would exceed 254 bytes, will be displayed in digits rather than in words.

Because Thai words for numbers often exceed the 254-byte limit when encoded as entities, you can use the special locale x-th instead of th to return the Thai characters without encoding them as entities. This allows for a longer string to be processed but requires a server with a system default locale set to Thai. The syntax for Thai processed in this fashion would be ToWordsLoc("x-th",number,places).

Click to jump to top of pageClick to jump to parent topicUnderstanding the Language Parameter for pscrrun.exe

PeopleSoft Process Scheduler uses the pscrrun.exe process to execute Crystal Reports. The process’s language code parameter specifies the language directory that pscrrun.exe uses to fully qualify the report path. Unlike Structured Query Reports (SQRs), pscrrun.exe searches for a separate Crystal Report file for each translation of the report. The language directory parameters are needed because each language-specific report is stored in a separate language directory. If the report is not found in the language that is specified by the parameter, pscrrun.exe looks in the default, base-language directory.

Typically, the language parameter is passed to pscrrun.exe from the run control that is associated with your Crystal Report.

See Also

Enterprise PeopleTools 8.46 PeopleBook: PeopleSoft Process Scheduler

Click to jump to top of pageClick to jump to parent topicUnderstanding the Customization of Crystal Reports for Multilingual Environments

The PeopleSoft system allows you to use a single Crystal Report server for all languages. The following features support this ability:

Click to jump to top of pageClick to jump to parent topicUnderstanding the Process of Searching for Translated Reports

To call up translated production reports in the correct language, the Crystal Reports for PeopleSoft application performs the following steps, in this order:

See Also

Specifying the Path for Production Crystal Reports

Defining PeopleSoft Process Scheduler Support Information