Re: report printing with d4gl on NT
Posted in 1999
> We used to print our reports by first outputting the report to a file, > so the user can either view on screen, download, or print out. > 1. to print, " lp -d printpc report.txt" You can do the same thing under NT. Only the command syntax will differ. We ported several very similar pieces of code and here is what we did: 1. Store the operating system commands to be used in a table (nice to have if you move from one op. sys. environment to another -like you are now- or if you want the same app to use the same source code in multiple op. sys. environments). 2. Then, in your program do something like: -- 06/22/1999 HMM: Use commands from loc_control. LET runline = gr_loc.loc_lp_cmd CLIPPED,prname CLIPPED," ",flname CLIPPED -- let runline = "lpr -P",prname clipped," ",flname clipped (this was the old stuff - just like yours) run runline gr_loc global record contains the following elements and values in it (in our example): loc_lp_cmd: PRINT /D: prname is the printer name that you want (have to use the full sharename of the printer if it is not local), flname is the filename that you want to print. In short, the corresponding NT command to your lp -d printpc report.txt command is: PRINT /D:\\\\computername\\printpc report.txt If printpc is a local printer on the computer running your program, then you can omit the \\\\computername... You can test this command from within a 4GL program or in a DOS command window in NT... > 2. to view "view report.txt" (view is a program we wrote in C) > If your C program is ANSI C, you can recompile for DOS/Windows and continue using it (in a DOS command window), or, better yet, instead of the PRINT /D: command, you can use the name of your favorite editor, for example NOTEPAD... > the question now is, what is the best way of doing this in an NT > Environment. We're very new to an NT setting and we were told that all > we need is to "recompile" and everything will work as is... yeah right. > Everything "almost" works as is - there is some adjusting to do, as you have found out. In case you are using the PRINT FILE statement, 2.10 has some bugs under certain circumstances. See the Dynamic 4GL newsgroup informix.idn.dynamic4gl. Hal Maner M Systems International, Inc.