Suppressing Blank Lines in Reports Caused by Empty Fields Summary: When you print a report you may have optional fields that you only want to print when the field contains a value. This typically happens when multiple line addresses are allowed, for example. Address1, Address2. Placing the fields in the report body as follows results in a blank line when there is no data in Address2.Customer. FirstName.Customer LastName.Customer Company.Customer Address1.Customer Address2.Customer City.Customer State.Customer Zip.Customer To suppress the blank field(s) on a Custom Report, place variables with no calculations on the report and then modify the .SBP program created by the Report Designer. Note: When a report is saved in the Report Designer, two files are created for the report design: An .SBV file containing information about the objects used in the report, and the way they are laid out. An .SBP file containing the program that produces the report. Place the variables in the report body with no calculations as follows. If you want to remove extra spaces between Firstname and Lastname, you can enter the following formula for name$. TRIM$ (Firstname.Customer) + " " + Lastname.Customer name$ addr1$ addr2$ addr3$ addr4$ Below is a modified report program. The code checks for an empty field. If the field is empty, all the information is copied up one line. SUB main() CALL rptname() END SUB SUB rprtname() REPORT USING "rptname" HEADING SET REPORT PAGE "H_PAGE" OUTPUT REPORT PAGE END HEADING FOOTING 1 SET REPORT PAGE "F_PAGE" OUTPUT REPORT PAGE END FOOTING AFTER SELECT REM Initialize form variables to blank addr1$ = "":addr2$ = "":addr3$ = "":addr4$ = "" REM If the Company field contains data then make the variable addr1$ equal to Company and addr2$ REM equal to Address1. Otherwise, addr1$ is equal to Address1. (the following is one line of code) IF Company.Customer <> "" THEN addr1$ = Company.Customer : addr2$ =Address1.Customer ELSE addr1$ = Address1.Customer REM The following section of code continues to check what fields contain data and then copies the REM information into the appropriate variables. If all the fields contain data then all 4 addr$ variables REM will also contain information. If one of the fields is empty then the rest of the field information is REM copied into the first three addr$ variables and so on. IF Address2.Customer <> "" THEN IF addr2$ = "" THEN addr2$ = Address2.Customer ELSE addr3$ = Address2.Customer END IF IF addr2$ = "" THEN addr2$ = TRIM$ (City.Customer) + ", " + TRIM$ (State.Customer)+ " " + Zip.Customer ELSE IF addr3$ = "" THEN addr3$ = TRIM$ (City.Customer) + ", " + TRIM$(State.Customer) + " " + Zip.Customer ELSE IF addr4$ = "" THEN addr4$ = TRIM$ (City.Customer) + ", " +TRIM$ (State.Customer) + " " + Zip.Customer END IF END IF REM End of suppress blank line output addition SET REPORT PAGE "F_SELECT" OUTPUT REPORT PAGE END SELECT SET QUERY OFF SET QUERY LOCK OFF SELECT ; TO ASK END SUB Program: Superbase Versions: 2.0 Date: June 22, 1993 D Date: