Integrate Business Objects with VB 6.0

Hi Experts
I am using Business Objects to generate reports. My problem is, Is there any VB DLL's or ActiveX controls that i can use to create these reports programatically.

Thanx
dayandealwisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rajaamirapuCommented:
Use Business objects Libarary busobj.tlb
dim app1 as New busobj.Application

Set app1 = New busobj.Application
app1.Visible = False
app1.LoginAs "System", "manager"
Set doc = app1.Documents.Open("yourpath\yourdocumentname")

See boudgen.hlp for more info
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
crimperCommented:
Three procedures below might help get you started - these are excel based, but if you know your way round code, will be simple to modify....

Sub RunReport1()
    Dim StrStartWk As String
    Dim StrEndWk As String
    Dim strSQL As String
    Dim vnt As Variant
   
    StrStartWk = Range("PrevWeek")
    StrEndWk = Range("LastWeek")
   
    strSQL = "SELECT BRANCH.BRANCH_CODE,BRANCH.REGION_NAME,BRANCH.BRANCH_NAME, " & _
      "Time.REPORTED_WEEK , DEPARTMENT.DEPARTMENT_CODE, DEPARTMENT.DEPARTMENT_NAME, " & _
      "Sum(DEPTSALES.TAKINGSU), Sum(DEPTSALES.TAKINGSV) " & _
      "FROM BRANCH,TIME,DEPARTMENT,DEPTSALES " & _
      "WHERE ( BRANCH.BRANCH_CODE=DEPTSALES.BRANCH_CODE  ) " & _
      "AND  ( DEPTSALES.DEPT=DEPARTMENT.DEPARTMENT_CODE  ) " & _
      "AND  ( DEPTSALES.WEEK=TIME.WEEK  ) " & _
      "AND  ( TIME.REPORTED_WEEK  BETWEEN  '" & StrStartWk & "' AND '" & StrEndWk & "' " & _
      "AND  ( BRANCH.CLOSED_DATE  IS NULL  ) " & _
      "AND  DEPARTMENT.DEPARTMENT_CODE  IN  ('492','493','494','495','496') ) " & _
      "Group BY BRANCH.BRANCH_CODE,BRANCH.REGION_NAME,BRANCH.BRANCH_NAME,TIME.REPORTED_WEEK, " & _
      "DEPARTMENT.DEPARTMENT_CODE,DEPARTMENT.DEPARTMENT_NAME;"
   
    vnt = MISDataCollect(strSQL)
   
    If Not IsEmpty(vnt) Then
        Range("MIS1").Resize(UBound(vnt, 1) + 1, UBound(vnt, 2) + 1) = vnt
    End If
End Sub

'***************
'MISDataCollect
'Purpose:       Retrieves the results of a SQL statement from MIS
'               into a 2 dimensional array.
'Inputs:        SQL = SQL statement to execute
'               TimeOut = (optional) Period of time (in seconds) the
'                SQL statement should be allowed to execute before timing out.
'                If not specified 180 seconds is taken as default.
'Returns:       A 2 dimensional array of data
'***************
Public Function MISDataCollect(SQL As String, Optional TimeOut As Integer = 180) As Variant
    On Error GoTo errorHandle
    '------------------------
    Dim daoWS As DAO.Workspace
    Dim daoCn As DAO.Connection
    Dim daoRS As DAO.Recordset
   
    'Open the MIS connection
    Set daoWS = CreateWorkspace("misprd", "mars_end_user", "mars", dbUseODBC)
    Set daoCn = daoWS.OpenConnection _
          (Name:="misprd", Connect:="ODBC;DSN=misprd;UID=mars_end_user;PWD=mars", ReadOnly:=True)
    daoCn.QueryTimeout = TimeOut
   
    'Get the SQL into a recordset
    Set daoRS = daoCn.OpenRecordset(SQL)
   
    'Place the recordset into a array.
    If Not daoRS.EOF And Not daoRS.BOF Then
        MISDataCollect = Transpose(daoRS.GetRows(65000))
    End If

    daoRS.Close
    daoCn.Close
   
ExitProc:
    Set daoWS = Nothing
    Set daoCn = Nothing
    Set daoRS = Nothing
    Exit Function
   
errorHandle:
    Dim e As Integer
    e = MsgBox(Err.Number & ": " & Err.Description, vbRetryCancel)
    If e = vbCancel Then Resume ExitProc Else Resume
End Function


Public Function Transpose(vntData As Variant) As Variant
    Dim r As Long
    Dim c As Long
    Dim vnt As Variant
   
    ReDim vnt(LBound(vntData, 2) To UBound(vntData, 2), LBound(vntData, 1) To UBound(vntData, 1))

    For r = LBound(vntData, 2) To UBound(vntData, 2)
        For c = LBound(vntData, 1) To UBound(vntData, 1)
            vnt(r, c) = vntData(c, r)
        Next
    Next
     
    Transpose = vnt
End Function



Second procedure actually collects data from BusObjs - first query simply passes in SQL statement which is your query.
You can get this sql as you build a report in BusObj's.

Third procedure is simply a transposing function as I could not get excels one to work....


Hope this helps....


JP


Oh and need the Microsoft DAO 3.51 Object library in the references.

0
planoczCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
No response from dayandealwis from 10/24/2003 comment
Award points to rajaamirapu(50%) and crimper(50%) is recommend.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

planocz
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.