Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memory or Disk buffers

Status
Not open for further replies.

Kebabmeister

Programmer
Apr 22, 2003
94
GB
Actuate 5
Oracle DB

I'm designing a report which needs to hit the DB several times for the same data. I assume that the best way to do this is to read the data into a buffer (which I have done) and then hit the buffer for subsequent report sections. I have searched the help files for instructions on how to use a buffer once it has been set up. Can anyone give me a pointer? I have looked for a method that allows me to use Fetch to bring a line from the buffer (which is how I would think this should work) but I cant find anything.
 
I am currently using Actuate version 6 so I am not sure if this works in version 5.

Start by declaring a new variable for your report. I usually call it 'gbuffDStream' and give it the following properties:

Type- AcRecordBuffer
Storage -Static
Visablity-Public

Then under your Datastream for your main report section override both your Fetch() and Start() methods with the following:

for your Fetch() method.....
--------------------------------
Function Fetch( ) As AcDataRow
Set Fetch = Super::Fetch( )
' If we have a row add it to the reusable buffer
if (not Fetch is Nothing) then
gbuffDStream.AddRowToBuffer(Fetch)
end if
End Function
--------------------------------


for your Start() method....
------------------------------------
Function Start( ) As Boolean
' Instantiate the reusable data buffer and start it up
set gbuffDStream = new AcRecordBuffer
gbuffDStream.Start()
Start = Super::Start( )
End Function
-----------------------------------


Now for subsequent report sections that you want to reuse the buffer now use the 'Disk-Based Data Row sorter' for your datastream object.

Override the 'Function NewInputAdapter()' with the following:

---------------------------------
Function NewInputAdapter( ) As AcDataAdapter
' Use the reusable buffer as input for this sub-report
gbuffDStream.Rewind( )
Set NewInputAdapter = gbuffDStream
End Function
---------------------------------

After this you will now want to add in a new 'DataRow to your 'Disk-Based Data Row sorter' for your datastream object.

After you have dropped in a new DataRow Object under your 'Disk-Based DataRow Sorter'-datastream object go back to the DataRow under your Main datastream object and 'right-click" on the main DataRow. Click on 'Slot Information and then copy the 'Name' under Contents. You will then want to go to your DataRow under your subsequent report section and do the same as above and paste the path under the slot information.

This will make your DataRow identical to your datarow in your main report section.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top