BO BI 4.2 SP5 Webi-OpenDocument报表-将表格下载到Excel /通过VBA访问

时间:2018-07-04 09:58:34

标签: vba download opendocument webi

我想知道是否可以通过带有Office Access或Excel的VBA下载BO Webi OpenDocument报表。

现在,我可以登录到BO Webi并使用以下VBA代码打开所需的Webi OpenDocument报告:

登录:

enter image description here

Private Sub btnReportBO_Click()
    WebBrowser.navigate "https://xxxxxx.com/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=FjkfNFtyyg4ABJEBAABnyuNvAFBWgRcs"
End Sub

Private Sub WebBrowser_DocumentComplete(ByVal pDisp As Object, url As Variant)
With WebBrowser
    If .Document.title = "OpenDocument" Then
        .Document.all("_id0:logon:USERNAME").Value = strUsername
        .Document.all("_id0:logon:PASSWORD").Value = strPassword
        Do: Loop Until .Document.ReadyState = "complete"
        .Document.all("_id0:logon:logonButton").Click
    End If
End With
End Sub

那之后如何下载表格呢? 我失败了,因为我不知道如何访问包含表的Frame或iFrame。如果我通过右键单击-将源代码查看到桌面下载HTML源代码,则可以使用以下代码将表导出到Access:

OpenDocument Report

With WebBrowser
    If .Document.title = "" Then
        Dim x As Long
        Dim RS As DAO.Recordset
        Set RS = CurrentDb.OpenRecordset("tbl_ReportBO")
        If .Document.getElementsByTagName("table")(0).Rows(0).Cells(0).innerText = "Route" Then
            With .Document.getElementsByTagName("table")(0)
                For x = 1 To .Document.getElementsByTagName("TABLE")(0).Rows.Length - 1
                    RS.AddNew
                        RS("Route") = .Rows(x).Cells(0).innerText
                    RS.Update
                Next x
            End With
        End If
    End If
End With

如何通过VBA访问文档框架内的报告/表格? 或如何找出框架或iFrame的名称? 或如何将整个源代码下载到文本文件?

0 个答案:

没有答案