RE: Order By in 4GL Report
Posted in 1997
Bryan, AFAIK you are stuck with recopying the entire report block. A trick I use, if your cols are of compatible types, and the logic of the report allows it, is to swap variables passed to the report, i.e. IF something() THEN LET sql_stmt_l = "SELECT a,b,c FROM z" LET sql_stmt_l = sql_stmt_l clipped, " ORDER BY a" ELSE LET sql_stmt_l = "SELECT b,a,c FROM z" LET sql_stmt_l = sql_stmt_l clipped, " ORDER BY b" END IF ... foreach sql_curs into your_rec, output to report your_rep(your_rec, something()) end foreach and pass a flag (something...) as well so that the report know what it's reporting about HTH, Marco ____________________________________________________________________________ rem radioterapia, which I immeritately manage, seldom agrees with what I say marco greco (Catania, Italy) Work: marcog@ctonline.it rem radioterapia 39 95 447828 fax 446558 (was mar.greco@agora.stm.it) Achea 39 95 503117 --- On 7 Jan 1997 18:26:17 +1100 Bryan Tonnet <batonnet@zeta.org.au> wrote: X-POP3-Rcpt: marcog@linux Anyone know of a decent (decent = not recopying the entire report block) way to include a dynamic "order by" in a 4GL report? That is, if my report driver is; LET sql_stmt_l = "SELECT a,b,c FROM z" IF something THEN LET sql_stmt_l = sql_stmt_l clipped, " ORDER BY a" ELSE LET sql_stmt_l = sql_stmt_l clipped, " ORDER BY b" END IF ; can the report be told of a variable "order by", or am I stuck with a different report block for each possibility? Thanks in advance Bryan Tonnet batonnet@zeta.org.au -----------------End of Original Message-----------------