d39989d4af035f4db983aa5b0c6cdf8a05d46b14
Guides/Webforms-Basic-Integration.md
| ... | ... | @@ -1,18 +1,491 @@ |
| 1 | +#Izenda Web Forms Kit Integration Guide Phase I |
|
| 2 | + |
|
| 1 | 3 | [[_TOC_]] |
| 2 | 4 | |
| 3 | 5 | ##About |
| 4 | 6 | |
| 7 | +**IF UPGRADING:** Please be sure to follow our upgrade best practices: |
|
| 8 | +**http://wiki.izenda.us/FAQ/Izenda-Update-Best-Practices** |
|
| 9 | + |
|
| 10 | +This guide is designed to instruct first-time users how to integrate Izenda with simple Web Forms application. |
|
| 11 | +This guide will use Izenda Web Forms C# kit and a simple Web Forms application, and Visual Studio 2015. |
|
| 12 | + |
|
| 13 | +Web Forms C# download link](http://archives.izenda.us/ri/webforms/webforms-cs.zip) |
|
| 5 | 14 | ##Instructions |
| 6 | 15 | |
| 7 | -###Step 1 - |
|
| 16 | +###Step 1. Create a new simple Web Forms application in Visual Studio |
|
| 17 | + |
|
| 18 | + |
|
| 19 | + |
|
| 20 | + |
|
| 21 | + |
|
| 22 | + |
|
| 23 | + |
|
| 24 | + |
|
| 25 | + |
|
| 26 | +###Step 2. Add Izenda.AdHoc.dll and log4net.dll to the project’s reference |
|
| 27 | + |
|
| 28 | +Right click on 'References' under project name in Solution Explorer window, then click 'Add Reference'. |
|
| 29 | + |
|
| 30 | +Click the 'Browse' button and browse to \mvc5r3\bin, where Izenda.AdHoc.dll and log4net.dll are. Add them to reference. |
|
| 31 | + |
|
| 32 | + |
|
| 33 | + |
|
| 34 | + |
|
| 35 | +###Step 3. Add IzendaStaticResourcesController.cs and IzendaReportingController.cs to the project |
|
| 36 | + |
|
| 37 | +IzendaStaticResourcesController.cs and IzendaReportingController.cs are at mvc5r3\Controllers. Add them under Controllers as below (You can add by either 'drag and drop' or 'right click->Add->Existing Item) |
|
| 38 | + |
|
| 39 | + |
|
| 40 | + |
|
| 41 | + |
|
| 42 | +###Step 4. Change Namespaces of Controllers |
|
| 43 | + |
|
| 44 | +Change namespaces of IzendaStaticResourcesController.cs and IzendaReportingController.cs to match all other controllers in the application. |
|
| 45 | +Ex) if the namespace is in other controller file is ABC.Controllers, then MVC3SK.Controllers -> ABC.Controllers |
|
| 46 | + |
|
| 47 | + |
|
| 48 | + |
|
| 49 | +###Step 5. Add Reporting and Resources folders to the project |
|
| 50 | + |
|
| 51 | +**a.** Add 'Reporting'and 'Resources'from \mvc5r3 to project by dragging and dropping them in Solution Explorer as below |
|
| 52 | + |
|
| 53 | + |
|
| 54 | + |
|
| 55 | +**b.** In Solution Explorer, exclude Dashboards-Body.ascx and Dashboards-Head.ascx from \Resources\html by right click on them and click 'Exclude From Project' |
|
| 56 | + |
|
| 57 | + |
|
| 58 | + |
|
| 59 | +**c.** Copy /Resources folder from the root of the application into the /Reporting folder. This will create two copies of the Resources folder, one in the root and another under the Reporting folder. (If the folder "/Reporting/Resources" exists, overwrite the existing folder with the new copy.) |
|
| 60 | + |
|
| 61 | + |
|
| 62 | + |
|
| 63 | +**d.** Copy rs.aspx from /Reporting and paste it in /Resources/html as below |
|
| 64 | + |
|
| 65 | + |
|
| 66 | + |
|
| 67 | + |
|
| 68 | +**** If Izenda toolbar icons don't appear, check if Reporting folder contains rs.aspx and Resources folder **** |
|
| 69 | + |
|
| 70 | + |
|
| 71 | +###Step 6. Add mvc5r3\Views\Reporting folder |
|
| 72 | + |
|
| 73 | +Add the Reporting folder in mvc5r3\Views to the project's Views |
|
| 74 | + |
|
| 75 | + |
|
| 76 | + |
|
| 77 | +###Step 7. Add _sitelayout to project’s Views\Shared |
|
| 78 | + |
|
| 79 | +Add _sitelayout from mvc5r3\Views\Shared to project’s Views\Shared |
|
| 80 | + |
|
| 81 | + |
|
| 82 | + |
|
| 83 | +###Step 8. Copy code from Global.asax except the first line |
|
| 84 | + |
|
| 85 | +**a.** Copy code from Global.asax except the first line |
|
| 86 | + |
|
| 87 | +###Global.asax from mvc5r3(C♯) |
|
| 88 | + |
|
| 89 | +```csharp |
|
| 90 | + |
|
| 91 | +<%@ Application Codebehind="Global.asax.cs" Inherits="MVC4Razor2.MvcApplication" Language="C#" %> //Copy except this line |
|
| 92 | + |
|
| 93 | +<%@ Import Namespace="Izenda.AdHoc"%> |
|
| 94 | +<%@ Import Namespace="System.IO"%> |
|
| 95 | + |
|
| 96 | +<script runat="server"> |
|
| 97 | + void Application_AcquireRequestState(object sender, EventArgs e) { |
|
| 98 | + CustomAdHocConfig.InitializeReporting(); |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + [Serializable] |
|
| 102 | + public class CustomAdHocConfig : FileSystemAdHocConfig { |
|
| 103 | + public static void InitializeReporting() { |
|
| 104 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 105 | + return; |
|
| 106 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 107 | + AdHocSettings.SqlServerConnectionString = @"INSERT_CONNECTION_STRING_HERE"; |
|
| 108 | + AdHocSettings.GenerateThumbnails = true; |
|
| 109 | + AdHocSettings.ShowSimpleModeViewer = true; |
|
| 110 | + AdHocSettings.IdentifiersRegex = "^.*[iI][Dd]$"; |
|
| 111 | + AdHocSettings.TabsCssUrl = "/Resources/css/tabs.css"; |
|
| 112 | + AdHocSettings.ReportCssUrl = "../Resources/css/Report.css"; |
|
| 113 | + AdHocSettings.ShowBetweenDateCalendar = true; |
|
| 114 | + AdHocSettings.DashboardViewer = "Dashboards"; |
|
| 115 | + AdHocSettings.ReportViewer = "ReportViewer"; |
|
| 116 | + AdHocSettings.InstantReport = "InstantReport"; |
|
| 117 | + AdHocSettings.ReportDesignerUrl = "ReportDesigner"; |
|
| 118 | + AdHocSettings.DashboardDesignerUrl = "DashboardDesigner"; |
|
| 119 | + AdHocSettings.ReportList = "ReportList"; |
|
| 120 | + AdHocSettings.SettingsPageUrl = "Settings"; |
|
| 121 | + AdHocSettings.ParentSettingsUrl = "Settings"; |
|
| 122 | + AdHocSettings.ResponseServer = "rs.aspx"; |
|
| 123 | + AdHocSettings.ReportsPath = Path.Combine(HttpContext.Current.Server.MapPath("~/"), "Reports"); |
|
| 124 | + AdHocSettings.PrintMode = PrintMode.Html2PdfAndHtml; |
|
| 125 | + AdHocSettings.ChartingEngine = ChartingEngine.HtmlChart; |
|
| 126 | + AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 127 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 128 | + } |
|
| 129 | + } |
|
| 130 | +</script> |
|
| 131 | + |
|
| 132 | +``` |
|
| 133 | + |
|
| 134 | +**b.** Paste it in project’s Global.asax |
|
| 135 | + |
|
| 136 | +###Global.asax from Sample_MVCApp(C♯) |
|
| 137 | +```csharp |
|
| 138 | +<%@ Application Codebehind="Global.asax.cs" Inherits="Sample_MVCApp.MvcApplication" Language="C#" %> |
|
| 139 | + |
|
| 140 | +//THE BELOW IS PASTED CODE |
|
| 141 | + |
|
| 142 | +<%@ Import Namespace="Izenda.AdHoc"%> |
|
| 143 | +<%@ Import Namespace="System.IO"%> |
|
| 144 | + |
|
| 145 | +<script runat="server"> |
|
| 146 | + void Application_AcquireRequestState(object sender, EventArgs e) { |
|
| 147 | + CustomAdHocConfig.InitializeReporting(); |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + [Serializable] |
|
| 151 | + public class CustomAdHocConfig : FileSystemAdHocConfig { |
|
| 152 | + public static void InitializeReporting() { |
|
| 153 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 154 | + return; |
|
| 155 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 156 | + AdHocSettings.SqlServerConnectionString = @"INSERT_CONNECTION_STRING_HERE"; |
|
| 157 | + AdHocSettings.GenerateThumbnails = true; |
|
| 158 | + AdHocSettings.ShowSimpleModeViewer = true; |
|
| 159 | + AdHocSettings.IdentifiersRegex = "^.*[iI][Dd]$"; |
|
| 160 | + AdHocSettings.TabsCssUrl = "/Resources/css/tabs.css"; |
|
| 161 | + AdHocSettings.ReportCssUrl = "../Resources/css/Report.css"; |
|
| 162 | + AdHocSettings.ShowBetweenDateCalendar = true; |
|
| 163 | + AdHocSettings.DashboardViewer = "Dashboards"; |
|
| 164 | + AdHocSettings.ReportViewer = "ReportViewer"; |
|
| 165 | + AdHocSettings.InstantReport = "InstantReport"; |
|
| 166 | + AdHocSettings.ReportDesignerUrl = "ReportDesigner"; |
|
| 167 | + AdHocSettings.DashboardDesignerUrl = "DashboardDesigner"; |
|
| 168 | + AdHocSettings.ReportList = "ReportList"; |
|
| 169 | + AdHocSettings.SettingsPageUrl = "Settings"; |
|
| 170 | + AdHocSettings.ParentSettingsUrl = "Settings"; |
|
| 171 | + AdHocSettings.ResponseServer = "rs.aspx"; |
|
| 172 | + AdHocSettings.ReportsPath = Path.Combine(HttpContext.Current.Server.MapPath("~/"), "Reports"); |
|
| 173 | + AdHocSettings.PrintMode = PrintMode.Html2PdfAndHtml; |
|
| 174 | + AdHocSettings.ChartingEngine = ChartingEngine.HtmlChart; |
|
| 175 | + AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 176 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 177 | + } |
|
| 178 | + } |
|
| 179 | +</script> |
|
| 180 | +``` |
|
| 181 | + |
|
| 182 | + |
|
| 183 | +###Step 9. Copy constraints classes from Global.asax.cs |
|
| 184 | + |
|
| 185 | + |
|
| 186 | +**a.** Copy below two constraints from Global.asax.cs of mvc5r3 |
|
| 187 | +```csharp |
|
| 188 | + |
|
| 189 | +//IRouteConstraint |
|
| 190 | +public class SpecificFileRouterConstraint : IRouteConstraint { |
|
| 191 | + private string extensionToBeRouted = null; |
|
| 192 | + private string fileToBeRouted = null; |
|
| 193 | + |
|
| 194 | + public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) { |
|
| 195 | + return !String.IsNullOrEmpty(extensionToBeRouted) && !String.IsNullOrEmpty(fileToBeRouted) && values[extensionToBeRouted] != null && values[extensionToBeRouted].ToString().ToLower().Contains(fileToBeRouted); |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + public SpecificFileRouterConstraint() { } |
|
| 199 | + |
|
| 200 | + public SpecificFileRouterConstraint(string extension, string fileName) { |
|
| 201 | + extensionToBeRouted = extension.ToLower(); |
|
| 202 | + fileToBeRouted = fileName.ToLower(); |
|
| 203 | + } |
|
| 204 | + } |
|
| 205 | + |
|
| 206 | + |
|
| 207 | + |
|
| 208 | + |
|
| 209 | +//IRouteConstraint |
|
| 210 | +public class IzendaResourceConstraint : IRouteConstraint { |
|
| 211 | + private string extensionToBeRouted = null; |
|
| 212 | + |
|
| 213 | + public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) { |
|
| 214 | + if (String.IsNullOrEmpty(extensionToBeRouted) || values[extensionToBeRouted] == null) { |
|
| 215 | + return false; |
|
| 216 | + } |
|
| 217 | + string requestUrl = values[extensionToBeRouted].ToString().ToLower(); |
|
| 218 | + bool result = false; |
|
| 219 | + if (extensionToBeRouted == "js") { |
|
| 220 | + result = result || requestUrl.Contains("reportviewerfilters.js"); |
|
| 221 | + result = result || requestUrl.Contains("reportlist.js"); |
|
| 222 | + result = result || requestUrl.Contains("data-sources.js"); |
|
| 223 | + result = result || requestUrl.Contains("data-sources-preview.js"); |
|
| 224 | + result = result || requestUrl.Contains("charts.js"); |
|
| 225 | + result = result || requestUrl.Contains("datasources-search.js"); |
|
| 226 | + result = result || requestUrl.Contains("jquery-1.6.1.min.js"); |
|
| 227 | + result = result || requestUrl.Contains("jquery-ui-1.8.13.custom.min.js"); |
|
| 228 | + result = result || requestUrl.Contains("elrte.full.js"); |
|
| 229 | + result = result || requestUrl.Contains("elrte.ru.js"); |
|
| 230 | + result = result || requestUrl.Contains("fieldproperties.js"); |
|
| 231 | + result = result || requestUrl.Contains("shrinkable-grid.js"); |
|
| 232 | + } |
|
| 233 | + if (extensionToBeRouted == "css") { |
|
| 234 | + result = result || requestUrl.Contains("tabs.css"); |
|
| 235 | + result = result || requestUrl.Contains("report.css"); |
|
| 236 | + result = result || requestUrl.Contains("filters.css"); |
|
| 237 | + result = result || requestUrl.Contains("base.css"); |
|
| 238 | + result = result || requestUrl.Contains("report-list-modal.css"); |
|
| 239 | + result = result || requestUrl.Contains("data-sources.css"); |
|
| 240 | + result = result || requestUrl.Contains("charts.css"); |
|
| 241 | + result = result || requestUrl.Contains("jquery-ui-1.8.13.custom.css"); |
|
| 242 | + result = result || requestUrl.Contains("elrte.min.css"); |
|
| 243 | + result = result || requestUrl.Contains("elrte-inner.css"); |
|
| 244 | + result = result || requestUrl.Contains("shrinkable-grid.css"); |
|
| 245 | + } |
|
| 246 | + if (extensionToBeRouted == "png") { |
|
| 247 | + result = result || requestUrl.Contains("elrtebg.png"); |
|
| 248 | + result = result || requestUrl.Contains("elrte-toolbar.png"); |
|
| 249 | + } |
|
| 250 | + if (extensionToBeRouted == "gif") { |
|
| 251 | + result = result || requestUrl.Contains("elrte/images/pixel.gif"); |
|
| 252 | + } |
|
| 253 | + return result; |
|
| 254 | + } |
|
| 255 | + |
|
| 256 | + public IzendaResourceConstraint() { } |
|
| 257 | + |
|
| 258 | + public IzendaResourceConstraint(string extension) { |
|
| 259 | + extensionToBeRouted = extension.ToLower(); |
|
| 260 | + } |
|
| 261 | + } |
|
| 262 | + |
|
| 263 | +``` |
|
| 264 | + |
|
| 265 | +**b.** Paste it above MVCapplication class in Global.asax.cs of project |
|
| 266 | + |
|
| 267 | +```csharp |
|
| 268 | + |
|
| 269 | +namespace Sample_MVCApp |
|
| 270 | +{ |
|
| 271 | + public class SpecificFileRouterConstraint : IRouteConstraint |
|
| 272 | + { |
|
| 273 | + private string extensionToBeRouted = null; |
|
| 274 | + private string fileToBeRouted = null; |
|
| 275 | + |
|
| 276 | + public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) |
|
| 277 | + { |
|
| 278 | + return !String.IsNullOrEmpty(extensionToBeRouted) && !String.IsNullOrEmpty(fileToBeRouted) && values[extensionToBeRouted] != null && values[extensionToBeRouted].ToString().ToLower().Contains(fileToBeRouted); |
|
| 279 | + } |
|
| 280 | + |
|
| 281 | + public SpecificFileRouterConstraint() { } |
|
| 282 | + |
|
| 283 | + public SpecificFileRouterConstraint(string extension, string fileName) |
|
| 284 | + { |
|
| 285 | + extensionToBeRouted = extension.ToLower(); |
|
| 286 | + fileToBeRouted = fileName.ToLower(); |
|
| 287 | + } |
|
| 288 | + } |
|
| 289 | + |
|
| 290 | + public class IzendaResourceConstraint : IRouteConstraint |
|
| 291 | + { |
|
| 292 | + private string extensionToBeRouted = null; |
|
| 293 | + |
|
| 294 | + public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) |
|
| 295 | + { |
|
| 296 | + if (String.IsNullOrEmpty(extensionToBeRouted) || values[extensionToBeRouted] == null) |
|
| 297 | + { |
|
| 298 | + return false; |
|
| 299 | + } |
|
| 300 | + string requestUrl = values[extensionToBeRouted].ToString().ToLower(); |
|
| 301 | + bool result = false; |
|
| 302 | + if (extensionToBeRouted == "js") |
|
| 303 | + { |
|
| 304 | + result = result || requestUrl.Contains("reportviewerfilters.js"); |
|
| 305 | + result = result || requestUrl.Contains("reportlist.js"); |
|
| 306 | + result = result || requestUrl.Contains("data-sources.js"); |
|
| 307 | + result = result || requestUrl.Contains("data-sources-preview.js"); |
|
| 308 | + result = result || requestUrl.Contains("charts.js"); |
|
| 309 | + result = result || requestUrl.Contains("datasources-search.js"); |
|
| 310 | + result = result || requestUrl.Contains("jquery-1.6.1.min.js"); |
|
| 311 | + result = result || requestUrl.Contains("jquery-ui-1.8.13.custom.min.js"); |
|
| 312 | + result = result || requestUrl.Contains("elrte.full.js"); |
|
| 313 | + result = result || requestUrl.Contains("elrte.ru.js"); |
|
| 314 | + result = result || requestUrl.Contains("fieldproperties.js"); |
|
| 315 | + result = result || requestUrl.Contains("shrinkable-grid.js"); |
|
| 316 | + } |
|
| 317 | + if (extensionToBeRouted == "css") |
|
| 318 | + { |
|
| 319 | + result = result || requestUrl.Contains("tabs.css"); |
|
| 320 | + result = result || requestUrl.Contains("report.css"); |
|
| 321 | + result = result || requestUrl.Contains("filters.css"); |
|
| 322 | + result = result || requestUrl.Contains("base.css"); |
|
| 323 | + result = result || requestUrl.Contains("report-list-modal.css"); |
|
| 324 | + result = result || requestUrl.Contains("data-sources.css"); |
|
| 325 | + result = result || requestUrl.Contains("charts.css"); |
|
| 326 | + result = result || requestUrl.Contains("jquery-ui-1.8.13.custom.css"); |
|
| 327 | + result = result || requestUrl.Contains("elrte.min.css"); |
|
| 328 | + result = result || requestUrl.Contains("elrte-inner.css"); |
|
| 329 | + result = result || requestUrl.Contains("shrinkable-grid.css"); |
|
| 330 | + } |
|
| 331 | + if (extensionToBeRouted == "png") |
|
| 332 | + { |
|
| 333 | + result = result || requestUrl.Contains("elrtebg.png"); |
|
| 334 | + result = result || requestUrl.Contains("elrte-toolbar.png"); |
|
| 335 | + } |
|
| 336 | + if (extensionToBeRouted == "gif") |
|
| 337 | + { |
|
| 338 | + result = result || requestUrl.Contains("elrte/images/pixel.gif"); |
|
| 339 | + } |
|
| 340 | + return result; |
|
| 341 | + } |
|
| 342 | + |
|
| 343 | + public IzendaResourceConstraint() { } |
|
| 344 | + |
|
| 345 | + public IzendaResourceConstraint(string extension) |
|
| 346 | + { |
|
| 347 | + extensionToBeRouted = extension.ToLower(); |
|
| 348 | + } |
|
| 349 | + } |
|
| 350 | + |
|
| 351 | + |
|
| 352 | + |
|
| 353 | + // Note: For instructions on enabling IIS6 or IIS7 classic mode, |
|
| 354 | + // visit http://go.microsoft.com/?LinkId=9394801 |
|
| 355 | + |
|
| 356 | + public class MvcApplication : System.Web.HttpApplication |
|
| 357 | + { |
|
| 358 | + protected void Application_Start() |
|
| 359 | + { |
|
| 360 | + AreaRegistration.RegisterAllAreas(); |
|
| 361 | + |
|
| 362 | + WebApiConfig.Register(GlobalConfiguration.Configuration); |
|
| 363 | + FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); |
|
| 364 | + RouteConfig.RegisterRoutes(RouteTable.Routes); |
|
| 365 | + BundleConfig.RegisterBundles(BundleTable.Bundles); |
|
| 366 | + AuthConfig.RegisterAuth(); |
|
| 367 | + } |
|
| 368 | + } |
|
| 369 | +} |
|
| 370 | + |
|
| 371 | + |
|
| 372 | +``` |
|
| 373 | + |
|
| 374 | + |
|
| 375 | +###Step 10. Copy over RegisterRoutes in MvcApplication |
|
| 376 | + |
|
| 377 | +**a.** Copy the below class from Global.asax.cs of mvc5r3 |
|
| 378 | + |
|
| 379 | +```csharp |
|
| 380 | +public static void RegisterRoutes(RouteCollection routes) { |
|
| 381 | + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); |
|
| 382 | + routes.MapRoute("IzendaResources", "Reporting/Resources/{*resource}", new { controller = "IzendaStaticResources", action = "Index" }); |
|
| 383 | + routes.MapRoute("IzendaJsResources", "{*js}", new { controller = "IzendaStaticResources", action = "Index" }, new { irc = new IzendaResourceConstraint("js") }); |
|
| 384 | + routes.MapRoute("IzendaCssResources", "{*css}", new { controller = "IzendaStaticResources", action = "Index" }, new { irc = new IzendaResourceConstraint("css") }); |
|
| 385 | + routes.MapRoute("IzendaPngResources", "{*png}", new { controller = "IzendaStaticResources", action = "Index" }, new { irc = new IzendaResourceConstraint("png") }); |
|
| 386 | + routes.MapRoute("IzendaGifResources", "{*gif}", new { controller = "IzendaStaticResources", action = "Index" }, new { irc = new IzendaResourceConstraint("gif") }); |
|
| 387 | + routes.MapRoute("IzendaReporting", "{controller}/{action}/{id}", new { controller = "Reporting", id = UrlParameter.Optional }); |
|
| 388 | + routes.MapRoute("StarterKitDefault", "{controller}/{action}/{id}", new { controller = "Reporting", action = "ReportList", id = UrlParameter.Optional }); |
|
| 389 | + routes.MapRoute("HomeDefault", "{*pathInfo}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }); |
|
| 390 | + } |
|
| 391 | +``` |
|
| 392 | + |
|
| 393 | +**b.** Paste it inside MvcApplication class of tproject’s Global.asax.cs |
|
| 394 | + |
|
| 395 | +```csharp |
|
| 396 | +public class MvcApplication : System.Web.HttpApplication |
|
| 397 | + { |
|
| 398 | + |
|
| 399 | + public static void RegisterRoutes(RouteCollection routes) |
|
| 400 | + { |
|
| 401 | + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); |
|
| 402 | + routes.MapRoute("IzendaResources", "Reporting/Resources/{*resource}", new { controller = "IzendaStaticResources", action = "Index" }); |
|
| 403 | + routes.MapRoute("IzendaJsResources", "{*js}", new { controller = "IzendaStaticResources", action = "Index" }, new { irc = new IzendaResourceConstraint("js") }); |
|
| 404 | + routes.MapRoute("IzendaCssResources", "{*css}", new { controller = "IzendaStaticResources", action = "Index" }, new { irc = new IzendaResourceConstraint("css") }); |
|
| 405 | + routes.MapRoute("IzendaPngResources", "{*png}", new { controller = "IzendaStaticResources", action = "Index" }, new { irc = new IzendaResourceConstraint("png") }); |
|
| 406 | + routes.MapRoute("IzendaGifResources", "{*gif}", new { controller = "IzendaStaticResources", action = "Index" }, new { irc = new IzendaResourceConstraint("gif") }); |
|
| 407 | + routes.MapRoute("IzendaReporting", "{controller}/{action}/{id}", new { controller = "Reporting", id = UrlParameter.Optional }); |
|
| 408 | + routes.MapRoute("StarterKitDefault", "{controller}/{action}/{id}", new { controller = "Reporting", action = "ReportList", id = UrlParameter.Optional }); |
|
| 409 | + routes.MapRoute("HomeDefault", "{*pathInfo}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }); |
|
| 410 | + } |
|
| 411 | + |
|
| 412 | + protected void Application_Start() |
|
| 413 | + { |
|
| 414 | + AreaRegistration.RegisterAllAreas(); |
|
| 415 | + |
|
| 416 | + WebApiConfig.Register(GlobalConfiguration.Configuration); |
|
| 417 | + FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); |
|
| 418 | + RouteConfig.RegisterRoutes(RouteTable.Routes); |
|
| 419 | + BundleConfig.RegisterBundles(BundleTable.Bundles); |
|
| 420 | + AuthConfig.RegisterAuth(); |
|
| 421 | + } |
|
| 422 | + } |
|
| 423 | + |
|
| 424 | +``` |
|
| 425 | + |
|
| 426 | + |
|
| 427 | +###Step 11. Change the LicenseKey and ConnnectionString in Global.asax of project |
|
| 428 | + |
|
| 429 | + To get a new trial key, you may contact [sales@izenda.com](mailto:sales@izenda.com). |
|
| 430 | + |
|
| 431 | +```csharp |
|
| 432 | + |
|
| 433 | +AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 434 | +AdHocSettings.SqlServerConnectionString = @"INSERT_CONNECTION_STRING_HERE"; |
|
| 435 | + |
|
| 436 | +``` |
|
| 437 | + |
|
| 438 | +###Step 12. Run it! |
|
| 439 | + |
|
| 440 | +After Step#11, the Sample_MVCApp should build and work without a problem. To see if Izenda is integrated with this web application, |
|
| 441 | + |
|
| 442 | +**a.** Open _Layout.cshtml in Views\Shared\ in Solution Explorer |
|
| 443 | + |
|
| 444 | +**b.** Add an ActionLink which leads to Izenda as below |
|
| 445 | + |
|
| 446 | +```html |
|
| 447 | +<li>@Html.ActionLink("Home", "Index", "Home")</li> |
|
| 448 | +<li>@Html.ActionLink("About", "About", "Home")</li> |
|
| 449 | +<li>@Html.ActionLink("Contact", "Contact", "Home")</li> |
|
| 450 | +<li>@Html.ActionLink("Izenda", "ReportList", "Reporting")</li> //Add this line |
|
| 451 | +``` |
|
| 452 | + |
|
| 453 | +**c.** Notice 'Izenda' item added to the menu as below. Click it and see if it leads to Izenda ReportList page. |
|
| 454 | + |
|
| 455 | + |
|
| 456 | + |
|
| 457 | + |
|
| 458 | +###Step 13. Change the Logo |
|
| 459 | + |
|
| 460 | +**a.** Open _SiteLayout.cshtml in Views\Shared\ in Solution Explorer |
|
| 461 | + |
|
| 462 | +**b.** Find below two lines in the body of the html and edit the source image directory, alt, and the link address for top-right image |
|
| 463 | + |
|
| 464 | +```html |
|
| 465 | +<img src="~/Resources/FromDLL/Resources/ModernImages/bi-logo.png" alt="Business intelligence" /> //top-left image |
|
| 466 | + |
|
| 467 | +<a href="http://izenda.com" style="position: relative; top: 4px;"><img class="right-logo" src="~/Resources/FromDLL/Resources/ModernImages/IzendaNewLogoBlue.png" alt="Izenda Reports" /></a> //top-right image |
|
| 468 | + |
|
| 469 | +``` |
|
| 470 | +**c.** Run the application and check if the images appear as edited. |
|
| 471 | + |
|
| 472 | + |
|
| 473 | +In this guide, two images, Logo.png and SeaEagle.png, were put in the project folder, /Sample_MVCApp, and the above two lines were edited as below |
|
| 474 | + |
|
| 475 | +```html |
|
| 476 | +<img src="~/Logo.png" alt="Angry Sea Eagle" /> //top-left image |
|
| 477 | + |
|
| 478 | +<a href="http://SeaEagle.com" style="position: relative; top: 4px;"><img class="right-logo" src="~/SeaEagle.png" alt="SeaEagle.Com" /></a> //top-right image |
|
| 479 | +``` |
|
| 480 | + |
|
| 481 | + |
|
| 482 | + |
|
| 483 | +Two top logos have changed as below |
|
| 8 | 484 | |
| 9 | -The basics of integrating Izenda within a Web Forms application: |
|
| 485 | + |
|
| 10 | 486 | |
| 11 | -1. Add Izenda’s bin contents to your application’s bin directory. |
|
| 12 | -2. Add Izenda’s Resources Folder to your application’s root directory. |
|
| 13 | -3. Add Izenda’s CustomAdHocConfing class and InitializeReporting() method to your Global.asax. |
|
| 14 | -4. Add Izenda’s Web.config settings to your Web.config. |
|
| 15 | -5. Add Izenda’s ASPX and ASPX.CS pages and other miscellaneous to your directory, except for the Izenda.config (set all API settings in your InitializeReporting() method), Default.aspx and Settings.aspx. |
|
| 16 | -6. Adjust or remove the Default.master to apply branding. |
|
| 17 | -a. If you remove the Default.master, have Izenda use your own master style page, and add to your page the JavaScript and CSS resource references Izenda’s pages require. Feel free to adjust CSS/JavaScript files in the Resources folder in order to apply branding. |
|
| 487 | +<!-- |
|
| 488 | +[Izenda MVC Kit Integration Guide Phase II](http://wiki.izenda.us/Guides/MVC-Integration/Phase-II-Draft) |
|
| 489 | +--> |
|
| 18 | 490 | |
| 491 | + |
|
| ... | ... | \ No newline at end of file |