When running the report everyone will be curious to know how long the report might run.
To track on at which level the report is processing the records we can run a progress bar in the foreground to have a better clarity of it.
Progress window can be displayed using the Open function of Dialog datatype.
Syntax:
Dialog.OPEN(String [, Variable1],...)
Few string parameters that can be considered in displaying progress bar:
1. Use a backslash (\) to start a new line.
2. Use number signs (#) to insert variable values into the string.
3. Place the number signs where you want to substitute the variable value.
4. Place a number in the part of the string where a variable value will be substituted
(Example, #1####) or (@1@@@@) to be able to reference this field for updating.
5. If you use @ characters instead of # characters, then the variable value is used as a percentage and both the percentage and a progress indicator are displayed. The percentage value that is displayed is the percentage of the variable value from 0 to 9999.
In OnPreDataItem initialze the following values.
--OnPreDataItem--
Window.OPEN('Processing data... #1################### @2@@@@@@@@@@@@@\');
NoOfRecs := COUNT;
NoOfRecsProgress := NoOfRecs DIV 100;
Counter := 0;
NoOfProgressed := 0;
TimeProgress := TIME;
In OnAfterGetRecord you can write the code(all variables of type integer except TimeProgress).
--OnAfterGetRecord--
//Do some processing
.
.
Counter := Counter + 1;
IF (Counter >= NoOfRecsProgress) OR (TIME - TimeProgress > 1000) THEN BEGIN
NoOfProgressed := NoOfProgressed + Counter;
Window.UPDATE(1,Custname); //this code will update the customer name at the control1
Window.UPDATE(2,ROUND(NoOfProgressed / NoOfRecs * 10000,1)); //this will update the progress bar
Counter := 0;
TimeProgress := TIME;
END;
--OnPostDataItem--
Window.Close;
To track on at which level the report is processing the records we can run a progress bar in the foreground to have a better clarity of it.
Progress window can be displayed using the Open function of Dialog datatype.
Syntax:
Dialog.OPEN(String [, Variable1],...)
1. Use a backslash (\) to start a new line.
2. Use number signs (#) to insert variable values into the string.
3. Place the number signs where you want to substitute the variable value.
4. Place a number in the part of the string where a variable value will be substituted
(Example, #1####) or (@1@@@@) to be able to reference this field for updating.
5. If you use @ characters instead of # characters, then the variable value is used as a percentage and both the percentage and a progress indicator are displayed. The percentage value that is displayed is the percentage of the variable value from 0 to 9999.
In OnPreDataItem initialze the following values.
--OnPreDataItem--
Window.OPEN('Processing data... #1################### @2@@@@@@@@@@@@@\');
NoOfRecs := COUNT;
NoOfRecsProgress := NoOfRecs DIV 100;
Counter := 0;
NoOfProgressed := 0;
TimeProgress := TIME;
In OnAfterGetRecord you can write the code(all variables of type integer except TimeProgress).
--OnAfterGetRecord--
//Do some processing
.
.
Counter := Counter + 1;
IF (Counter >= NoOfRecsProgress) OR (TIME - TimeProgress > 1000) THEN BEGIN
NoOfProgressed := NoOfProgressed + Counter;
Window.UPDATE(1,Custname); //this code will update the customer name at the control1
Window.UPDATE(2,ROUND(NoOfProgressed / NoOfRecs * 10000,1)); //this will update the progress bar
Counter := 0;
TimeProgress := TIME;
END;
--OnPostDataItem--
Window.Close;