发生异常类型:com.sun.star.lang.IllegalArgumentException 消息:不支持 URL <>:"from LoadEnv::startLoading"

An exception occurred Type: com.sun.star.lang.IllegalArgumentException Message: Unsupported URL <>: "from LoadEnv::startLoading"

我对来自外部表单的 LibreOffice 基础打印报告有疑问。我尝试让按钮功能打印所有报告但失败了。

Sub Reportstart(oEvent As Object)
Dim oField As Object
Dim oForm As Object
Dim oDocument As Object
Dim oDocView As Object
Dim Arg()
oField = oEvent.Source.Model
oForm = oField.Parent
sURL = oForm.DataSourceName
oDocument = StarDesktop.loadComponentFromURL(sURL, "C:\Users\Nameless\Desktop\Latest.odb", 0, Arg() )
oDocView = oDocument.CurrentController.Frame.ContainerWindow
oDocView.Visible = False
oDocument.getCurrentController().connect
Wait(100)
oDocument.ReportDocuments.getByName("report_student").open
oDocument.close(True)
End Sub

错误是由loadComponentFromURL. We can't tell you what precisely the arguments should be for your project, but here is an example from https://ask.libreoffice.org/en/question/76947/how-to-open-base-reports-based-on-queries-in-standalone/引起的:

Dim pProp(1) As New com.sun.star.beans.PropertyValue
pProp(0).Name = "ActiveConnection"
pProp(0).Value = oAConnection
pProp(1).Name = "OpenMode"
pProp(1).Value = "open"
oForm = dbForms.loadComponentFromURL(FormName, "_blank", 0, pProp())