Author Topic: Report Writer and actve select list  (Read 3821 times)

bbuckley

  • Newbie
  • *
  • Posts: 1
Report Writer and actve select list
« on: November 09, 2011, 09:52:04 AM »
I have a report writer report where I need to use the proc after read to do a select. How do I specify that the select in the proc is to write to a different select list?  Currently it is clobbering the active select list from the report writer selection criteria.  I have tried using both a numbered list and a named list but neither is working.

Tom Pellitieri

  • Rock Star
  • *****
  • Posts: 224
  • Tom Pellitieri - Toledo, Ohio
Re: Report Writer and actve select list
« Reply #1 on: November 10, 2011, 03:25:59 PM »
Not sure how to control this directly through SB+.  From UniBasic (on UniData), I can do this:

OPEN "FILENAME" TO FILEVAR...
LISTVAR = ""
EXECUTE "SELECT..."
SELECT FILEVAR TO LISTVAR
LOOP WHILE READNEXT ID FROM LISTVAR DO
 (loop stuff, including other SELECTS)
REPEAT

Is there any way you can turn the select around in Report Writer?  More details would help.

For example, if the main select was for the Order file, and your PAR needs to select some of the line items, you could change it around to select all of the line items, then use the PAR to drop the ones you don't need (by setting @RTN.FLAG=1).

precisonline

  • President
  • Administrator
  • Rock Star
  • *****
  • Posts: 1612
    • Precision Solutions
Re: Report Writer and actve select list
« Reply #2 on: November 19, 2011, 02:42:27 PM »
The only way I know to do this is to create a BASIC subroutine in BASICTYPE "U" that does a select to a numbered list,like maybe 9:

EXECUTE "SELECT filename TO 9"

...followed by

LOOP
   READNEXT filename.ID FROM 9 ELSE EOF = @TRUE
UNTIL EOF DO
...
REPEAT

Of course, replace "filename" with the appropriate name of the file.
-Kevin
Accidents "happen"; success, however, is planned and executed.