Forum Discussion

Sweez's avatar
Sweez
Contributor
2 months ago

Export Cube View to Report Format?

Does anyone know if there is an api to export a cubeview to a report format, similar to how BRApi.CubeViews.Process.ExportCubeViewGridsToExcelFile can be used to export a cubeview to Excel via code? I want to get rid of the menu options so users can not use the normal save button but instead a custom dashboard save button. However, I need to find a way to replicate the export options that will also be removed. Thanks.

2 Replies

  • BRApi.CubeViews.Process.ExportCubeViewGridsToExcelFile returns byte, meaning you will likely be able to create file, then write it as File.WriteAllBytes.

  • sameburn's avatar
    sameburn
    Icon for OneStream Employee rankOneStream Employee

    Hi Sweez​ 

    There is another BRApi, you can use for this that behaves in the same way.  But this one relies on (a) having your CubeViews inside Report components and (b) those Report components sitting inside some real Dashboards. 

    This is the way the original (quite a long time ago) Guided Reporting worked with "Book" creation

    byte[] objBytes = BRApi.Dashboards.Process.ExportReportsForMultipleDashboards(si, isSystemLevel, custSubstVarsForAllDashboards, dashboardNamesAndVars, fileType);

    Hope this helps

    Sam