RPV Reports / Usage Examples
 
Search in RpvSoftware.com
Go!                                         English    Español

What Rpv is

Rpv Reports 2024

Downloads

Training/Consultancy

Support

Purchase

Contact

 
Home > Usage Examples
Qbasic / QuickBasic
This example shows how to prepare a report using Qbasic or QuickBasic languages & RPV Reports.

The following example can be found in rpv\samples directory. The name of the file is BASICEX.BAS.

Please note that the RPV report generated by this program requires some pictures, so if you move it, probably you will have to modify the program.
Code
'HOW TO PREPARE AN RPV REPORT FROM BASIC
'THIS PROGRAM READS FROM AN ASCII TEXT FILE SEPARATED BY COMMAS
'AND BUILD AN RPV REPORT.

CLS
OPEN "PERSON.DAT" FOR INPUT AS #1
OPEN "EMPLOYEE.RPV" FOR OUTPUT AS #2

'HERE I BEGIN WITH THE CONFIG SECTION.
'PLEASE NOTE THAT LOWER OR UPPER CASE DOES NOT MATTER!!!!

PRINT #2, "report_title=Employees report (programmed in qbasic/quickbasic)"
PRINT #2, "Papersize=letter"
PRINT #2, "$a=1400"
PRINT #2, "$b=2400"
PRINT #2, "$c=5500"
PRINT #2, "spacing=250"
PRINT #2, "[header]"
PRINT #2, "{f=arial;s=16}"
PRINT #2, "{pic=rpvlogo.bmp,400,400,1400,900}"
PRINT #2, "{\n;\n;$b;c=2;b=y} Persons table report. {c=0;b=n;\n;\n;\n}"
PRINT #2, "{LINE=400,10000;\N}"
PRINT #2, "{u=n;b=n;s=10}"
PRINT #2, "[data]"

DO
'**HERE I READ THE DATA FROM PERSON.DAT FILE
INPUT #1, ID$, NAME$, ADDRESS$, PHONE$, ZIP$, MAIL$, BIRTH$, SALARY$, AREA$, SCHED$, STARTDATE$

'**DUE THE FORMAT OF THIS REPORT. I DECIDE TO CUT THE PAGE AFTER I SHOWED
'**5 RECORDS. TO DO SO, I ADD 1 TO LINESREAD

LINESREAD = LINESREAD + 1
IF LINESREAD = 6 THEN
LINESREAD = 1
PRINT #2, "{\NP}"
END IF

'**HERE I BUILD THE DATA SECTION WITH THE DATA I HAVE READ FROM
'**THE PERSON.DAT FILE. I USE ";" CHAR NOT ADD CHR(13) + CHR(10)

PRINT #2, "{PIC=" + ID$ + ".BMP,400,,700,700;S=10;$A;U=Y;B=Y}" + ID$ + "{$B}" + NAME$;
PRINT #2, "{u=n;b=n;\n;\n}"
PRINT #2, "{$a} Address: {$b}" + ADDRESS$ + " {$c} Phone: " + PHONE$ + "{\n}"
PRINT #2, "{$a} E-mail: {$b}" + MAIL$ + "{\n}"
PRINT #2, "{$a} Birth date: {$b}" + BIRTH$ + "{\n}"
PRINT #2, "{$a} Area: {$b}" + AREA$ + "{$c} Salary: " + SALARY$ + "{\N}"
PRINT #2, "{$a} Schedule: {$b}" + SCHED$ + "{$c} Start date: " + STARTDATE$ + "{\n;\n;\n}"
PRINT #2, "{LINE=400,10000;\N}"
LOOP UNTIL EOF(1)
CLOSE
'AFTER I CLOSE THE FILES I OPEN THE RPV WITH "/E" FLAG TO ALLOW EDITION OF REPORT.
SHELL "rpv.exe employee.rpv /e"

Home
What Rpv is
Rpv Reports 2024

Products
Rpv Reports 2024
Personalized edition

More...
Downloads
Support
Rpv Reports Online help
Rpv Visual Editor online help
Examples
/temp section
Videos




Copyright (c) 2001-2024 - Rpv Software. All rights reserved.