Reporting on a Temorary Table (again)

I know that I’m overlooking something simple and I’ve gone through the archives trying to find my answer, but to no avial… I am trying to create a report based on a temporary table. I called the table mTempLines and it is based on the “Purchase Line” table. That table has all of the fields and keys that I need for my report. I have written code that populates the table. I’ve confirmed that’s it’s populating by doing a record count on mTempLInes after the populate. Now, I’m trying to get the data to print. I want to sort and subtotal by “No., Department Code, Project Code”. I know that I need to use the integer table for this and that I need to have the fields show in the integer body section as mTempLines.“No.”, mTempLines.“Department Code”, etc. But my question is how do I go about getting the desired records to print. Thanks for any help that you might be able to offer!! Mark Keener Automated Number Crunching Dayton, OH USA

Hi, in the Integer dataitem you should write in the OnAfterGetRecord trigger: If Number = 1 then mTempLines.find(’-’) else mTempLine.next; In the OnPreDataItem trigger you should write: mTempLine.Reset; mTempLine.setcurrentkey(); if mTempLine.count = 0 then currreport.break; integer.setrange(number, 1, mTempLine.count); Maybe this helps? Best regards Daniel

Daniel, That was exactly what I needed!!! I knew it would be simple, I was just thinking too hard to see the solution. As we say in the US, “You are the man!” Thanks again and best regards, Mark. Mark Keener Automated Number Crunching Dayton, OH USA