If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Creating a Basic Crystal Report

This topic provides step-by-step instructions for creating a basic Crystal Report that users can run from Aptify. If you already have experience using Crystal Reports, you may only need to refer to the Guidelines section below, which provides a summary of the recommendations and requirements for writing Crystal Reports for Aptify.

Guidelines

Aptify recommends that you follow these guidelines when creating Crystal Reports for Aptify:

  • Aptify strongly recommends that you use the base views in the entity definition database (typically, Aptify) as the source for Crystal Reports rather than the base tables.
  • Aptify reports are list-driven. When you run a report, the system first creates a List that contains the records from the specified view. The system then uses this List as the source for the Crystal Report. Therefore, to display the correct records in the report, you must add the vwListDetail base view as a data source for the report and link the vwListDetail.RecordID field to the ID field of the report's service.

    If you create a Crystal Report that does not include vwListDetail as a data source, the report will display all records in the service rather than only those displayed in the selected view.

  • Do not define any Record Selection filters within Crystal Reports, or attempt to create a report from a specific set of records from the selected view. Any filtering of the records should be done in the selected view.
  • Aptify provides many sample reports with the baseline Aptify product. You can use any of these reports as a starting point for your custom reports.
    • You can find a report's Crystal Reports (*.rpt) file in the C:\Program Files\Aptify 5.5 folder on a client computer that has recently run the report.
    • Alternatively, you can download the report file to your client computer's C:\Program Files\Aptify 5.5 folder by right-clicking the report's Object Repository Objects record in the Object Repository Administration dashboard and selecting Download Object from the pop-up menu.

      Concerning Aptify Web

      For Aptify Web, you must put that the Crystal Reports (*.rpt) file in the C:\Program Files\Aptify 5.0 on a client web server environment to make sure that the Cyrstal Reports works as expected.

      With the below setting in the 'Web.config' file, the Aptify Web application fetches the Crystal Reports (*.rpt) file from the C:\Program Files\Aptify 5.0 location:

      <add key="Aptify.Framework.ObjectRepository.AptifyObjectRepository.DefaultObjectCachePath" value="C:\Program Files\Aptify 5.0" />

       

       

 

  • If the entity in which the report is to be associated with has field level security enabled, the Verify on First Refresh option must be cleared under the Crystal Report Options.

Step-by-Step Instructions

The steps below provide an overview of how to create a Crystal Report for Aptify using the version of Crystal Reports included with Visual Studio. This same process is generally applicable to other versions of Crystal Reports, but you may want to refer to the documentation that came with your version of Crystal Reports for specific instructions.

The following procedure describes how to create a report that meets the minimum requirements for integrating into Aptify. It is not intended to be a substitute for the Crystal Reports user documentation provided by Business Objects.

 

  1. Design your report.
    • Determine what information you want the report to display.
    • Identify the service from which users will be able to run the report.
    • Identify which base views the report will need to access in order to retrieve all of the desired information.
    • Sketch a design layout for the new report.
       
  2. Open a new Crystal Reports project.
    • In Visual Studio, click New > Project... > Visual Basic > Crystal Reports Application and specify the project details.
      Creating a New Crystal Reports Application in VS 2008 
  3. Click OK to load the project and display the Crystal Reports Gallery dialog.
    Crystal Reports Gallery Dialog 
  4. Select the Using the Report Wizard option in the Create a New Crystal Report Document section.
  5. Select a document type in the Choose an Expert section.
    • These general instructions assume that you have selected the Standard option, as shown below. Refer to the Crystal Reports user documentation for information on creating other report types.
  6. Click OK.
    • The Data dialog appears.
       
  7. Expand the Create New Connection folder.
  8. Select the ODBC (RDO) option to open the Data Source Selection dialog.
  9. Select APTIFY from the Data Source Name list and click Next.
    • This Data Source Name (DSN) is created automatically when you run a report in Aptify. Therefore, if this DSN does not already exist, run a report in Aptify first and return to this screen to select the APTIFY DSN.
    • If you connect to multiple Aptify database servers in your development environment, you may want to check the APTIFY DSN to confirm it is linked to the correct server (from the Data Sources (ODBC) administrative tool).
      Data Source Selection Dialog
  10. Enter a user name and password that has administrative privileges for Aptify database.
    • By default, sa appears in the User ID field.
    • Alternatively, you can select the Trusted Connection option if your Windows user has administrative privileges for the Aptify database. However, for best results, Aptify recommends that you specify the sa user.
      Database Connection Information Dialog 
  11. Click Finish.
    • Aptify now appears under the ODBC (RDO) folder in the Data dialog.
      Select Base Views to Use As Data Sources 
  12. Expand Aptify > Aptify > dbo > Views.
  13. Locate vwListDetail from the list of Views and double-click it to add it to Selected Tables column.
    • You need to use vwListDetail in your report because reports in Aptify are list-based.
       
  14. Add one or more additional base views based on the design of your report. Click Next when finished.
    • Add the view for all entities that contain information that you want to display on the report.
    • For example, in the figure above, the Selected Tables column also includes vwVehicles and vwRentalAgreements. You can use these views to create a Vehicles report that includes information from related Rental Agreements.
       
  15. Click Next to continue.
    • The Link dialog appears. This dialog lets you specify how each of the views you selected should be linked together.
       
  16. Click the Clear Links button and click Yes to confirm your selection.
    • Crystal Report automatically links fields that share the same name. In general, this is not a correct assumption for Aptify entities. You must clear these default links and add the links manually.
       
  17. Rearrange the positions of the tables within the Link dialog in an order that makes sense to you given your design requirements.
    • This is not a requirement but it can make it easier to identify the links between the various tables.
    • For example, you may want to move the vwListDetail table to the far left of the window since it is the first base view that the report will access (since the members of the list identify the records to include in the report).
       
  18. Add a link between the RecordID field in vwListDetail and the ID field of the base view that corresponds to the entity for which you are creating the report. The RecordID field in a list corresponds to the ID field in the list item's service.
    1. Select RecordID in the vwListDetail table. While holding down the mouse button, drag RecordID to the ID field of another base view. Then, release the mouse button to create the link between these two fields.
    2. In the following example, the vwListDetails.RecordID is linked to vwVehicle.ID.
      Linking Base Views 
  19. Link other fields as necessary based on your report's design.
    • For example, if you want to incorporate Rental Agreement information into a Vehicles report, link vwRentalAgreements.VehicleID to vwVehicles.ID.
       
  20. When finished, click Next to continue to the Fields selection dialog.
  21. Select the fields that you want to display in the report by double-clicking a field in the Available Fields column.
    • In the figure below, five Vehicles fields and six Rental Agreements fields have been moved to the Fields to Display column. Note that you can use the up and down arrows to arrange the fields in any order.
      Selecting Fields
  22. Click Next to continue to the Grouping dialog. Create groupings as necessary, depending on the requirements of the report.
    • Refer to the Crystal Reports user documentation for information on grouping.
    • In the example figure, Rental Agreements will be grouped by a Vehicle's ID.
      Grouping Setup 
  23. Click Next to continue to the Summary dialog, if you specified any groupings. Specify summary fields as necessary, depending on the requirements of the report.
    • Refer to the Crystal Reports user documentation for information on summaries.
       
  24. Click Next to continue to the Group Sorting dialog, if you specified any groupings. Specify the group sorting as needed, depending on the requirements of the report.
    • Refer to the Crystal Reports user documentation for information on group sorting.
       
  25. Click Next to continue to the Charting dialog (if applicable) to specify a chart type to add to the report.
    • Refer to the Crystal Reports user documentation for information on charting.
       
  26. Click Next to continue to the Record Selection dialog. Do not configure any filters for this report. A View's filters in Aptify will determine which records to include in the report.
  27. Click Next to continue to the Templates dialog. Select a template for the report.
  28. Click Finish to display the report's default layout.
  29. Modify the report layout, add calculated fields, and add a report title as necessary.
    • Refer to the Crystal Reports user documentation for more information on customizing reports.
    • Use the Design tab to modify the report's layout and the Preview tab to monitor how design changes affect the report's appearance when data is added.
      Report in Design Mode
  30. If the entity in which the report is to be associated with has field level security enabled, you must turn off the Verify on First Refresh report option. If this option is left enabled, then only system administrators will be able to load this report within Aptify.
    • From the menu bar, select Crystal Reports > Reports > Report Options.
    • Clear the Verify on First Refresh option.
       
  31. Save the report to your computer or to a location on your network.

Copyright © 2014-2017 Aptify - Confidential and Proprietary