01-10-2022 03:01 PM - last edited a week ago by JackLacava
SOURCE: ONESTREAM CHAMPIONS
Greetings for the Day.
We have a requirement to download the registers data into an Excel Book with all Account as different Sheets and that too from within one stream.
One STream table view is the best option provided to fetch the data from one stream.
The question here is we have 100+ Accounts in there, which we need to bring in the tabs, and to achieve that we need to add all tabs 1 by 1 under Spread Sheet - Table view (Refer to attached screenshot).
Is there any automatic way to append the Table view with all accounts tab names using some macro or inbuild One Stream Functions?
01-10-2022 03:02 PM
Darpan, I don’t think that Tables Views are actually your best option. You’re probably best off using an Extensibility rule to create an excel document of the exact format you desire, that way it will be flexible about the addition of accounts in the future, but give you control over the formatting of the data as necessary as well.
This is a screenshot of some example code for creating an Excel document with separate sheets for each data table in a data set. If you need more info, just let me know!
01-10-2022 03:02 PM
Oh, and you’ll need to paste this into you “Referenced Assemblies” line on the BR properties.
C:\Program Files\OneStream Software\OneStreamAppRoot\OneStreamApp\bin\DocumentFormat.OpenXml.dll; C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll
01-10-2022 03:03 PM
If a choice is given I would’ve gone with EPPlus than OpenXML. That thing is convoluted. Now, to answer your question Darpan Table View cannot do that. If and only IF books support a table view query then it was easier to do this.
For now as John mentioned you need something that can create an EXCEL file. My choice is EPPlus (it is an external dll). You could use interop however, that means you need EXCEL installed and it is slow.
01-10-2022 03:04 PM
I’ll have to check that out for sure, thanks Celvin!
06-15-2022 12:20 PM
I can see you are using Visual Studio to write rules, do you mind sharing how to write rules in visual studio I find the br editor a bit cumbersome.
06-15-2022 12:29 PM
Yeah, so the first thing is you need to get the DLLs or Assemblies for the OneStream API. I get these off the file system when I install a server, like on a VM or personal machine. Once you have those, you simply add them as references in your project, and you should get the full intellisense you need. You can't actually compile or debug rules in VS, it is just a Code Editor, not a full IDE unfortunately. But I still find a ton of value in it! Also, you can easily use Visual Studio Community, you don't need a full license for the work we do.
06-15-2022 12:34 PM - edited 06-15-2022 12:35 PM
If OneStream can com up with SDKs that would be great. Instead of us adding dlls for the rule types.
06-15-2022 12:43 PM
Agreed! And even better would be a way of hooking into a live OS environment for real time debugging 🙂
06-15-2022 12:45 PM
Got it, our organization uses a cloud instance so dont think I can access the DLLs unfortunately. But thanks for this
06-15-2022 12:49 PM
Sent you a link via PM to my personal Dropbox with the latest version of the assemblies I have
04-26-2023 08:44 AM
Hello John, Is it still possible to get those codes you wrote? I am very curious to see and use it.
04-26-2023 09:24 AM
What code exactly do you want to see? The code where I generated an Excel document based on a datatable object, using OpenXML?
04-26-2023 09:34 AM
I would like to know how to create an Excel document using a data table in BR. When I used a table view from Excel, it was too slow since the table view has too many rows and columns. Basically want to see the rest of the codes you posted.
04-26-2023 09:42 AM
Sent you the link to the file in a PM. Please let me know if you have any questions 🙂