User Interaction

When creating reports, overwriting certain methods, or calling the report through different ways will result in different dialogboxes and user interaction screens. A brief overview of the possibilities.

to Menu Item or not to Menu Item
When creating a plain and simple report, there is already a difference between calling it through a menu item and calling it manually (through code or in the AOT, etc). Through a menu item you will get the prompt for batch, print options, and a select button for the query. Running the report manually will give you a query screen, when pressing ok a print options screen, and next the report output.

Interactive Checkbox
In the few report properties, you will find a switch yes/no called "Interactive". Setting this to "No" will result in getting a query prompt but no print options, for both calling with or without a menu item. In the query properties, you will find exactly the same switch. In this case it allows you to disable the prompting for query values. Remember these settings for reports that need to run automatically in the background, etc.

Overwriting Methods
Several methods of the report can be overwritten to disable certain parts of the user interaction.

- fetch     : No super call will disable the query-dialog when running without a menu item, but requires a manual query execution by using the Send method to pass results to your report. - dialog    : Allows you to change the dialog used when running through a menu item. Returning null will result in no dialog but going straight to output. - prompt    : No super call will disable the print settings dialog when running without a                        menu item.

Step by Step
- Report      : Create a new report. Add all your required datasources to the report - Menu Item   : Create a new Output Menu Item for your report. - DialofFields : Declare the necessary dialog fields in the class declaration - dialog    : Override the dialog method. Add the dialog fiels to your report dialog - fetch     : Evaluate the user input

// When called ask the user if he really wants to run the report class ReportRun extends ObjectRun {  DialogField fieldRunReport;

public Object dialog(Object _dialog) {     Dialog dialog; ;     dialog = super(_dialog); fieldRunReport = dialog.addField(typeId(NoYesId),"Are your really sure ?"); return dialog; }

public boolean fetch {     boolean ret; ;     // if dialog not called from menu item the fieldRunReport points to NULL // if the field "Are your really sure" was selected continue if(fieldRunReport && fieldRunReport.value == true) {        ret = super; return ret; }     else {        return false; }  } }

Choose InventDim fields to output in report
1.	Add InventDim to main table, setup it data source:



2.	To the report Body add field group InventoryDimensions of table InventDim:

3.	To ClassDeclaration of report add lines:

public class ReportRun extends ObjectRun { ...   InventDimParm          inventDimParm; DialogRunbase         dialog; DialogGroup           dialogDimGroup; }

4.	Overload Dialog method:

public Object dialog(Object _dialog){ dialog = _dialog; dialogDimGroup  = inventDimParm.addFieldsToDialog(dialog,"@SYS53654",true); return dialog; }

5.	Create method getFromDialog:

public boolean getFromDialog{ ;   inventDimParm.getFromDialog(dialog, dialogDimGroup); return true; }

6.	Create method updateDesign:

void updateDesign{ inventDimCtrl_Rep          inventDimGenSetup_Report; ;   inventDimGenSetup_Report = inventDimCtrl_Rep::construct(element); inventDimGenSetup_Report.parmDimParmVisible(inventDimParm); inventDimGenSetup_Report.updateControls; }

7.	Overload method run:

public void run{ ;   this.updateDesign; super; }

8.	Create MenuItem of type Output with link to report. Call exectly it (else dialog will not appears).

Summary
Depending on your needs, you may need to disable certain parts of the user interaction. Hope we have got you on your way.