Calling R&R V9.0 from FoxPro 2.6

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Joshua_Geldman_(Guest)
Posts: 3
Joined: Tue Oct 10, 2017 12:44 pm

Calling R&R V9.0 from FoxPro 2.6

Post by Joshua_Geldman_(Guest) » Mon May 13, 2002 9:38 pm

Using R&R version 9.0 reports from FoxPro for DOS applications____If the heading to this article sounds exciting, it sure is. It means that many FoxPro for DOS applications that are considered _dying_ may get a new lease on life.____The most troubled part of an existing FoxPro for DOS application is the report printing. When using R&R for DOS version 5 (which was the last one published) you are faced with;__·_A lack of printer drivers for the new printers in the market.__·_Inability to print to a USB port printer.__·_A limitation on the number of printers you can select (eight in total) and on a network this can be quite limiting.__·_The necessity to _capture_ printer ports with NET USE LPTx command in Windows 2000 and higher.__·_Very cumbersome to use fonts.__·_Many other limitations.____The beauty is the solution in this article is the fact that you don_t have much to change in your FoxPro program. If you prompt your user for parameters before you call R&R for DOS, you will continue to do so with this solution.____How does it work? ____1._Convert your *.RP1 libraries to *.rp5 libraries. Version 9 has such a utility.__2._Open each report in R&R version 9, adjust page settings, fonts etc. and SAVE AS into an independent *.RRW report file into a selected subdirectory.__3._Ensure that the report names don_t contain the characters slash_/_ period_._ Hyphen _-_ or any other illegal character in Windows file naming conventions. (This was allowed in R&R for DOS ver 5. ____At this point you have done the R&R work. Now to the FoxPro application;____1._Add a new field to the R&R control file. (Usually called RRUNIN.DBF) named RI_PTWR size 40 and put question mark _?_ in all records.__2._Before issuing the call to R&R Version 9, Modify the following fields in the record to be printed;________·_RI_LIBRARY - put blanks (as you are not using a library anymore).__·_RI_OUTFILE - put blanks (as this is windows printing).__·_RI_PRINTER - put _?_ (to allow the user to select a printer)____Now you are going to prepare the line that issues the call to R&R version 9 .____Prepare the parameters, /d (data subdirectory), /o (the output control file usually RRUNOUT.DBF) and the control table. An example would be:____m.var1 = _RRUNIN.DBF 13 /oc:mydir runout.dbf /dc:mydirdata_____Now issue the call:_____RUN RRWRUN.EXE &var1____Don_t use FOXSWAP or /N parameters in the above line.____That_s all. If you are running the DOS application in full windows, it will be minimized automatically and the first R&R version 9 window will appear asking for SCREEN PRINTER EXPORT options. When done, pressing <enter> will return you to the FoxPro application. If your application is running in a window, you will see the R&R screen on top of that window.____In Summary____You are invoking a 32 bit R&R application from FoxPro for DOS and it works smoothly. You now have full Windows reporting capability from a DOS application without changing much in the DOS application.____No more worries about printer drivers, USB ports, Print capturing and many other DOS headaches.____Joshua@geldman.com__905-760-9835 (voice)

Post Reply