Sorry, confused... Do you mean "naming the report routine"?
Yes, that's the plan. I'm trying to clean up and centralise our reporting as part of the exercise for adding GRE. I'm very happy with the powers of TO OUTPUT foo DESTINATION bar - it's let me add a lot of simplicity. The remaining problem is two-fold.
1/ Many of our report executables only contain a single report called (imaginatively enough) report1. Therefore these executables can be serviced by a library routine which chooses the destination - it looks for a command line option and/or other environmental queues.
However there are also plenty of reporting executables which contain more than one REPORT (also it seems unimaginatively called report1, report2, etc etc :-) and these programs therefore have slightly randomised clones of the library routine, replicated as many times as necessary. I say "slightly randomised" because it seems that programmers can't avoid trying to optimise... Adding new destination choices including GRE becomes a tedious hunt for scattered code.
2/ Apart from the traditional destinations that can now be parameterised by using TO OUTPUT/DESTINATION, there's also the problem of choosing to get it rendered via the GRE
START REPORT report1 TO XML HANDLER xhandler
I can easily add this choice into the library routine, but I'm concerned about having all the logic and various calls to fgl_report_* functions cloned out to many places in the code.
So! what I'd like to do is improve the power of the library routine so that it can choose the REPORT target by name. With this I'll be able to remove all cloned code, ensure it's all uniform, and that all reports have identical powers to choose the destination (including GRE with all it's variations) simply by calling the one library routine that knows all the tricks.
As a rough plan, I'm aiming to be able to call something like
function start_report(named, sink, destin)
# sink and destin can be null implying to look for environmental cues
# ... lots of logic, possibly setting GRE options and creating a handler,
# ... or determining values for sink and destin from the environment
if gre_target then
start report named to xml handler xhandler
else
start report named to output sink destination destin
end if
This hypothetical library routine should be able to perform ALL the tasks necessary to nominate the GRE style or traditional destination for all our reports without any cloned local code. The programmers would only have to provide a REPORT and let this library routine take care of the housekeeping.
Also, retaining the traditional destinations will be essential for at least a year or three until GRE and GRW can completely take over. A total cut-over to GRE and GRW just isn't going to happen.