Generic Report 
Author Message
 Generic Report

Hello,

My programmer is in the process of writing a Generic Report.  By this a
mean that users will be able to choose to sent the report they are
running either directly to the printer or to the screen.

To the printer, code is already there. The one for the screen is the one
will be working on.

We have Clipper 5.2, and would like some suggestions.

We are running a report and saving it to a unique file using the
function N_FUNIQUE() from NetLib V. 6.5.

Is there any shareware *.PRG that we can use to accomplish the reading
of the file and presented to the screen?

Are you aware of any simmilar *.prg somewhere?

In advance, thank you for your cooperation.

Juan C. G.
Network Manager



Sat, 09 Sep 2000 03:00:00 GMT  
 Generic Report

Quote:

> Hello,

> My programmer is in the process of writing a Generic Report.  By this a
> mean that users will be able to choose to sent the report they are
> running either directly to the printer or to the screen.

> To the printer, code is already there. The one for the screen is the one
> will be working on.

> We have Clipper 5.2, and would like some suggestions.

> We are running a report and saving it to a unique file using the
> function N_FUNIQUE() from NetLib V. 6.5.

> Is there any shareware *.PRG that we can use to accomplish the reading
> of the file and presented to the screen?

> Are you aware of any simmilar *.prg somewhere?

> In advance, thank you for your cooperation.

> Juan C. G.
> Network Manager

Sending you an example of th way we do it.
Royce

[ Sample.prg 2K ]
  if p_out=='P' //P is for printer, S for screen output
     IF ckptr()
        old_scr:=pop_msg('Printing Report')
        SET DEVICE TO PRINTER

        rpthd120(title,pagecount)
        inv_f_colhdr(1)
        mastinv->(dbseek(name,.f.))
        DO WHILE left(mastinv->partno,2)==name










           cost_tot:=cost_tot + (mastinv->cost*mastinv->in_stock)
           sold_tot:=sold_tot+;
                     (mastinv->sold*mastinv->price*mastinv->pric_adj)
           mastinv->(dbskip(1))
           IF prow() > 56
              eject
              ++pagecount

              inv_f_colhdr(1)
           ENDIF
        ENDDO

                            TRANSFORM(cost_tot,"9,999,999.99")

                             TRANSFORM(sold_tot,"9,999,999.99")
        rep_end(title,130)
        EJECT

        SET DEVICE TO SCREEN
        pop_msg('Printing Report',old_scr)
        help_msg("Inventory Report Completed")
       ck2:=.f.
     ELSE
        err_msg('MAKE PRINTER READY, Press any key.')
     ENDIF
   lse
     SETCOLOR('N/N')
     clearto(12,15,18,66,'w/n')


             color 'w+/'+cyn

             color 'w+/'+cyn
     makeshadow(12,15,18,66)
     setcolor(cyn+'+/n,'+red+'/w,n,,w/n')
     mastinv->(dbseek(name,.f.))
     do while left(mastinv->partno,2)==name
        cost_tot:=cost_tot + (mastinv->cost*mastinv->in_stock)
        sold_tot:=sold_tot+;
                  (mastinv->sold*mastinv->price*mastinv->pric_adj)
        mastinv->(dbskip(1))
     enddo



                  color red+'/w'
     inkey(0)
     ck2:=.f.
  endif



Sun, 10 Sep 2000 03:00:00 GMT  
 Generic Report



Quote:
>Hello,

>To the printer, code is already there. The one for the screen is the one
>will be working on.

>We have Clipper 5.2, and would like some suggestions.

>We are running a report and saving it to a unique file using the
>function N_FUNIQUE() from NetLib V. 6.5.

>Is there any shareware *.PRG that we can use to accomplish the reading
>of the file and presented to the screen?

Hi Juan,

my method (of the top of my head, its been years since I've looked at
this code). My actual version uses a choice of named printers with all
relevant printer codes in a dbf setup file. Users can then add there own
printers etc and get to print to 'Accounts Dot Matrix','Sales Laser' etc
rather than LPT1, LPT2 etc

You'll see that I dont go for trying to view a text file but write it to
a DBF instead. Its easier and faster to browse on screen.

Hope it helps,

lContinue := AD_Print( AD_PRT_ON )      
DO WHILE lContinue .AND. !DBF->(EOF())
   lContinue := AD_Printer( AD_PRT_PRINT , DBF->DATA1+" "+ etc )
   DBF->(DBSKIP())
END DO
AD_Printer( AD_PRT_OFF )

FUNCTION AD_Print( nCommand , cData )
   LOCAL lContinue
   STATIC nDest,cFile

   DO CASE
      CASE nCommand == AD_PRT_ON
         nDest := PopMenu('Select Destination',;
                  {"LPT1","LPT2","Screen","File"})
         DO CASE
            CASE nDest == 1
               SET PRINTER TO LPT1
               SET CONSOLE OFF
               SET PRINTER ON
            CASE nDest == 2
               SET PRINTER TO LPT2
               SET CONSOLE OFF
               SET PRINTER ON
            CASE nDest == 3
               cFileAlias := UniqueFile()
               DBCREATE( cFile , {{"REPTEXT","C",132,9}} )
               USE (cFile) EXCLUSIVE NEW
            CASE nDest == 4
               cFileAlias := UniqueFile()
               FCREATE( cFile , "W" )
         END CASE
      CASE nCommand == AD_PRT_PRINT
         DO CASE
            CASE nDest == 1 .OR. nDest == 2
               ? cData
            CASE nDest == 3
               (cFile)->(DBAPPEND())
               (cFile)->REPTEXT := cData
            CASE nDest == 4
               FWRITE( cFile , cData )
         END CASE
      CASE nCommand == AD_PRT_OFF
         DO CASE
            CASE nDest == 1 .OR. nDest == 2
               SET PRINTER OFF
               SET CONSOLE ON
            CASE nDest == 3
               (cFile)->(DBFBrowse())
               (cFile)->(DBCLOSEAREA())
               FERASE( cFile )
            CASE nDest == 4
               FCLOSE( cFile )
         END CASE
   END CASE              
RETURN .T. // lContinue (error checking, isprinter etc etc)

--
Bill Magee - Associated Software



Thu, 14 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Extra Menu Option in Generic Report Procedure

2. FiveWin: Generic Report Engine

3. Generic Report Fromatter

4. Landscape Report to Win95 Generic Print Driver - Save as file

5. Q: generic children of generic packages?

6. (generic) child package of generic package; intantiation of

7. Non-generic children of generic packages

8. Generic using another generic instantiated elsewhere

9. Can a generic conatain another generic

10. Tagged Types as Generic Formal Parameters (was comparison in generic packages)

11. Generic PM ms_handler and generic main procedure

12. Part 1 of Short Steps Toward Generic Programming: The GENERIC keyword

 

 
Powered by phpBB® Forum Software