Controlling, Printing, and Exporting Reports


Controlling, Printing, and Exporting Reports

Often when you choose to view a report on demand (or schedule a report, for that matter), you need to supply additional information before the report will run properly. In many cases, the report will need to connect to a secure database as its data source ”this database will typically require a user ID and password for proper access.

Also, many reports of moderate to high sophistication will be based on Crystal Reports parameters. A parameter will prompt the viewer for customized information each time the report is run on demand. This information, such as one or more departments, a date range, a region, one or more sales people ”the list can go on and on ”is used to limit or customize the report to the chosen parameter items.

Supplying Database Credentials and Parameters

If a report is based on a secure database, you ll probably need to supply one or more database credentials, such as user ID, password, server name, or database name when you view the report on demand, or schedule the report (scheduling is covered later in this chapter, under Scheduling Objects ). If you don t supply a proper set of credentials, the report will be unable to connect to the database. The set of database credentials required in your particular organization can vary depending on what database system your reports connect to. If you have a variety of different databases that reports can be based on (for example, some reports are based on Microsoft SQL Server, while others are based on Oracle and yet others are based on Informix), you may find that different sets of credentials are required for different reports.

If any Crystal Reports parameter fields have been added to the report, you will probably be prompted to supply one or more parameter values when you run a report on demand or schedule it. Parameter fields may ask for a variety of values, such as one or more regions , a salesperson number, a date range, and so on.

Parameter fields can vary widely in data type (text, dates, numbers, and so forth) and parameter type (multiple value, range, and so forth). For example, a single text parameter may be required to specify the country to be used in the report. In this case, you might supply USA as the value for the parameter. Another parameter might request one or more salesperson numbers. You, therefore, might supply just salesperson number 5. Or, you might want to see the report for several salespeople ”you would then supply salesperson numbers 5, 10, 15, and 17. Or, you might encounter another parameter that needs a date range to be supplied. You would, for example, supply dates between January 1, 2002, and May 31, 2002.

In each case, the Web Desktop will prompt you differently for each parameter. For the most part, experimenting and experience will help you supply parameter values properly.

To respond to Web Desktop prompts for database credentials or parameter values, when viewing reports on demand, follow some simple steps:

  1. Choose a report that requires database credentials or parameter values to be supplied.

  2. Click View from the pop-up menu.

  3. The ePortfolio will prompt for database credentials and/or parameter values (depending on how the report is designed) before showing the report.

    click to expand
    click to expand
  4. Type in any necessary values for database user ID, password, and so forth. If parameter values are requested , add necessary values to customize the report for this particular view, clicking OK after each prompt.

  5. The report will be viewed with the supplied values.

    Note  

    Date or Time parameter values require adherence to a specific CE format. For example, if you wish to supply a date of January 1, 2002, you can t simply type 1/1/02 or 1/1/2002 ”an error message will appear. You must supply dates in the format Date(yyyy, m, d), including the word Date and the parentheses. So, you would specify a parameter value of January 1, 2002, as Date(2002, 1, 1). Note that a small date picker icon also appears when prompting for a date parameter. If you click this icon and specify a date in the corresponding calendar box, the proper Date(yyyy, m, d) value will be filled in for you.

Navigating the Report Viewers

When you view a report, the Web Desktop will display the report in a new browser window using the report viewer specified in Crystal Reports Preferences (discussed earlier in the chapter). The report viewer contains many features that enhance your ability to navigate through the report and perform other useful functions, such as searching the report or exporting the report to another file format. Viewer toolbars and buttons will vary, depending on the report viewer you are using. Here s an example of a report displayed in the default DHTML viewer:

click to expand

Toolbar buttons available in various report viewers consist of the following:

  • Group Tree You can turn the group tree on and off with this button. The group tree, which appears at the left of the report in the viewer, is a powerful navigation tool that shows you an outline of the grouping levels on the report and allows you to click directly to an item and display that page.

  • Export You have the option to export a report from the viewer to several different file formats, including Crystal Reports, Microsoft Excel, Microsoft Word, Rich Text Format, and Adobe Acrobat. If you are using the DHTML Viewer, the chosen format will be downloaded to your browser, much as you download a file from a web site. If you are using other viewers, a Save As dialog box will appear giving you the opportunity to save the exported file on your hard disk. You will also be able to choose a page range to export.

  • Refresh Refresh an older instance or a recent view to reflect the latest data. Note that your CE Administrator may deny you the refresh right. If you try to refresh it without this right, you will receive an error message in the browser.

  • Print Print the report currently displayed in the viewer on a printer configured on your computer. If you are using the ActiveX or Java viewers, or the ActiveX print control in one of the DHTML viewers, a print dialog box will appear where you may choose page range, number of copies, and so forth. If you are using the Acrobat PDF print option with one of the DHTML viewers, the report will be downloaded as an Acrobat .PDF file. Use the Acrobat Viewer s Print button to actually print the report.

  • Drill Down If the report has further detail supporting some of the data on the report, you may be able to drill down to the detail by clicking the summary information on the report or on a chart element (such as a pie wedge or bar). The cursor will change when it is rolled over clickable areas, just as it does when rolled over a link on a web page. When you click on a drill-down area, a drill-down page opens in the browser. You can then toggle between the main report page and any open drill-down pages by either selecting them in the current view drop-down box (in the DHTML viewers) or clicking the drill-down tab (ActiveX or Java viewers). You may also close an open drill-down page in the ActiveX or Java viewers by clicking the red X button when the drill-down page is the current view.

  • Page Navigation Click the arrow buttons to navigate to the first page, previous page, next page, or last page.

  • Go To Page Type in a specific page number and click the Go To Page button to navigate directly to that report page.

  • Find Search the report for certain text or data content. Some viewers have the search text box in the toolbar, and others prompt for the text string after you click the Find button.

  • Zoom Choose the zoom level to view the report by choosing various options from the zoom drop-down list. Choices may include percentage numbers or standard view choices, such as Page Width or Whole Page.

    Note  

    The CE administrator may turn some of the viewer standard toolbar buttons off using Web Component Server settings. If you don t see all the toolbar buttons you expect, check with the administrator to see if they have been disabled.

Using Advanced DHTML Viewer Features

Crystal Enterprise 10 gives you two DHTML viewer options when choosing a report viewer (discussed earlier in the chapter). The Advanced DHTML Viewer (known as the Interactive DHTML Viewer in Crystal Enterprise 9), while showing you a report in a pure HTML format like the regular DHTML Viewer, also includes extra sub-query features that allow you to further refine and analyze the core underlying data that makes up the report you are viewing. You can choose a subset of fields on the report, choose some additional selection criteria, and display the results in a row-and-column sub-view (which can also be exported to Word, Excel, or HTML formats).

First, ensure that the Advanced DHTML Viewer is chosen as the desired viewer in Crystal Reports Preferences (this is discussed earlier in the chapter, under Crystal Reports Preferences ). Then, view the desired report object with the View option, or the desired report instance with the View Latest Instance or History option from the Web Desktop. The report will be displayed inside the Advanced DHTML Viewer.

The Advanced DHTML Viewer looks almost identical to the regular DHTML Viewer with two exceptions: the small header at the top of the viewer that indicates you are using the advanced viewer, and the Show/Hide Advanced Search Wizard button in the viewer toolbar. The benefit of the Advanced DHTML Viewer is realized when you use the Advanced Search Wizard. Display it by clicking the extra toolbar button at the right of the viewer toolbar. The viewer will redisplay the report below the Fields tab of the wizard.

click to expand

The list of fields that make up the report will appear in the left Available Fields list. Choose one or more fields you want to appear in your sub-query (you may CTRL-click or SHIFT-click in the list to select multiple fields). Then, click the right arrow to add the chosen fields to the right Fields to Display list. You may remove any fields you later decide you don t want to include in the sub-query by selecting them in the Fields to Display list and clicking the left arrow. To reorder fields in the Fields to Display list, click the desired field and reorder it with the up or down arrows above the list. Once you ve chosen the desired set of fields, click the Conditions tab.

click to expand

The Conditions tab allows you to choose one or more fields to filter the results of your sub-query. Pick a desired field from the Field drop-down list. Then, choose one of the comparison operators from the Filter Type drop-down list and type in a comparison value in the Value text box. If you want to filter on more than one field, click the Add More Filters button. An additional filter line will be added, where you may specify an additional field, condition, and value. You will also be given the choice of an AND or OR Boolean connector between the two filters. If you decide you don t want to use a filter that you ve already added, just remove any entry from the Value text box. The filter will be ignored.

If you want to type in a manual filter expression using the Crystal Reports formula language, click the Free Form button. A text box will appear showing any existing filters you ve already supplied. You may modify the existing formula, delete it, or type in a new formula. Use standard Crystal Reports formula language syntax, as discussed in Chapters 5 and 8. If you want to redisplay the original search expert, click the Expert button. The filters will be redisplayed in the expert format (providing you haven t specified a free-form formula that is too complex for the wizard to convert to an expert display).

Once you ve specified all desired filters, click the Results tab to see the results of your sub-query. The Results tab will show the records that compose the result in a row/column format, without formatting.

click to expand

If no results are shown because of invalid filters, or you wish to add or remove fields from the sub-query, click the Fields or Conditions tab to make any desired changes. Once the query results are satisfactory, you may export them to Word, Excel, or HTML format. Note the MS Word, MS Excel, and HTML links next to the Export label above the query results. Click the desired link to download the query results in the chosen format.

Even while the Advanced Search Wizard is displayed, you may continue to view and navigate through the original report inside the viewer (this may be helpful when comparing sub-query results with the original report data). When you are finished using the wizard, just click the original toolbar button you used to display the wizard in the first place. It will close, and only the report will remain in the viewer window.

Note  

Remember that the sub-query you create with the Advanced DHTML Viewer is only being applied to the records already included in the report you are viewing. The underlying database that the report was originally based on will not be queried again. For example, if the report you are viewing is already limited to USA customers, specifying a filter on the Condition tab that searches for customers in Canada will not return any results.

Exporting and E-Mailing Reports

You may wish to save a copy of a report from the Web Desktop to your own local computer. Perhaps you wish to include it in a Word document, perform some more unique analysis in Microsoft Excel, or attach an Adobe Acrobat file to an e-mail to send to a colleague who doesn t have access to the Web Desktop. All of this can be accomplished by exporting reports from a report viewer:

  1. View the report or instance you wish to export.

  2. Click the export button in the viewer toolbar. The Export dialog box will appear (the following example is from the DHTML Viewer).

    click to expand
  3. If you are using the DHTML or Advanced DHTML Viewer, choose the desired export format from the drop-down list of formats and the page range you wish to export. Then, click OK to start downloading the report to your browser.

  4. If you are using the ActiveX or Java viewers, a dialog box will appear where you may choose the location and file name of the exported file, as well as the file format you wish to use and the page range. Make the desired choices.

  5. The file will be saved on your local hard disk.

  6. If you wish to e-mail the file to a colleague, attach the file you just downloaded to an e-mail message using typical steps to send e-mail attachments.

Printing Reports on Your Local Printer

Often, you ll want to print a full or partial copy of the report you re viewing on a locally attached printer. And, you ll most probably want it printed with the original formatting and pagination that was used when the report was designed. There are varying ways to accomplish this, depending on the report viewer you ve chosen in Crystal Reports Preferences.

If you are using the ActiveX or Java viewers, the viewer will display a Print button right in the toolbar. When you click this button, a typical Print dialog box will appear, allowing you to choose various printing options, such as page range and so forth. The report will be printed in native format on the chosen printer.

However, if you are using the DHTML or Advanced DHTML Viewer (the DHTML Viewer is the default report viewer used when first installing CE), then you need to make an additional choice about how you want reports printed. As discussed earlier in the chapter, Crystal Reports Preferences gives you two options for printing from the DHTML viewers: Adobe Acrobat format or the ActiveX print control. Adobe Acrobat format will simply download the fully paginated and formatted report in .PDF format to your browser. You may print the report from the Acrobat Reader that displays the report.

Note  

You must have the Adobe Acrobat Reader installed on your computer for this method of local printing to work. If you don t have the application installed, you will simply be prompted to save the .PDF file on disk, which won t ultimately accomplish your print requirement. Check with your Information Technology department or visit www.adobe.com to get a copy of the Acrobat Reader for your particular computer and operating system.

Crystal Enterprise 10 introduces the ActiveX print control. If you make this choice in Crystal Reports Preferences, then a small ActiveX control will be downloaded to your browser the first time you print a report from the DHTML Viewer (typically, you can only make use of ActiveX controls if you are using Microsoft Internet Explorer as your browser). You may be prompted to accept this control when it is first downloaded (or, you may be notified that it can t be downloaded if your browser s security settings prohibit ActiveX control download). Once the control is downloaded and registered, it will simply display a standard print dialog where you can specify print settings, such as page range and number of copies. The report will then be streamed to your printer with all original pagination and formatting.




Crystal Reports 10
Crystal Reports 10: The Complete Reference
ISBN: B005DI80VA
EAN: N/A
Year: 2004
Pages: 223
Authors: George Peck

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net