G'day Jim,
 
The info you have given is a little sketchy but this might help you - if you give us details of table and column names/data types then more exact assistance can be given, however, instead of FILLIN try DIALOG (I have used " instead of ' for QUOTES as that is what you have used in your posting):-
 
--Establish variables
SET VAR vFileNo TEXT
SET VAR vEndKey TEXT
SET VAR County TEXT = NULL
SET VAR vCount INT
SET VAR vInd INT
 
--Get the file number and store in vFileNo
CLS
DIALOG "Enter the file number" vFileNo vEndKey 1
 
--Check that a file number has been entered
IF vFileNo IS NULL OR vEndKey = "[Esc]" OR vEndKey = "HELP" THEN
  PAUSE 1 USING "Invalid file number - operation aborted" AT CENTER CENTER
  GOTO LEnd
ENDIF
 
--See if file number exists
SELECT COUNT(*) INTO vCount INDICATOR vInd FROM TableName +
  WHERE FileNo = .vFileNo AND LIMIT = 2
IF vCount = 0 THEN
  PAUSE 1 USING "File number does not exist - operation aborted" AT CENTER CENTER
  GOTO LEnd
ENDIF
 
--Get the value for variable County
IF vCount = 1 THEN
  SELECT CtCnty INTO County INDICATOR vInd FROM TableName +
    WHERE FileNo = .vFileNo
ELSE
  CHOOSE County FROM #VALUES FOR (FileNo & CtCnty), CtCnty FROM TableName +
    WHERE FileNo = .vFileNo TITLE "Select the location"
  IF County IS NULL OR County = "[Esc]" OR County = "HELP" THEN
    PAUSE 1 USING "Invalid value - operation aborted" AT CENTER CENTER
    GOTO LEnd
  ENDIF
ENDIF
 
--Print the file
OUTPUT PRINTER
PRINT Docket_Memo WHERE FileNo = .vFileNo and LIMIT = 1
OUTPUT SCREEN
PAUSE 1 USING "Report sent to printer" AT CENTER CENTER
 
--Label for end of operation if invalid FileNo entered
LABEL LEnd
 
--Clear variables and return to calling routine
CLEAR VAR v%, County
RETURN
 
Another way to get the file number would be through a CHOOSE command.
 
Razzak has some excellent "From the Edge" articles available from his website which will help you with programming but it might be worth your while doing a course with David Blocker which will teach you how to use much more of the power of RBase as well as database design tips.  I would also suggest that you attend one of Razzaks RBase 7.0 courses which will help you to become familiar with all the goodies in the next version of RBase - it will blow your socks off!
 
Regards
Clive Williams
CRW Services
Silverdale NSW 2752
Australia
----- Original Message -----
Sent: Sunday, February 09, 2003 2:45 PM
Subject: [RBASE-L] - Extracting values for a report

I managed to get my report going using a LISTOF command and printing the report only once by using LIMIT = 1.
 
I am now trying to come up with reports specific to print for a particular court and county to be selected based on a search of a column  which contains the word "city" or "county".  In other words, a different layout of report based on what county you are in.
 
Presently we are trying a select command like: 
FILLIN WHVAL1 "Using ....:" at 1 1
 
SELECT t1.CTCNTY INTO varname WHERE columnname = .whval1
IF CTCNTY CONT "CITY" THEN
SET VAR COUNTY  TO "CITY"
ELSE
SET VAR COUNTY TO  "COUNTY"
ENDIF
 
PRINT DOCKET_MEMO WHERE FILENO = .WHVAL1 AND LIMIT = 1
 
The report would then use the value of CTCNTY to fill in the proper "County" in on the proper report.
 
We have been unable to get beyond the SELECT statement.
 
The report works just fine if we just FILLIN a value for COUNTY before going into the report.
 
Any help?
 
 
JIM VAN DILLEN
Attorney at Law
1505 S. Big Bend Blvd.
St. Louis, MO. 63117
(314) 645-8008; Fax (314) 645-8016
 

Reply via email to