Document_Activate and Document_Open

Hi,
Are the document_open and document_activate events invoked when a report is scheduled on the BCA?

Actually I want to do 3 things :
  1. I am saving the report in structure mode and scheduling it. What I
    want is that when the user opens the report the report automatically
    comes out of view mode and goes into data mode.
  2. After the report has finished running on the BCA it should be saved
    with a different name and then published back to the repository.

I know the code statements that I have to use but I do not know the appropriate location where they should be put.

I was thinking of putting the code for save and publish in the after_refresh event and the structure mode code in document_activate event. But this I can do only if the document_activate event does not get invokes on the BCA.

Can someone please tell me the appropriate loactions for these codes?

Akshay


akshay :india: (BOB member since 2004-02-05)

As per the forum descriptions, utomation questions go in the SDK forum, so I moved your topic. 8)


Dave Rathbun :us: (BOB member since 2002-06-06)

I’m sure the activate event is “fired” on BCA just like on a workstation. Regardless though, I would think open is appropriate for your need. Activate happens EVERY time a document is brought to the foreground, and it is RARE that you want VBA code to run that often (like just toggling between reports). On BCA there is no interaction, so activate would happen only once, but I still think I’d play it safe and put your code behind open.

I have a bigger question though. Why are you saving reports in structure mode? I can only assume it is a performance thing (recalc time) right? We solve this by having a cover sheet (no calculations at all) as the first tab.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Hi,
I put the code for toggling betwen stucture mode in the activate event and used a cheat flag.
And the saveas and publish code in a procedure which is called at the end of the refresh.
Actually the report has lot of variables and therfore after I dynamically add or remove conditions from the datprovider it computes all the variables which takes lot of time.
So i save it in structure mod and run it and then when the user open the report i.e. activates it switch out of structure mode.
What is cover sheet? Does it mean that there is a empty report as active on the document and the other tab is the actual report. Will this also avoid computing the variables? But then the user will have unnecassarily 2 tabs on the document, is’nt it?

Akshay


akshay :india: (BOB member since 2004-02-05)

It is an extra tab, but not exactly empty. It contains text only information like standard report name, version number, special instructions for the user. The document is saved with that cover sheet active, and it does avoid the computing of variables when the document is opened. BusObj only calculates variables when you switch to the tab.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)