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
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.
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
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
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.
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
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’