system
July 1, 2004, 6:14pm
#1
Hi all,
Is there any way to have a .bat file or something similar to upload a set of reports into the repository?
Thanks,
Schuster (BOB member since 2002-08-29)
system
July 1, 2004, 6:25pm
#2
Using VBA you acheive this kind of functionality.
What will be the location of the documents from where you wnat to upload?
JaiGupta (BOB member since 2002-09-12)
system
July 1, 2004, 7:29pm
#3
My idea was, if possible, to have a specific folder for the reports and use a .bat file to upload them. But do you think it is just possible via VBA?
Schuster (BOB member since 2002-08-29)
system
July 1, 2004, 8:27pm
#4
With a .bat file u can login to business objects. but for uploading it to corporate documents you need to use Business Objects api through VBA.
JaiGupta (BOB member since 2002-09-12)
system
July 1, 2004, 9:06pm
#5
You must go through the BusinessObjects object model in order to do this. You can’t simply push the values into the repository database, as the report files are compressed as they are stored.
Moving this to the SDK forum for further discussion. 8)
Dave Rathbun (BOB member since 2002-06-06)
system
July 15, 2004, 7:05pm
#6
Another question related to this…
I’m using the send function to do this, but I’ve seen that if I specify an inexistent category, BO just send the reports as uncategorized, is there any way to create a category?
Thanks,
Schuster (BOB member since 2002-08-29)
system
July 15, 2004, 7:07pm
#7
I’m using the send function to do this, but I’ve seen that if I specify an inexistent category, BO just send the reports as uncategorized, is there any way to create a category?
There is a flag that you can set that says “Continue on invalid category” or something to that effect. If you turn that off, you should be able to get an error and trap it.
I don’t remember if you can create categories via VBA, but that would be the possible next step. Once you created the missing category you could go back and resubmit the document.
If you can’t create categories, then I’m not sure where you go. Maybe write to a log so someone can get back to it later?
Dave Rathbun (BOB member since 2002-06-06)
system
August 18, 2004, 10:26am
#8
Hi
Were you able to publish the documents from a folder?
I am looking into doing exactly the same thing.
Any pointers?
Lee (BOB member since 2004-03-08)
system
August 18, 2004, 2:34pm
#9
All done
Used VBA and had no problems
Lee (BOB member since 2004-03-08)
system
August 18, 2004, 2:36pm
#10
If it is something you can and are willing to share, please consider uploading it to BOB’s Downloads. There are instructions (and contact info) on how to do that here:
Code samples and other downloads are posted as examples only. Be smart: be sure to understand the code before you use it in a production system. bobj-board.org is not responsible for maintaining or validating the code samples or other downloads found here, and makes no representation as to fitness for any particular purpose. Use at your own risk.
How do I get my code posted?
Post your code in the downloads category. Please include the following information with your post:
Author: (…
Dave Rathbun (BOB member since 2002-06-06)
system
September 2, 2004, 9:04am
#11
OK here it is
’ “Send to Corporate Docs”
’ lee @
’ provided “as is”, no warranty implied
’ This macro sends all reports found in a specified folder to the repository as specified
Sub RepoSend()
Const ErrNum As Integer = 1
Const OutNum As Integer = 2
Dim strCurrentFile As String
Dim docMyDocument As Document
Dim strDocPath As String ' Path to use to look for files
Dim strErrorLog As String ' Path for error log
Dim i, j, k As Integer ' loop counters
Dim x As Integer ' function result value
' Start directory list of .rep files in the standard file location. If you want to load files
' from a different directory, you would hard code the value below. Make sure that a hard-coded
' path includes the trailing back slash!
strDocPath = "C:\test\"
'strObjList = strDocPath & "ObjectsUsed.csv"
strErrorLog = strDocPath & "ObjectsUsed.log"
If FileExist(strErrorLog) Then
Kill (strErrorLog)
End If
strCurrentFile = Dir(strDocPath & "*.rep")
' Do while there are reports we have not looked at
Do While strCurrentFile <> ""
If strCurrentFile <> ThisDocument.Name & ".rep" Then
Set docMyDocument = Application.Documents.Open(strDocPath & strCurrentFile)
If docMyDocument.Name <> "" Then
'Specify the Group and catagory
docMyDocument.Send "Group", , , "Category", 1, "Domain"
End If
docMyDocument.Close
End If
' Get next document, if there is one.
strCurrentFile = Dir
Loop
ThisDocument.Activate
End Sub
'*********************************************************************
’ This subroutine is used to log entries to a specified log file. The
’ only error that is not logged here is a failure to write to the log
’ file…
'*********************************************************************
Sub LogError(ErrorString$)
Const ErrNum As Integer = 1
Const OutNum As Integer = 2
Dim strErrorLog As String
strErrorLog = Application.GetInstallDirectory(boDocumentDirectory) & “\ObjectsUsed.log”
Open strErrorLog For Append As #ErrNum
Print #ErrNum , Date; " "; Time(); " > "; ErrorString$
Close #ErrNum
End Sub ’ LogError
'*********************************************************************
’ This function is used to check for the existance of a file. It returns
’ a fake “boolean” flag using the BusinessObjects constants TRUE and FALSE.
’ If the file is found, the function returns TRUE. Otherwise, the function
’ returns FALSE.
’
’ If any file name is not found, an entry is made to the LogFile.
'*********************************************************************
Function FileExist(myFileName$)
Const ErrNum As Integer = 1
Const OutNum As Integer = 2
’ First Check to ensure that myFileName is a valid file
On Error GoTo NotFound ’ provide alternate error handling
Open myFileName$ For Input As 255 ’ attempt to open file
On Error Resume Next ’ if success, restore default error handling
Close 255 ’ close file (it was only a test, afterall)
FileExist = True
Exit Function
NotFound:
On Error Resume Next
FileExist = False
LogError (“File " & myFileName$ & " not found.”)
End Function ’ File Exist
Lee (BOB member since 2004-03-08)
system
September 2, 2004, 9:27am
#12
Is it possible to create a a .bat file to launch BO and excute this VBA Script?
It might be possible to launch BO FC from command line and specify a document as argument. And this document might trigger a call to this Script…
shamit (BOB member since 2004-07-01)
system
September 2, 2004, 1:36pm
#13
Is it possible to create a a .bat file to launch BO and excute this VBA Script?
It might be possible to launch BO FC from command line and specify a document as argument. And this document might trigger a call to this Script…
You can use command line parameters when starting busobj.exe to open a document, which could have code behind the Document_Open event. More information on the command line parameters can be found in this topic .
Dwayne Hoffpauir (BOB member since 2002-09-19)