BusinessObjects Board

designer

Hi all,
How to get a default value as ‘ALL’ in the LOV of a prompt.?
the requirement is: when the user is running the report, the prompt should display by default the value as ‘ALL’ .
My database is oracle 9i and i am working with deski 6.5

maria


maria (BOB member since 2008-03-06)

Hi Maria,
This questions has been discussed many times.Please find the link


Rajasekar :india: (BOB member since 2004-07-16)

Hi sekar,

i have gone through the link. but still i couldn't understand. kindly explain.

i included in the sql of the object as SELECT ‘ALL’ FROM DUAL and checked the sql. The ‘ALL’ appears with the list of values but the requirement is ‘ALL’ has to appear in the prompt by default when the report is run.

maria


maria (BOB member since 2008-03-06)

Hi,
If your requirement is ALL as default in the prompt values, then you can do one thing, Refresh the report with ALL, the nsave it. and then publish, so the next time user sees it will ALL
There is no direct way to get ALL as the default value everytime. There are some VBA codes available for it. Please do a search on the Bob Downlaods forum


Omkar Paranjpe :us: (BOB member since 2006-02-13)

Hi,

Thanks for the reply. I will search for the VBA codes in forum.

maria


maria (BOB member since 2008-03-06)

If you are going to use ‘ALL’ always as default value then Omkars suggestion is the way to go or if there are random values(s) selected at one time and ‘ALL’ at other times then the below code snippet will always default to ‘ALL’ on refresh of doc.

Private Sub Document_BeforeRefresh(Cancel As Boolean) 
ThisDocument.Variables.Add("Enter Value").Value = "ALL" 
End Sub 

.


haider :es: (BOB member since 2005-07-18)

hi haider,
Yes, i want the random values(s) to be selected at one time and ‘ALL’ at other times …

The code which you have given should be written in which part. ?
Can you please help me in this?

maria


maria (BOB member since 2008-03-06)

It should be written in the report where the prompt is going to be used.
Open the report and press (Alt+F11). This will invoke the VB editor.
Click 'ThisDocument(report_name) and paste the code.
Replace the prompt text “Enter Value” with the one given in your prompt.
Refresh the report.

.


haider :es: (BOB member since 2005-07-18)

hi haider,

As i am new to this, i couldnt resolve this issue even after your instructions. pls help.In the VB Editor, i clicked the option view–> code. In the document, before refresh option was there in the right hand side. I also pasted the code but it shows invalid code. The code given was:

Private Sub Document_BeforeRefresh(Cancel As Boolean)
Default.Variables.Add(“j”).Value = “ALL”
End Sub

// default is the name of the report.// j is the prompt message

maria.


maria (BOB member since 2008-03-06)

If “default” is the name of object you have set to be the current document then it has to be declared as

Private Sub Document_BeforeRefresh(Cancel As Boolean)
Dim default As busobj.Document
Set default = ThisDocument
default.Variables.Add("j").Value = "ALL"
End Sub 

And avoid using reserved words like ‘date’ or ‘default’

.


haider :es: (BOB member since 2005-07-18)

Thank you very much haider.

maria


maria (BOB member since 2008-03-06)