Hi friends (I'm french so X-cuse my english),
- I have a script that starts automatically Business Objects Reporter in silent mode, B.O.r. treats a list of Oracle queries included in a rep file and save results in a pdf file and so B.o.r. shuts down, all of that thanks to a magic VBS script.
- I want to have an automatisation of the process to let it turn at 1 A.M. (thanks to taskmanager).
Problem :
1) How can it answer automatically to a B.O.Reporter message box that says :
|Starting Date : ______
|Ending Date : ______
|For which service ? : ______
| [OK]
it corresponds to prompts this below inserted in queries
@prompt('Starting Date ','A',,,),'DD/MM/YYYY'
@prompt('Ending Date ','A',,,),'DD/MM/YYYY'
@variable('For which service ?')
Indeed my automation of launch / treatment of rep file rep is useless if during the opening in silent mode of the BOReporter by the vbs script it asks me the questions this above and waits for my validation on the "OK" button
2) On some queries sometimes when for the period the concerned service supplied no recording it shows me in the B.O.Reporter a dialog box
<no data found for this query "OK">
And so this dialog box waits that I confirm "OK" to pursue the other query. How to avoid these demands of validation?
In dos mode for a batch the command is /Y what is there that exists with regard to a script vbs?
Here is myscript.vbs that I use : (fichier means "file")
---------------------------------
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim Fichier,FichierParam
Set Fichier = CreateObject("Scripting.FileSystemObject")
Set FichierParam = Fichier.OpenTextFile(WScript.Arguments.Unnamed.Item(0), ForReading)
FichierLigne = FichierParam.ReadLine
FichierParam.Close
Counter = 0
NbreParam = 0
While Counter < Len(FichierLigne)
Counter = Counter + 1
If (Mid(FichierLigne,Counter,1) = ",") Then
NbreParam = NbreParam + 1
End If
Wend
Set AppBO = Wscript.CreateObject("BusinessObjects.Application")
Dim Parametres
Parametres = Split(FichierLigne,",",-1,1)
AppBO.Documents.Open Parametres(2),True,True
Set Variables = AppBO.Variables
Counter = 5
While Counter <= NbreParam
Variables.Item(Parametres(Counter)).value = Parametres(Counter+1)
Counter = Counter + 2
Wend
AppBO.ActiveDocument.Refresh
If Parametres(4) = "Print" Then
AppBO.ActiveDocument.PrintOut
AppBO.ActiveDocument.Close
AppBO.Quit
ElseIf Parametres(4) = "View" Then
AppBO.Visible = True
AppBO.Window.State = 3 ' 1=boNormal, 2=boMnimized, 3=boMaximized
AppBO.Interactive = True
ElseIf Parametres(4) = "PdfFile" Then
AppBO.ActiveDocument.SaveAs Parametres(3) , 1
AppBO.ActiveDocument.Close
AppBO.Quit
End If
Set AppBO = Nothing
Here is the command line that I use in a batch :
------------------------------------------------
myscript.vbs myvar.var
Here is the file myvar.var :
----------------------------
oracle_username,oracle_password,myrepfile.rep,mypdffile.pdf,PdfFile,CENTRE,E%
I thank you in advance for having taken time to read all this
Christophe
- I have a script that starts automatically Business Objects Reporter in silent mode, B.O.r. treats a list of Oracle queries included in a rep file and save results in a pdf file and so B.o.r. shuts down, all of that thanks to a magic VBS script.
- I want to have an automatisation of the process to let it turn at 1 A.M. (thanks to taskmanager).
Problem :
1) How can it answer automatically to a B.O.Reporter message box that says :
|Starting Date : ______
|Ending Date : ______
|For which service ? : ______
| [OK]
it corresponds to prompts this below inserted in queries
@prompt('Starting Date ','A',,,),'DD/MM/YYYY'
@prompt('Ending Date ','A',,,),'DD/MM/YYYY'
@variable('For which service ?')
Indeed my automation of launch / treatment of rep file rep is useless if during the opening in silent mode of the BOReporter by the vbs script it asks me the questions this above and waits for my validation on the "OK" button
2) On some queries sometimes when for the period the concerned service supplied no recording it shows me in the B.O.Reporter a dialog box
<no data found for this query "OK">
And so this dialog box waits that I confirm "OK" to pursue the other query. How to avoid these demands of validation?
In dos mode for a batch the command is /Y what is there that exists with regard to a script vbs?
Here is myscript.vbs that I use : (fichier means "file")
---------------------------------
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim Fichier,FichierParam
Set Fichier = CreateObject("Scripting.FileSystemObject")
Set FichierParam = Fichier.OpenTextFile(WScript.Arguments.Unnamed.Item(0), ForReading)
FichierLigne = FichierParam.ReadLine
FichierParam.Close
Counter = 0
NbreParam = 0
While Counter < Len(FichierLigne)
Counter = Counter + 1
If (Mid(FichierLigne,Counter,1) = ",") Then
NbreParam = NbreParam + 1
End If
Wend
Set AppBO = Wscript.CreateObject("BusinessObjects.Application")
Dim Parametres
Parametres = Split(FichierLigne,",",-1,1)
AppBO.Documents.Open Parametres(2),True,True
Set Variables = AppBO.Variables
Counter = 5
While Counter <= NbreParam
Variables.Item(Parametres(Counter)).value = Parametres(Counter+1)
Counter = Counter + 2
Wend
AppBO.ActiveDocument.Refresh
If Parametres(4) = "Print" Then
AppBO.ActiveDocument.PrintOut
AppBO.ActiveDocument.Close
AppBO.Quit
ElseIf Parametres(4) = "View" Then
AppBO.Visible = True
AppBO.Window.State = 3 ' 1=boNormal, 2=boMnimized, 3=boMaximized
AppBO.Interactive = True
ElseIf Parametres(4) = "PdfFile" Then
AppBO.ActiveDocument.SaveAs Parametres(3) , 1
AppBO.ActiveDocument.Close
AppBO.Quit
End If
Set AppBO = Nothing
Here is the command line that I use in a batch :
------------------------------------------------
myscript.vbs myvar.var
Here is the file myvar.var :
----------------------------
oracle_username,oracle_password,myrepfile.rep,mypdffile.pdf,PdfFile,CENTRE,E%
I thank you in advance for having taken time to read all this
Christophe