Reports


Reports

The big deployment question concerning reports is an architectural decision: do you include or exclude reports from your executable? Deploying reports externally from the executable gives you the ability to replace or delete an existing report, or add a new report without kicking out all the users from the application. Deploying the reports separate requires you as a developer to keep track of the report files needed in the distribution. The main reasons developers prefer to include the reports in the executable is that there is no concern of end users deleting the report files and the support issues this can raise over time. It is a trade off.

Native Visual FoxPro (FRX)

The native reports source code is stored in report metadata files (FRX/FRT). The good news is shipping a native Visual FoxPro report is simple if you are just previewing and printing. It does not matter whether they are included in the executable or shipped separately. There is nothing else to ship because the report preview and report printing capabilities are built into the Visual FoxPro runtimes .

There are some additional complications if you want to allow your users the ability to create or modify existing Visual FoxPro reports for the applications. This is not a common practice, but is definitely possible if you have sophisticated end users. The key is to include the native toolbars and report menus in the application. In Hentzenwerke Publishing ‚ s 1001 Things You Wanted To Know About Visual FoxPro (by Andy Kramek, Marcia Akins, and Rick Schummer), the authors address all the requirements to distribute the report creation capabilities in the section ‚“How to allow end users to modify report layouts ‚½ in Chapter 17, ‚“Managing Reports. ‚½ The section includes all the details so users can create new reports and edit existing reports deployed outside of the executable. The basics include deploying a FOXUSER.DBF resource file containing the three toolbars (Report Controls, Layout, and Color Palette) used with the Report Designer. The modifiable reports must be excluded from the project and deployed separately.

On The Web ‚  

We included a project called MODIREPORTS.PJX in the chapter downloads. The project and associated files are in a separate folder called MODIREPORTS, underneath the folder where you unzip the chapter examples. The executable displays a form that gives you the ability to modify an existing report or create a new report ( Figure 9 ).


Figure 9. You can add ad hoc reporting to your applications if you follow some basic steps and include the proper menu options for your users.

One more import issue with respect to native Visual FoxPro reports is the hard-coded printer information stored in the report metadata. This is more of a problem with Visual FoxPro 7 and earlier. We suggest you review the section ‚“VFP Source Code issues ‚½ in Chapter 1, ‚“Deployment Fundamentals, ‚½ for ways to address this issue.

Crystal Reports

The use of Crystal Reports as the reporting engine is becoming more prominent. Crystal Reports has been around for more than ten years and is available from Business Objects (formerly from Crystal Decisions and previously available from Seagate Software). It is recognized in the software development community (not just the Fox Community) as the most popular report creation, generation, presentation, and export tool.

Note ‚  

The Crystal Decisions Web site is at http://www.businessobjects.com . You can find plenty of information at this Web site to help determine which package of Crystal Reports fits your needs, as well as information on training and support. The site also has a complete matrix of features and highlights the editions that include the features. We have found the Web site a bit disorganized, but they do have published sales phone numbers if you cannot find enough clear information to make an informed decision.

Crystal Reports has features not supported by the Visual FoxPro Report Designer (note ‚ Visual FoxPro 9.0 is addressing some of these issues):

  • Strong preview zoom (up to 400%)

  • Data searching

  • Drill-down capability from summary to detail data

  • Sub-reports

  • Active hyperlinks

  • Integrated graphing

  • Document properties

  • Seamless data exports (Excel, Word, RTF, HTML, or PDF and retain all formatting)

  • Multi-line header bands, detail bands, and footer bands

  • Multiple lines to any section of the report and conditionally print those lines.

    Note ‚  

    Hentzenwerke has two books containing information on Crystal Reports. The first is Craig Berntson ‚ s CrysDev: A Developer's Guide to Integrating Crystal Reports and the second one is MegaFox: 1002 Things You Wanted to Know About Extending Visual FoxPro by Marcia Akins, Andy Kramek, and Rick Schummer (see Chapter 7, ‚“New and Improved Reporting ‚½)

If you design your application to run on a desktop (standalone or in the traditional LAN environment), have licensed the Developer or Advanced edition of Crystal Reports, and only run reports (to printer, preview, or export), you can distribute your reports and the appropriate components to do so royalty-free .

The problem with deploying Crystal Reports is the complicated licensing and numerous DLL files you need to ship with your application. The files necessary for a Crystal Report deployment depends entirely on the type of features you include in your applications.

This can be a complicated process, but it is all detailed in the Help files called RUNTIME.HLP and LICENSE.HLP, located in the DEVELOPER FILES\HELP directory under the Crystal Reports root directory.

The Crystal Report Engine provides a number of options for displaying the reports depending on the method. Most developers using the current recommended way of reporting deploy the Report Designer Component (CRAXDRT.DLL). If you are using one of the other methods , check the RUNTIME.HLP file for the correct DLL to deploy.

Which Crystal Reports functionality do your customers require? Which files are needed to support this functionality? The functionality is broken down into several component groupings:

  • Crystal Report Engine

  • Database access (direct access, ODBC drivers, Active Data, miscellaneous)

  • Export (destinations, format types, HTML)

  • Additional files ( charts , maps, function libraries)

  • SQL Expressions

  • User Function Libraries (pick correct files based on functions used in reports)

There are two approaches to determining which files to include in the deployment package. You can use the two Help files distributed with Crystal Reports and collect the list manually. If you are using a Windows Installer tool to create the setup package you can use the collection of Crystal Report merge modules and the Crystal Reports 8.5 or 9.0 Object Wizard (as of this writing the 10.0 merge module was not available). Lastly, you can select the different merge modules manually from the list inside of your favorite installer tool. We prefer using the InstallShield Express Crystal Report Object Wizard because it simplifies the selection process.

Note ‚  

We downloaded the Crystal Report merge modules from the InstallShield support Web site. Start with http://www.installshield.com/downloads/ , select the product you use (in our case InstallShield Express). Select the InstallShield Express Merge Module link. On the merge module page is a download for v8.0/v8.5 and v9.0. Download and install this file. Several new merge modules are available in the merge module list.

Each version of Crystal Reports has a merge module with the Object Wizard. Find the version of Crystal Reports in the merge module list. To start the wizard, right-click the merge module in the list to bring up the shortcut menu and select the Configure ‚ option.

Step 1 is the specific engine access methods ( Figure 10 ). Each choice you make depends on how you are implementing Crystal Reports inside your application. We use the Report Designer Component (RDC) to display and print our reports.


Figure 10. Step 1 ‚ Specify Engine Access Methods.

The next step is to pick the export formats (see Figure 11 ). We typically offer the Windows Comma Separated Values (CSV), Excel, HTML, Acrobat Portable Data Format (PDF), Rich Text Format (RTF), and XML for our applications.


Figure 11. Step 2 ‚ Export Formats.

The Export Destinations ( Figure 12 ) is the next step. We typically offer exporting capabilities for applications, disk, and MAPI (for email) to our clients. Options exist for Exchange Folders, Lotus Domino (Notes), and VIM if these technologies are important to your clients .


Figure 12. Step 3 ‚ Export Destinations .

The next step is Database Connections ( Figure 13 ). What you select here completely depends on the data sources your applications interact with and how you construct your reports. Our experience is with SQL Server and Visual FoxPro data. The tools we have used in the past populate the reports via ActiveX Data Objects (ADO) and ODBC via the Visual FoxPro ODBC driver. Depending on what you select, other options are automatically selected because the drivers work for multiple data sources.


Figure 13. Step 4 ‚ Database Connections.

Additional components ( Figure 14 ) provide options for charting, mapping, HTML translation, page range exporting, the Crystal Reports Print Engine (to output reports to printers), SQL expressions, and User Function Libraries.


Figure 14. Step 5 ‚ Additional Components.

The last page of the wizard ( Figure 15 ) summarizes the selections you make as you work through the numerous choices presented by the wizard.


Figure 15. Step 6 ‚ Summary.

Once you finish the Object Wizard, each of the required Crystal Report merge modules is selected (see Figure 16 ).

The wizard is not exactly what we would consider a standard wizard. It is more similar in technology to a builder. You can run the wizard again and it displays the choices you previously made. Some choices are ‚“added ‚½ to your selections because other choices you made have common DLL files and dependencies. This does not bloat your deployment package, rather it is displaying the additional features your application gets for free based on the selections you made in a previous run of the wizard.


Figure 16. The results from making selections in the Crystal Reports 8.5 Object Wizard is a number of Crystal Report merge modules being selected within InstallShield Express. The Crystal Report Object Wizard item is highlighted in the list on the right.

We still recommend you review the list of merge modules selected based on your choices in the wizard. There are no requirements that you run the wizard at all. You can make direct selection of the various merge modules if you know which ones you need to select for the deployment. For us the wizard is a great starting point and saves us time initially. We still have to revisit each of the selections and make sure the merge module is associated with the correct feature in the deployment package before building the setup.




Deploying Visual FoxPro Solutions
Deploying Visual FoxPro Solutions
ISBN: 1930919328
EAN: 2147483647
Year: 2004
Pages: 232

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