Forum Discussion
Hey Marcus,
I was confirmed as bug and it's supposed to be fixed in 8.2.1. Did you check the release notes? I think there is something about it.
can you share dummy BR you have the issue with and show the BR refs?
Hi Francisco
Release notes for 8.2 say this:
Workspace Assembly System.IO.Packaging.ddl: To reference the
System.IO.Packaging /access items in the System.IO.Packaging assembly within a
Workspace assembly or a business rule and compile, you will need to add the following
code to reference the System.IO.Packaging.dll from the appropriate location:
compilerParameters.ReferencedAssemblies.Add (typeof
(System.IO.Packaging.Package).Assembly.Location); (PF6-4824).
I have no idea what that means. Do you know where can I access compilerParameters from an Extender BR? I suspect the documentation is only talking about Assemblies.
I have a test BR Extender that demonstrates the error message:
Imports System
Imports System.Data
Imports System.Data.Common
Imports System.IO
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Linq
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports OneStream.Shared.Common
Imports OneStream.Shared.Wcf
Imports OneStream.Shared.Engine
Imports OneStream.Shared.Database
Imports OneStream.Stage.Engine
Imports OneStream.Stage.Database
Imports OneStream.Finance.Engine
Imports OneStream.Finance.Database
Imports DocumentFormat.OpenXml
Imports DocumentFormat.OpenXml.Packaging
Imports DocumentFormat.OpenXml.Spreadsheet
' Needs these adding to the Referenced Assemblies on the Properties tab:
' DocumentFormat.OpenXml.dll; System.IO.Packaging.dll
Namespace OneStream.BusinessRule.Extender.MHTestExcel
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object
Try
Select Case args.FunctionType
Case Is = ExtenderFunctionType.Unknown
Dim thisFileName As String = "MyFile.xlsx"
' Create a temporary file
Dim filePath As String = String.Format("{0}/{1}", Path.GetTempPath(), thisFileName)
' Create the SpreadsheetDocument object and set its type to Workbook
Using document As SpreadsheetDocument = SpreadsheetDocument.Create(filePath, SpreadsheetDocumentType.Workbook)
'Create the workbook
Dim workbookPart As WorkbookPart = document.AddWorkbookPart()
workbookPart.Workbook = New Workbook()
End Using
Case Is = ExtenderFunctionType.ExecuteDataMgmtBusinessRuleStep
Case Is = ExtenderFunctionType.ExecuteExternalDimensionSource
'Add External Members
Dim externalMembers As New List(Of NameValuePair)
externalMembers.Add(New NameValuePair("YourMember1Name","YourMember1Value"))
externalMembers.Add(New NameValuePair("YourMember2Name","YourMember2Value"))
Return externalMembers
End Select
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace
Referenced Assemblies are:
DocumentFormat.OpenXml.dll; System.IO.Packaging.dll
This is the error message:
Thanks
Marcus
- franciscoamores11 months agoContributor II
Will have a look and let you know
- gloria11 months agoNew Contributor II
Hi Marcus,
I have used your code in an assembly and included the dependencies as seen in the screenshots and I am able to compile your code in 8.2.1
I can also confirm that the release notes is just informative and confusing but not action is really required from customers in 8.2.1 where the original issue is fixed.
Let me know if this helps.
Regards
gloria
- gloria11 months agoNew Contributor II
Hi Marcus,
thank you for letting me know throw our open case that you are compiling the business from Business rules.
I can confirm that the same BR I compiled successfully from the assemblies it is not compiling when trying to do so form the Business rules section
I am doing some further investigation.
Regards
gloria