BusinessObjects Board

No Data to Fetch Message

This could be an SDK issue, but we have a reconciliation report with about 30 Dataproviders.
Some of those Dps will not return any data depending on the month they are run, but because of the message being displayed we have to stay by the PC while refreshing the document to click OK at each one of those messages.

Is there a way to suppress those message within Reporter or programmatically like the “DoCmd.SetWarnings False” in Access? This would mean that we could let the report refresh overnight.


Olivier Masse :fr: (BOB member since 2002-08-29)

Would it be practical in this case to do something like…

Public Sub MyRefresh()

    Application.Interactive = False
    ThisDocument.Refresh
    Application.Interactive = True

End Sub

…and run that macro.
Or are you able to use BCA at your site?


Steve Nicoll :uk: (BOB member since 2002-08-16)

We don’t have the BCA, so I guess I’ll be using your code.
Thanks.


Olivier Masse :fr: (BOB member since 2002-08-29)

Hi Olivier :),

There is one more way to avoid “No Data Fetch” message. Have some sort of union query which will return 1 null row of data no matter what happens to the Main Query.

The problem with going by the SDK way is if there some prompts in the Document they will not be prompted since the Interactiveness has been set to False. So you have take care of that as well.

Hope you don’t have prompts in the Document.

Sri
:wave:


Sridharan :india: (BOB member since 2002-11-08)

Hi Sri, :slight_smile:

We thought about the union query returning null, but unfortunately we have 12 reports with more than 30 Dps in them, so it would be quite a task to update every single query…

The good thing is that we don’t have any prompts, every queries return the last month data. So I have just added the following piece of code


Private Sub Document_AfterRefresh()

    Application.Interactive = True
    
End Sub

Private Sub Document_BeforeRefresh(Cancel As Boolean)

    Application.Interactive = False
    
End Sub

like Steve suggested and it works a treat.

Thanks again for your suggestions.


Olivier Masse :fr: (BOB member since 2002-08-29)

Put that on the Wish list


Andreas :de: (BOB member since 2002-06-20)

I am not very familiar with VBA Macros: I tried to implement above solution, but for whatever reason I am still getting prompted with the message “No Data to Fetch…”.

Please, can someone walk me through step by step how to setup this macro? :oops:


Andreas :de: (BOB member since 2002-06-20)

If you copy this code into the ThisDocument module, it should work. As has been stated, it not only suppresses the “No Data to Fetch…” message, but any prompts and so forth are also suppressed. It even turns off the hourglass cursor, so it can be confusing to the user.

Private Sub Document_BeforeRefresh(Cancel As Boolean)
    Application.Interactive = False
End Sub

Private Sub Document_AfterRefresh()
    Application.Interactive = True
End Sub

Note that this code is executed only when a full refresh is performed. If you run queries individually (from the query panel or Data Manager) the above events are not triggered.


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

Andreas,

To implement the little bit of code, you will need to have your Report which gives you the No Data to fetch message open.
Click on Alt + F11, and the Visual Basic Editor will open.
On the left hand side you should see a list of all the document you have open, under the name of the document which gives you the message you will see a Icon called ThisDocument: double click on it and on the main window a blank sheet should appear.

On it paste the little bit of code:

Private Sub Document_AfterRefresh() 

    Application.Interactive = True 
    
End Sub 

Private Sub Document_BeforeRefresh(Cancel As Boolean) 

    Application.Interactive = False 
    
End Sub 

Then if you refresh the document in Reporter, you shouldn’t see the message anymore…


Olivier Masse :fr: (BOB member since 2002-08-29)

It looks like in the time it took me to write my message Dwayne gave you a more detailled answer… :cry:


Olivier Masse :fr: (BOB member since 2002-08-29)

Yes, that’s happened to me before as well. You craft a nice, clear response, only to find out that someone answered before you did. Actually, you covered some things that I didn’t, as well as confirm that this approach should definitely work.


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