Last active
January 14, 2020 17:12
-
-
Save bjoerntx/4bb334f38a4205f6cb2d2092df1f8037 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void MaskDataColumnNames(dynamic data) | |
{ | |
// flatten data object in case of an array | |
if (data.GetType() == typeof(JArray)) | |
data = data[0]; | |
// find merge fields ribbon menu button | |
RibbonMenuButton ctlInsertMergeFields = | |
ribbonReportingTab1.FindItem( | |
RibbonReportingTab.RibbonItem.TXITEM_InsertMergeField) | |
as RibbonMenuButton; | |
// get the selected master table info | |
DataTableInfo dataTableInfo = | |
ribbonReportingTab1.DataSourceManager.MasterDataTableInfo; | |
// select token in data object | |
if (dataTableInfo.TableName != "RootTable") | |
{ | |
data = data.SelectToken("$.." + dataTableInfo.TableName); | |
} | |
// change the strings | |
ApplyMaskedString(ctlInsertMergeFields.DropDownItems, data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment