?
Solved

Integrate Business Objects with VB 6.0

Posted on 2003-10-24
4
Medium Priority
?
564 Views
Last Modified: 2011-04-14
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
0
Comment
Question by:dayandealwis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Accepted Solution

by:
rajaamirapu earned 1000 total points
ID: 9613147
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
 
LVL 3

Assisted Solution

by:crimper
crimper earned 1000 total points
ID: 9614427
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
 
LVL 27

Expert Comment

by:planocz
ID: 10183471
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question