Default Home Page for Users & OS Logo is an Actionable Event
Thought this was cool and wanted to share so others have the recipe. If you build a default landing Home Page for users upon login, this is where the XML sits for that Dashboard. Then, (I was thrilled) to discover this) once you have a default Dashboard set for users, the OneStream logo is now a clickable button! It returns you to your Home Page Dashboard.2.5KViews12likes5CommentsHow To Sort Dashboard Parameters AlphaNumerically Without Specifying Sort Order - Example Code
In developing applications, I prefer to group objects intuitively using standardized naming, alphanumeric sorting, and hierarchical grouping. Dashboard parameters use the "Sort Order" property to sort, which for me adds unwanted cognitive load to a development process. I developed the code below to automatically sort and group parameters the way you would expect them to be sorted to get around the need to specify Sort Order. Implement as an extensibility rule and run it from the editor. After the rule is run, copy, paste an existing parameter, then delete the pasted parameter to force a refresh of the list from the server. Be sure to remove this code from your production applications. C# using System; using System.Data; using OneStream.Shared.Common; using OneStream.Shared.Database; using OneStream.Shared.Wcf; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Collections.Generic; namespace OneStream.BusinessRule.Extender.MSA_ParamSorter { //------------------------------------------------------------------------------------------------------------ // Reference Code: MSA Parameter Sorter [MSA_ParamSorter] // // Description: This class sorts the Dashboard Parameters for a given Workspace and Maintenance Unit // The sort is standard lexical (Lexigraphical, Dictionary) order // After running the rule, refresh the application and the workspace. // // Note: This will change all sortorder settings on your parameters for the given Maintenance Unit // (most people want this) // // Usage: Update the Workspace and Maintenance Unit strings then run from the BR Editor. // // Created By: Robb Salzmann, Mindstream Analytics // // Date Created: 6-7-2023 //------------------------------------------------------------------------------------------------------------ public class MainClass { public object Main(SessionInfo si, BRGlobals globals, object api, ExtenderArgs args) { try { var paramSort = new ParamSort(); paramSort.SortParams(si, args); } catch (Exception ex) { throw new XFException($" {ex.Message}", ex); } return null; } } // Replace the string assignments for strWorkspace and strMaintUnit as appropriate public class ParamSort { private string strWorkspace = "<YourWorkspaceName>"; // Workspace containing the Maintenance Unit below private string strMaintUnit = "<YourMaintenanceUnitName>"; // Maintenance Unit where the Parameters will be sorted public void SortParams(SessionInfo si, ExtenderArgs args) { DataTable results; string strSql = null; int intSortOrder = 10; try { Guid wsGuid = BRApi.Dashboards.Workspaces.GetWorkspaceIDFromName(si, false, strWorkspace); Guid muGuid = BRApi.Dashboards.MaintUnits.GetMaintUnit(si, false, wsGuid, strMaintUnit).UniqueID; strSql = $@"SELECT dp.name as name FROM DashboardMaintUnit dmu, DashboardParameter dp WHERE dmu.UniqueID = '{muGuid}' And dp.MaintUnitID = dmu.UniqueID"; using (DbConnInfo dbConn = BRApi.Database.CreateApplicationDbConnInfo(si)) { results = BRApi.Database.ExecuteSql(dbConn, strSql, true); List<DataRow> parameters = results.AsEnumerable().ToList(); // Sorting the parameters based on the custom logic var comparer = new AlphaNumericComparator(); var sortedParameters = parameters .OrderBy(row => row.Field<string>("name"), comparer) .ToList(); // Updating the sort order in the database foreach (var row in sortedParameters) { strSql = $"UPDATE DashboardParameter SET SortOrder={intSortOrder} WHERE name='{row["name"]}'"; BRApi.Database.ExecuteSql(dbConn, strSql, true); intSortOrder += 10; } } } catch (Exception ex) { throw new XFException($"{Environment.NewLine}{this.GetType().ToString()}.{System.Reflection.MethodBase.GetCurrentMethod().Name}(): {ex.Message}:{Environment.NewLine}{strSql}", ex); } } } public class AlphaNumericComparator : IComparer<string> { public int Compare(string x, string y) { if (x == y) return 0; string[] xParts = Regex.Split(x, @"(\d+)"); string[] yParts = Regex.Split(y, @"(\d+)"); for (int i = 0; i < Math.Min(xParts.Length, yParts.Length); i++) { if (xParts[i] != yParts[i]) { return PartCompare(xParts[i], yParts[i]); } } return xParts.Length - yParts.Length; } private static int PartCompare(string x, string y) { if (int.TryParse(x, out int a) && int.TryParse(y, out int b)) { return a.CompareTo(b); } return string.Compare(x, y, StringComparison.OrdinalIgnoreCase); } } } VB Imports System.Data Imports OneStream.Shared.Common Imports OneStream.Shared.Database Imports OneStream.Shared.Wcf Imports System.Threading.tasks Imports System.Text.RegularExpressions Namespace OneStream.BusinessRule.Extender.MSA_ParamSorter '------------------------------------------------------------------------------------------------------------ 'Reference Code: MSA Parameter Sorter [MSA_ParamSorter] ' 'Description: This class sorts the Dashboard Parameters for a given Workspace and Maintenance Unit ' The sort is standard lexical (Lexigraphical, Dictionary) order ' After running the rule, refresh the application and the workspace. ' 'Note: This will change all sortorder settings on your parameters for the given Maintenance Unit ' (most people want this) ' 'Usage: Update the Workspace and Maintenance Unit strings then run from the BR Editor. ' 'Created By: Robb Salzmann, Mindstream Analytics ' 'Date Created: 6-7-2023 '------------------------------------------------------------------------------------------------------------ Public Class MainClass Public Function Main(si As SessionInfo, globals As BRGlobals, api As Object, args As ExtenderArgs) As Object Try Dim paramSort As New ParamSort() paramSort.SortParams(si, args) Catch ex As Exception Throw New XFException($" {ex.Message}", ex) End Try Return Nothing End Function End Class ' Replace the string assignments for strWorkspace and strMaintUnit as appropriate Public Class ParamSort Private strWorkspace As String = "<YourWorkspaceName>" 'Workspace containing the Maintenance Unit below Private strMaintUnit As String = "<YourMaintenanceUnitName>" 'Maintenance Unit where the Parameters will be sorted Public Sub SortParams(si As SessionInfo, args As ExtenderArgs) Dim results As DataTable Dim strSql As String = Nothing Dim intSortOrder As Int32 = 10 Try Dim wsGuid As Guid = BRApi.Dashboards.Workspaces.GetWorkspaceIDFromName(si, False, strWorkspace) Dim muGuid As Guid = BRApi.Dashboards.MaintUnits.GetMaintUnit(si, False, wsGuid, strMaintUnit).UniqueID strSql = $"SELECT dp.name as name FROM DashboardMaintUnit dmu, DashboardParameter dp WHERE dmu.UniqueID = '{muGuid}' And dp.MaintUnitID = dmu.UniqueID" Using dbConn As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si) results = BRApi.Database.ExecuteSql(dbConn, strSql, True) Dim parameters As List(Of DataRow) = results.AsEnumerable().ToList() ' Sorting the parameters based on the custom logic Dim comparer As New AlphaNumericComparator() Dim sortedParameters = parameters _ .OrderBy(Function(row) row.Field(Of String)("name"), comparer) _ .ToList() ' Updating the sort order in the database Dim s As New List(Of String) For Each row In sortedParameters strSql = $"UPDATE DashboardParameter SET SortOrder={intSortOrder} WHERE name='{row("name")}'" BRApi.Database.ExecuteSql(dbConn, strSql, True) intSortOrder += 10 Next End Using Catch ex As Exception Throw New XFException($"{Environment.NewLine}{Me.GetType().ToString()}.{System.Reflection.MethodBase.GetCurrentMethod().Name}(): {ex.Message}:{Environment.NewLine}{strSql}", ex) End Try End Sub End Class Public Class AlphaNumericComparator Implements IComparer(Of String) Public Function Compare(x As String, y As String) As Integer Implements IComparer(Of String).Compare If x = y Then Return 0 Dim xParts As String() = Regex.Split(x, "(\d+)") Dim yParts As String() = Regex.Split(y, "(\d+)") For i As Integer = 0 To Math.Min(xParts.Length, yParts.Length) - 1 If xParts(i) <> yParts(i) Then Return PartCompare(xParts(i), yParts(i)) End If Next Return xParts.Length - yParts.Length End Function Private Shared Function PartCompare(x As String, y As String) As Integer Dim a, b As Integer Dim isNumericX As Boolean = Integer.TryParse(x, a) Dim isNumericY As Boolean = Integer.TryParse(y, b) If isNumericX AndAlso isNumericY Then Return a.CompareTo(b) Return String.Compare(x, y, StringComparison.OrdinalIgnoreCase) End Function End Class End Namespace2.2KViews6likes8CommentsHow to assign images to Tree View nodes when not using the Default Workspace
I have a dashboard that uses a Tree View. Its in a named workspace. The only way I can get images to work with it is to upload the images to a Default Workspace. Is there a way to reference my images in the workspace where the Tree View is?2.4KViews5likes6CommentsError Message: 'GridItemThemeKeyExtension_DefaultBackgroundColor_OneStreamBlue' resource not found.
Users have been receiving the following error when trying to access various dashboards: "'GridItemThemeKeyExtension_DefaultBackgroundColor_OneStreamBlue' resource not found." The error has occurred for multiple users on multiple dashboards, within Production and Sandbox. We have found that the error does not reappear if the user logs out of OneStream and completely closes the application before logging back in and attempting to access the dashboard again. Has anyone else seen this error before and been able to determine the root cause?2KViews4likes4CommentsOneStream UI - Dark mode
Hi, since I am used to set many of the programs I use during my working day to dark mode, I was wondering if it is possible to turn the dark mode on for OneStream, and if that's not possible, is it something OneStream plans to introduce in future? Thank youSolved2.5KViews2likes3CommentsHow To Trigger Dashboard Refresh from SQLTableEditor Save Data Server Task (Save button)
The SQLTableEditor in question is used for user interactive CRUD pertaining to Rates used in a calculation. Use Case: I have a SQLTableEditor that holds rates. When the table Save button is clicked, A BR saves the rates and runs a calculation. The results of the calculation are displayed in an adjacent dashboard containing a DataGrid. The DataGrid needs to be refreshed after the Save button is clicked. Question: How do I configure the SQLTableEditor to refresh the adjacent dashboard on clicking the Save Button, in a way similar to configuring the "Save Action" of other components?Solved6.7KViews2likes12CommentsCustom Coloring in Dashboards
Creating a post for custom coloring in dashboards. For example, Onestream's dashboard selections give the option for custom color, however, it does not let you select it in the formatting. It only shows the option for #FF00000 (at least from what I have seen). The above format is HTML coloring codes that can be manually updated in the display format Typically when matching client colors I am given RGB color codes, So I use the below converter to get the HTML code and add #FF to the beginning of the provided hex code. https://www.w3schools.com/colors/colors_converter.aspSolved2.1KViews2likes2CommentsSearch for member usage in cube views
Hello, Could you tell me if there is a way to search in which cube views a certain member is used/referenced ? I thought of doing a export of XML and do a search in notepad++ but maybe there is a better way/more user friendly for administrators which are not technical (which is the case for my current client) Thank you MatthieuSolved1.3KViews1like5CommentsAddin Excel - Switch between applications
Hi all, With the version 7 and above the switch between applications with the addin Excel requires to log off and log on. You cannot switch applications and stay connected. Admin team have to switch often between applications and this new mechanism is seen as a step backwards. Is it possible to restore the previous mechanism with the functionality: Change Application Thanks504Views1like1Comment