Manual:Using Report Designer

From Winswimwiki

Jump to: navigation, search

'The objective of the Report Designer is to allow modification and creation of reports.

Contents

WinSwim Report Designer

The report designer provides the capability to make modifications to existing WinSwim reports and to create new reports. This is a tutorial for creating a report that can be inserted into WinSwim as a new report. I will walk through the steps of setting options, create a report and then change the configuration of WinSwim so the new report shows in the report menus as a custom report.

As with doing anything, finding a good example is a great first step and then just make minor changes to existing reports as a first step. I would suggest before you create a new report you would have modified an existing report to get a general understanding of what it takes to just make a font change or add a new field before tackling a new report.

Setting Options in WinSwim

Before starting using the designer you should make sure that the tables are available to create the report. Most reports created by WinSwim are based on meet entries or results. All of these are posted to the "Laneslips" table just before the report is displayed. This table is the basis for these reports and must be present to create or modify a report. There is an option in WinSwim called "Do not delete temporary files used by reports" that must be checked so that these files are not deleted and retained.

WinSwim Options

Creating a New Report

The first step is to create a new report by pressing the "File"->"New" menu to clear the designer. You will notice that the designer is still pointing to the last database opened by Winswim. In this case it is "C:\Users\Gary\Desktop\bob8\bob8.mdb".

Report Designer Cleared

Select the Database

You need to select a database to use to create the report. Right click on "Database Fields" and then select the "Add Database to Report". The "bob8.mdb" file will already be present and you just expand it and will see a list of the database tables.

Data Explorer

Select the Laneslips Table

Select down the list and select the "Laneslips" table. Then, press the "Add" button and the "Close".

Select Laneslips

Set Location

When you select a database table, Crystal Reports sets the fully qualified path to the database you are using so it can locate the table later when displayed. But, WinSwim will dynamically change the database location when it evokes the report. You must set the table location to be in the same location as the report by pressing the Same as Report button, or you could get an error message saying the table was not found. This is because the override will not take effect unless you have set the table to be in same location as report.

Set Location

View in the Visual Linking Expert

You will now see the visual linking expert where you can add additional tables to link to "Laneslips", such as, the "Meet" table containing a list of the meets. Then, press "Ok".

Visual Linking Expert

Drag Fields to Details

You then can drag fields from "Laneslips" to the detail line. These are the fields you would see for each row in the "Laneslips" table.

Report Designer

Save File

Now you can save the file using the "File->Save As" on the menu or press the diskette icon to save the file to either the application installation folder or to the "\1033\" folder under the application folder. WinSwim will initially search the application installation folder were "winswim.exe" is located before looking in the "\1033\" folder.

WinSwim Report and Label Menus

Modifying "Language.xml" File

There is a file in the "/1033/" folder under the application folder that is used to contain the list of reports and list of labels. This is used for the purpose of displaying the menus for reports and labels to choose and the processing that needs to happen for each report.

If you are changing an existing report or label and saving the .rpt file back to its original location there is no need to make any modifications to the "language.xml" file. But, if you are creating a new report or want to change the name of an existing report you can do that by making a change to this file.

Language.xml File

Adding a Custom Report

If you created a new report called "newreport.rpt", you would save the file in either the "\1033\" folder or in the application folder. Winswim searches the application folder before the "\1033\" folder for searching for the language.xml or reports, so you can replace existing reports there without overwriting the original report.

To add "newreport.rpt" to the menus, you would edit the "language.xml" file with Notepad.exe that comes with MS Windows and insert the shaded lines. The <newreport> is the DOS filename without the extension, text within the <title> nodes is the report menu and the number after <process> is the processing Winswim does to create the file used by the new report. See "Definition of the Process Steps" for more information on what number to use.

Language.xml File

After making the change to the "language.xml" file you need to then open up WinSwim and verify that you see the new menu change. There is a limit of 20 reports per section, so if you create too many new reports there will be an error displayed in the menu or the menu item will not be displayed.

Definition of the Process Steps

  • Process = 0 : Nothing happens.
  • Process = 1 : "Meetxxx_Events" is copied to "Events" where xxx is the meet number. This is used for reports on events.
  • Process = 2 : "Meetxxx" is copied to “Laneslips” where xxx is the meet number; "Meetxxx_Status" is copied to "MeetStatus". This is the typical process for most reports and labels on entries and results.
  • Process = 3 : "Meetxxx" is copied to "Laneslips" where xxx is the meet number; records with Time = 0 and Place = 0 are deleted; "Meetxxx_Status" is copied to "MeetStatus". Same as #2, but just have entries with results.
  • Process = 4 : All "Meetxxx" that are completed are merged together into "Laneslips". This is a process used for analysis of all completed meet results.
  • Process = 5 : If "MembersBest" are not present, an error is displayed. This is just a check before the report for top times is displayed.
  • Process = 6 : Same as Process = 2 and improvement of Time is calculated and put in Laneslips.Notes field. For improvement labels a calculation needs to happen to calculate the improvement. This result is put in the Laneslips.Notes field for the report to display in the label.
  • Process = 7 : Same as Process = 2 and then rows are added for empty lanes and laps.

Testing Report

Test the report by going to WinSwim and finding the new report and selecting it. If you could have previewed the report successfully in the designer, but find you get the Laneslips not found error (see below). Then, you must have not set the location of the table to be Same as Report or there's no data because there are no entries for the active meet.

Database Error

Advanced : New SQL Processing

If you really want to be advanced in changing the tables before you see the report, you can insert SQL statements into the XML file to preprocess before the report is displayed. Obviously, you have to have knowledge of the database schema for this task and by default the database is password protected. You need to contact WinSwim support by email if you want to do this.

Language.xml File