views:

1150

answers:

1

Currently only the Table Id can be used which is meaningless as it is a number. A little bit of code example would really be great.

+2  A: 

Create a new RunBaseReport class and remember to name the SysDatabaseLog report in the lastValueElementName method.

Prompt the table name in the dialog method; use the TableName extended data type to enable lookup.

Object dialog() 
{
    DialogRunbase dlg = super();
    ;
    dialogTableName = dlg.addFieldValue(typeId(TableName),tableId2Name(tableId));      
    return dlg;  
}

Update the table id range of the queryRun.query() in the getFromDialog method after calling super(). Use the tableName2Id function to convert to table id.

boolean getFromDialog()
{
    boolean ret = super();
    ;
    tableId = tableName2Id(dialogTableName.value());
    this.queryrun().dataSourceNo(1).findRange(fieldNum(SysDatabaseLog,Table)).value(queryValue(tableId));
    return ret;
}

In the validate method, validate that table name is valid (table id not 0, table not temp etc.).

Lastly you change the output menu item to point to the class rather than the report.

Warning: code has not been tested!

Jan B. Kjeldsen
"Update the table id range of the queryRun.query() in the getFromDialog method after calling super(). Use the tableName2Id function to convert to table id."I'm a bit stuck with the above - could you clarify a bit more for me? - Thanks a lot for your help,
mm2010
Answer had been updated.
Jan B. Kjeldsen
Thanks a million - I got it working by hacking around a bit with all the help that you provided.
mm2010

related questions