1. Home
  2. Add Custom Parameters for BACKTRACK Report – Instruction Article

Add Custom Parameters for BACKTRACK Report – Instruction Article

Target Audience: Advanced users

Summary

The Report Wizard provides a very limited options to create a report in BACKTRACK. If you want to create a complex report with one or more user-specified criteria, you may find the user interface difficult to navigate. The manual (both User’s Manual and Programmer’s Manual found on the BACKTRACK User Guides page) provides limited help. This article provides instructions on how to setup a test BACKTRACK and how to then use that test system to practice adding custom parameters to a BACKTRACK report.

Prerequisites

This article assumes you:

  • Use SQL as database for BACKTRACK
  • Know the structure of BACKTRACK databases and tables
  • Possess a reasonable working understanding of SQL select statements
  • Can navigate to and use the Advanced Report Designer in BACKTRACK

Preparation

Save your current BACKTRACK and create a new one to use for practice. Restoring the original BACKTRACK file will provide you a ‘clean slate’. Only after completed this (steps below), should you attempt the instructions provided in the Instruction section below to add custom parameters. Once satisfied with the practice steps below, restore your working BACKTRACK to set custom parameters on your working report(s).

  1. Backup your current BACKTRACK database
  2. Restore the attached database to your BACKTRACK system. This is the original BACKTRACK database installed during the software installation. Click here if you do not have the original BACKTRACK sample database. 
  3. Create a new report using the Advanced Designer option. Name the report “— Report Parameters Sample
  4. In the FastReport (report writer), under data, create New Data Source (Action/New Data Source…). If you get a message “Can’t find object BackTrackDataConnection”, simply click OK.
  5. In the Data Wizard, click New Connection, select MS SQL Connection. Select the the server and enter the login for the server information. Don’t forget to check the Save my password box.. Do not select any database in the Connect to a database section. Click OK. 
  6. Set the name of the connection as Table1, click Next, Finish
  7. Expand Data Sources in the Data window and double-click Table1
  8. Click Next, Add SQL query, Next
  9. Enter Select item_no, model, manufactur from WXVG0003.dbo.item in the SQL statement window and click Next, Next, Finish
  10. Expand Data Sources, Table1, Table
  11. Drag Item_no, Model and Manufacturer to the Data band of the report
  12. Preview the report. If you’ve done everything correctly, you should see report with three columns with all the data from the Item table.

Instructions

We provide these instructions to use after preparing a ‘practice BACKTRACK’ system. Follow the prerequisites section above to create the practice BACKTRACK system. After you feel comfortable with the practices session below, restore your working BACKTRACK system and then attempt to add your custom parameters to your advanced report.

In the practice steps below, we want to create a report that only contains items from one manufacturer. We will have the report prompt the user for the manufacturer name. The report will then only include items from the selected manufacturer.

STEP 1. Create a form to prompt user for manufacturer name.

  1. Click on New Dialog button on the tool bar
  2. Change (Name), under Design section, from ComboBox1 to MFG

STEP 2. Select Items under Data section, click on the ‘‘ box next to (Collection).

    1. Enter the following text in the window (no commas, each on a separate line) – Compaq, Compsee, HP, Sharp, Shredex, Ultra. Click OK to close the window.
    2. Select Text under Data section, and delete the value “ComboBox”
    3. Test your work by previewing the report. You should see a window with a drop down box. When click on the down arrow, you should see the list of items you entered.

STEP 3. Modify the SQL statement in the report to account for the Manufacture selection

    1. Double-click on the Table under (Data Sources/Table1)
    2. Click Next, Next. This should place you in the Define parameters window
    3. Click on Add parameters
    4. Change (name) to Param1
    5. Change DataType to NVarChar
    6. Change Expression to MFG.Text (found under Dialog controls) 
    7. Click Previous
    8. Modify the SQL statement to be Select item_no, model, manufactur from WXVG0003.dbo.item where manufactur=@Param1
    9. Click Next, Next, Finish
    10. Test your work by previewing the report. Select HP from the dropdown box. The report should only contain one item. If you select Ultra, there should be 3 items in the report.

STEP 4. Restore your working BACKTRACK system.

Good luck!!!

Article# 8507

Updated on April 22, 2019

Was this article helpful?

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support