Skip to main content
Newcomer
May 29, 2025

How to find all cube views used in book definitions

  • May 29, 2025
  • 2 replies
  • 0 views

Hi.

I'm looking at a way to find all cube views used in book definitions.

I was thinking of exporting all xlBook files all at a time via Load/Extract but I cannot find how to do it. Is it possible?

Or would there be another way of getting that information?

Thanks!

2 replies

Expert
May 30, 2025

Books are not exported by Load/Extract; they are text files that can be stored anywhere and might not even be in OneStream. If you are sure all the Books are held in the OneStream database somewhere you can write a Business Rule that queries the FileInfo table to get a list of books that are stored in the database:

SELECT Name, FolderFullName, Description, ContentFileExtension FROM FileInfo WHERE (Name LIKE '%.xfdoc.%')

Process the returned rows and concatenate the FolderFullName and Name fields. Pass that through to BRApi.FileSystem.GetFile and read the file contents to pick out the Cube Views. 

You could skip the GetFile step and read the file contents directly from the database:

SELECT FI.Name, FI.FolderFullName, FI.Description, FI.ContentFileExtension, FC.ContentFileBytes
FROM   FileInfo AS FI INNER JOIN
             FileContents AS FC ON FI.Name = FC.Name AND FI.FolderFullName = FC.FolderFullName
WHERE (FI.Name LIKE '%.xfdoc.%')

 

jacidoyoAuthor
Newcomer
May 30, 2025

Hello Marcus,

Thanks for the answer!

I did the GetFile step and got a list of my books but I cannot see the content to search through and look for cube views used in the definition of the book.

I used an SQL Data Adapter and just ran the SQL Query. Should I have done it differently?

Thanks

Expert
May 30, 2025

Post the Business Rule script that you are using.