Debugging Custom Reports Summary: Custom Reports are often difficult to debug. When a report is saved, the associated .SBP file that is created has several OUTPUT REPORT PAGE statements, but does not contain details about the actual report page. To better troubleshoot your reports, you need to combine the .SBP file that is generated when the report is saved with the .SBP file that is generated when the report is saved as a program. Create a report that has a mistake in it Use File|New|Report menu from Superbase or the Form Designer. Open a data file using File|Open|File. Place a field in the Body band of the report. Place a variable in the Page Header band of the report. Use the field tool, give it the variable name dater$, and assign it the calculation TODAY. Save the report by using File|Save. Name it T1F. It is automatically saved as two files with .SBP and .SBV extensions. Save the report as a program using File|Save as|Program. Name the file T1P. It is automatically saved with the .SBP extension. Run the report Go back into Superbase. Run the report using File|Open|Form/report and selecting T1F. You should get the error "Data types don't match". T1F.SBP appears in the Program Editor, and the cursor is pointing at the line REPORT USING "T1F". At this point, it is rather difficult to debug your report! Combine the code If T1F is not in the Program Editor window, open it using File|Open in the Program Editor, and selecting T1F. Position the cursor (by clicking with the mouse) so it's on the blank line between the END SUB for the main() procedure and the SUB T1F() line. Use File|Insert and select T1P to insert the code from the T1P program into the T1F program. Delete the main() procedure that is in the T1P program. Modify the SUB main(), so it reads as follows: SUB main() CALL T1P() CALL T1F() END SUB Add this line just before the END SUB line in the T1P() subroutine. SAVE REPORT "T1F" It saves the objects added to the report name T1F. 7. Safety measure: Change all references to T1F to another name, like T1. Do this by positioning the cursor at the top of the program, and using Search|Replace from the Program Editor menu. If you don't do this, you won't be able to modify T1F.SBV in the report designer; you'll get the error "Incorrect form type". 8. Save the modified program. Use File|Save as and name it T1. Run the report again Run this report using Program|Run from the Program Editor menu. You still get the error "Data types don't match", but the cursor is now pointing at the line where dater$ variable was added. Upon further investigation, you will find that TODAY is a numeric value, but dater$ is a text variable, so the data types don't match. You can fix this by changing the calculation from TODAY to DATE$(TODAY). *Please note: If you later modify the report in the report designer, you will have to repeat the above steps. Program: Superbase Versions: 2.0 Date: June 9, 1993 D Date: