☰
Current Page
Main Menu
Home
Home
Editing ShowJoinAliasTextboxes
Edit
Preview
H1
H2
H3
default
Set your preferred keybinding
default
vim
emacs
markdown
Set this page's format to
AsciiDoc
Creole
Markdown
MediaWiki
Org-mode
Plain Text
RDoc
Textile
Rendering unavailable for
BibTeX
Pod
reStructuredText
Help 1
Help 1
Help 1
Help 2
Help 3
Help 4
Help 5
Help 6
Help 7
Help 8
Autosaved text is available. Click the button to restore it.
Restore Text
#ShowJoinAliasTextboxes [[_TOC_]] ##About Gets or sets the value indicating whether the join type alias text boxes should be shown on the DataSources tab (Advanced Mode). Advanced mode can be accessed by clicking "Advanced" on the DataSources tab when [[ShowDataSourcesAsCheckBoxes|/API/CodeSamples/ShowDataSourcesAsCheckBoxes]] is true, or by setting [[ShowDataSourcesAsCheckBoxes|/API/CodeSamples/ShowDataSourcesAsCheckBoxes]] to false. ##Global.asax (C♯) ```csharp //main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig { // Configure settings // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method public static void InitializeReporting() { //Check to see if we've already initialized. if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) return; AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; //Creates a connection to Microsoft SQL Server AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); AdHocSettings.ShowJoinAliasTextboxes = true; // Enable join alias text boxes HttpContext.Current.Session["ReportingInitialized"] = true; } } ``` ##Global.asax (VB.NET) ```visualbasic 'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig Public Class CustomAdHocConfig Inherits Izenda.AdHoc.DatabaseAdHocConfig 'Configure settings 'Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method Shared Sub InitializeReporting() 'Check to see if we've already initialized. If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then Return 'Initialize System AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() AdHocSettings.ShowJoinAliasTextboxes = false 'Disable join alias text boxes. By default, this is set to false. HttpContext.Current.Session("ReportingInitialized") = True End Sub End ``` ##Screenshots   ##Instruction By default, when the same table is used multiple times as joined table, Izenda differentiates them by number as below.  Using Join Alias Textbox, user can distinguish the joined tables more clearly **a.** Enable Join Alias Textbox. Refer to above [Global.asax](http://wiki.izenda.com/API/CodeSamples/ShowJoinAliasTextboxes#About) **b.** In Join Alias Textbox, enter aliases and click 'Update datasources aliases'. **c.**In FIELDS tab, the oined tables should appear as aliased as below  ## How to hardcode 'join alias' Below is a sample code that shows how to hardcode aliasing specific table names. In this sample, Aliased table names will appear in FIELDS tab once the report is saved. ```csharp public class CustomAdHocConfig : FileSystemAdHocConfig { public static void InitializeReporting() { ...} public override void PreSaveReportSet(string name, ReportSet reportSet) { //the collection of table names and the associated alias Dictionary<string, string> tableNameToAlias = new Dictionary<string, string>(); //loop through the report's set of tables foreach (JoinedTable jt in reportSet.JoinedTables) { if (!String.IsNullOrEmpty(jt.Alias)) return; if (!tableNameToAlias.ContainsKey(jt.TableName)) tableNameToAlias.Add(jt.TableName, LookupTableAlias(jt.TableName)); //Add the table and set the alias as the full name with special characters replaced } //Set all the tables in the report to have the table on the right side of the join reflect the alias of itself. foreach (JoinedTable jt in reportSet.JoinedTables) { jt.Alias = tableNameToAlias[jt.TableName]; if (!String.IsNullOrEmpty(jt.RightConditionTable)) jt.RightAlias = tableNameToAlias[jt.RightConditionTable]; } //update the selected fields and filters on the report to reflect the new aliases of the joined tables foreach (Report report in reportSet.Reports.AllValues) { foreach (Field field in report.Fields) if (field.DbColumn != null && field.DbColumn.Table != null) field.AliasTable = tableNameToAlias[field.DbColumn.Table.FullName]; foreach (Filter filter in report.Filters) if (filter.dbColumn != null && filter.dbColumn.Table != null) filter.AliasTable = tableNameToAlias[filter.dbColumn.Table.FullName]; } //update the selected filters on the entire reportSet to reflect the new aliases of the joined tables (in case of a dashboard) foreach (Filter filter in reportSet.Filters) if (filter.dbColumn != null && filter.dbColumn.Table != null) filter.AliasTable = tableNameToAlias[filter.dbColumn.Table.FullName]; } // In this case, 'Orders' table is to be aliased as 'o1','Customers' as 'c1','Order Details' as 'od1' and so on public string LookupTableAlias(string tableName) { switch (tableName) { case "[dbo].[Orders]": return "o1"; case "[dbo].[Customers]": return "c1"; case "[dbo].[Order Details]": return "od1"; case "[dbo].[Employees]": return "e1"; case "[dbo].[Suppliers]": return "s1"; default: return tableName.Replace("[", "").Replace("]", "").Replace(".", "_"); } }// End of CustomAdHocConfig class ```
Uploading file...
Header
 **This documentation is for the legacy Izenda 6 product. Documentation for the new Izenda 7 product can be found at [[https://www.izenda.com/docs/|https://www.izenda.com/docs/]]**
Sidebar
 --- * [[Izenda 7 Series Documentation|https://www.izenda.com/docs/]] * [[Release Notes]] * [[Upgrade Best Practices|FAQ/Izenda-Update-Best-Practices]] * [[FAQ]] * [[Tutorials]] * [[The Izenda API|/API/AdHocConfig]] * [[The AdHocSettings class|/API/AdHocSettings]] * [Developer Links and Guides](/Guides/Developer-Links-and-Guides) * [[Known Issues]] --- * <a href="http://www.izenda.com" rel="nofollow" target="_blank">Izenda Website</a> * [Product Video](https://www.youtube.com/watch?v=X3-yWFq0w5A) * <a href="http://www.izenda.com/blog" rel="nofollow" target="_blank">Izenda Blog</a> * <a href="http://www.izenda.com/company/" rel="nofollow" target="_blank">About Us</a> * <a href="http://www.izenda.com/contact-us/" rel="nofollow" target="_blank">Contact Us</a> --- * [Guide To Report Design](/Guides/ReportDesign) * [Making Custom Forms Video](http://www.youtube.com/watch?v=5b2axJlgdFs) --- * [[Acknowledgements]]
Edit message:
Cancel