☰
Current Page
Main Menu
Home
Home
Editing Security-Basics
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
#Section 3 - Security Basics [[_TOC_]] ##Introduction The following example shows a basic example of security utilizing a combination of AdHocSettings. ##Code Sample ```csharp [Serializable] public class CustomAdHocConfig : DatabaseAdHocConfig { public static void InitializeReporting() { if (AdHocContext.Initialized) { return; } //Your Licence Key AdHocSettings.LicenseKey = "Enter Key"; //Datasource of the DB where the Data sources are stored AdHocSettings.SqlServerConnectionString = @"DBconnectionString;"; AdHocSettings.AdHocConfig = new CustomAdHocConfig(); AdHocSettings.GenerateThumbnails = true; AdHocSettings.ShowSimpleModeViewer = true; AdHocSettings.IdentifiersRegex = "^.*[iI][Dd]$"; AdHocSettings.TabsCssUrl = "/Resources/css/tabs.css"; AdHocSettings.ReportCssUrl = "../Resources/css/Report.css"; AdHocSettings.ShowBetweenDateCalendar = true; AdHocSettings.ReportViewer = "ReportViewer"; AdHocSettings.InstantReport = "InstantReport"; AdHocSettings.ReportDesignerUrl = "ReportDesigner"; AdHocSettings.ReportList = "ReportList"; AdHocSettings.SettingsPageUrl = "Settings"; AdHocSettings.ParentSettingsUrl = "Settings"; AdHocSettings.ResponseServer = "rs.aspx"; AdHocSettings.ReportsPath = Path.Combine(HttpContext.Current.Server.MapPath("~/"), "Reports"); AdHocSettings.ChartingEngine = ChartingEngine.HtmlChart; AdHocSettings.ShowModifiedReportMessage = false; AdHocSettings.DashboardViewer = "Dash"; AdHocSettings.DashboardDesignerUrl = "Dash"; AdHocSettings.DashboardDateSliderMode = DashboardDateSliderMode.None; AdHocSettings.ShowJoinDropDown = true; AdHocSettings.InstantReport = "InstantReportNew"; //EOPDF uses a DLL that converts HTML //AdHocSettings.PdfPrintMode = PdfMode.EOPDF; //PhantomJS PDF uses an EXE on the web server that produces the export AdHocSettings.PdfPrintMode = PdfMode.PhantomJs; //Asserts that the AdhocSettings.CurrentUserName is not null or the default value //If it is an unaccepted value, the user will be navigated to the specified login page AdHocSettings.RequireLogin = true; //Specifies the login page AdHocSettings.LoginUrl = "yourLoginPage.aspx"; //the default mode for AdHocSettings.CurrentUserIsAdmin is set to TRUE //You must set it to FALSE for share-with values to take effect AdHocSettings.CurrentUserIsAdmin = false; //Get username from session value that was set on Log-in page AdHocSettings.CurrentUserName = HttpContext.Current.Session["UserName"]; //Set which datasources the user can view //In this case we are pulling all tables, views and procedures DataSet ds = AdHocContext.Driver.GetDataSet(AdHocContext.Driver.CreateCommand("select * from sys.objects where type in ('U','P','V')")); string[] shownTables = new string[ds.Tables[0].Rows.Count]; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) shownTables[i] = ds.Tables[0].Rows[i][0].ToString(); AdHocSettings.VisibleDataSources = shownTables; AdHocContext.Initialized = true; } } ```
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
 --- * [[Installing Izenda on Windows Server|http://wiki.izenda.com/Guides/Installing-Izenda]] * [[Installing Izenda on Mac|/Guides/Mac-Install]] * [[Connecting to the Database|/Integration/Tutorials/connect-to-the-database]] * [[User Guides|http://wiki.izenda.com/Guides/ReportDesign]] * [[Developer Guides|Guides/Developer Links and Guides]] --- * [Izenda Website](http://www.izenda.com) * [Product Video](http://www.izenda.com/Site/Video/ProductVideo.aspx) * [Izenda Blog](http://www.izenda.com/blog) * [Company Page](http://www.izenda.com/company) * [Gallery](http://www.izenda.com/izenda-vision/) * [Client List](http://www.izenda.com/case-studies/) * [Contact Page](http://www.izenda.com/contact-us/) * [Knowledge Base](http://www.izenda.com/Site/KB/Integration/94) --- * [[Acknowledgements]]
Edit message:
Cancel