Home RAP

Switch tables from RAP code with passthrough

edited February 2009 in RAP
Hi,

This is using RB 11.03, D2009 and BDE Paradox tables.

We have many reports, designed via an end user solution, which gather data
from a particular table, call it CURRENT, which is frequently also joined
with or two other tables for customer or client names, etc.

We have just implemented some changes which now leaves us with 2 further
tables, identical in structure to CURRENT, that I'll call HISTORY and
DELETED.

Given a report which references the CURRENT table, is there a good way to
ask the user whether they want to run the report against CURRENT, HISTORY or
DELETED tables and for us then to change the underlying table reference,
perhaps in code via a passthrough of whatever, to run the report against one
of those other tables instead as they so choose?

We do currently use custom created autosearch panels and a lot of pass
through functions. For ease of use, I wondered if I might be best to
generate an extra radio button panel to go at the top of the auto search
form where the user could just select one of the three tables (defaulted to
CURRENT which will be the norm).

The alternative is designing the same report 3 times for each table and it
will become a maintenance nightmare.

Thanks in advance for any suggestions and sorry for the lengthy post; I
wanted to get the situation described clearly.

Regards, Paul.

Comments

  • edited February 2009
    Hi Paul,

    Once you know which table the user would like to search on, you can easily
    change or create new autosearch criteria using the SQLBuilder class. The
    routines in this class are available in RAP and allow you easy access to the
    SQL object. Take a look at the TdaSQLBuilder topic in the RBuilder help as
    well as the link below for more information and examples.

    As far as finding out which table to use, an addition to the autosearch
    dialog would definitely work well. Also a form before the report prints
    could work as well.

    http://www.digital-metaphors.com/rbWiki/DADE/SQLBuilder

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2009
    "Nico Cizik (Digital Metaphors)" wrote in
This discussion has been closed.