The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
Ashok
3 years agoNew Contributor III
Line Items in DataCellDetail - using BR
Hi Experts,
i am trying to read the line items from celldetails. I think i get the sytax of BR functions it compiles fine but getting
"Object reference not set to an instance of an object." erro...
- 3 years ago
I am able to do it like below in a BR.
- Execute the Method query to get the data set
- Copy data set into a datable
- use the data table to read the rows
Example code:
Dim MyDataSet As DataSet
Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si)
MyDataSet= BRApi.Database.ExecuteMethodCommand(dbConnApp,XFCommandMethodTypeId.DataCellDetail, "{AUM}{E#RevAccComments}{RevAccRecon}{T#"+Year+quarter+"}{}{}{}{}{}{}{}{}{}{}{}{UD4='"+row("Product")+"' and UD6='"+FeeType+"'}", "MyDataCellDetail", Nothing)
Dim dt As DataTable = MyDataSet.Tables("MyDataCellDetail").Copy
ChrisLoran
OneStream Employee
3 years agoCould you show a screen capture of what sort of text / "line item" information you want to retrieve, as shown in the OneStream client when you right-click on a cube view.
Do you mean Data Attachments, which is loosely what HFM used to call "line item detail"?
You also don't mention whether this needs to be done in a Finance BR, or an Extender rule ( the difference being whether we can use the Finance API methods or not ).
Assuming it is not in a Finance BR, then then you should be able to retrieve the text from the cell attachments list, like this:
Dim strMemberScript As String = String.Format("Cb#AUM:E#RevAccComments:C#Local:S#RevAccRecon:T#{0}:V#Annotation:A#MGMTFEES:F#CQ_MGMT_FEE_REV:O#Forms:I#None:U1#None:U2#None:U3#None:U4#{1}:U5#None:U6#None:U7#None:U8#None", FYQ, strU4ProdName)
Dim sbCellTexts As New Text.StringBuilder()
Dim lstAttachements As DataAttachmentList = brapi.Finance.Data.GetDataAttachments(si, strMemberScript, False)
For Each attachment As DataAttachment In lstAttachements.Items
If Attachment.Text IsNot Nothing Then
sbCellTexts.AppendLine(Attachment.Title & " / " & Attachment.Text)
End If
Next
BRApi.ErrorLog.LogMessage(si,"Retrived all the text items from cell:", sbCellTexts.ToString() )
Related Content
- 1 year ago