Passing Multiple table records to a report

In my main report that I print, I have defined a global variable(type Record) as temporary for the table Cost Center and another global (type record) for the table Material Class. These are tables that have code and description fields and also the field Cost. In Cost Center table it is called Labor Cost and in the Material Class table it is called Material Cost. The cost fields are not user-entered. They are used only for reporting purposes when their values are calculated and stored in temporary record variables of the tables. In the main report, as I run through records of the Job table, for each Job I run thru the corresponding Job Ledger records and accumulate the Total Cost. If the type is Resource I add the Totla Cost value to the Labor Cost field of the Cost Center table. If the type is Item, I add the Total Cost value to Material Cost field of Material Class table. The rrecord variables for Cost center and Material Class have been defined as temporary(Temporary property set to ‘Yes’). At the end of printing the main report I need to print a summary of Labor and Material costs for the entire report by cost center and Material Class. So I want to pass the temporary record variables for these two tables to another report which will zip thru these 2 tables and print the summary as follows: Labor: ------ Cost Center 1 $30.00 Cost Center 2 $40.00 … … Total Labor $70.00 Materials: ---------- Material Class 1 $25.00 Material Class 2 $50.00 … … Total Material Cost $75.00 In order to print the second summary report I need to have 2 dataitems one for Cost Center and one for Material Class. But how can I paas 2 record variables when I call the summary report from my main report? The syntax as given in Help is: REPORT.RUN(Number [, ReqWindow] [, SystemPrinter] [, Record]) Please advise. Pari Somasundaram

Create other temporary record to Cost Center, and increase values into him. At the end of the same report, create Integer item to print the second item. You can see report 107 (Customer - Order Summary) to increese values in 2 temporary records. Best regards

Pari, You can pass the variables to other objects, even temporary tables. In case with the temp tables you have to do a few extra steps. The code would look something like this: VAR Report2 : your report CLEAR(Report2); Report2.SetValues(CostCenter, Material Class); Report2.RUN; In the report2 create a function SetValues with two arguments and copy the contents into local temp tables. On After Get Record you will have to loop through your temp tables manually with NEXT. I would take Augustin’s advice and restructure your code. Another way is just too convoluted. Regards, Alex