65d8b9a98eb4a1a632485f57117dda7de7207225
Guides/Webform-Integration-Sub-Folder.md
| ... | ... | @@ -24,11 +24,57 @@ You can also create a new web site in ASP.NET web forms |
| 24 | 24 |  |
| 25 | 25 | |
| 26 | 26 | |
| 27 | -###Step 3. Copy contents of Global.asax in starter kit to Global.asax of website |
|
| 27 | +###Step 3. Copy contents of Global.asax in webform kit to Global.asax of website |
|
| 28 | 28 | |
| 29 | -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) |
|
| 29 | +Copy the code from Global.asax of webform kit to Global.asax of website |
|
| 30 | 30 | |
| 31 | - |
|
| 31 | +```csharp |
|
| 32 | + [Serializable] |
|
| 33 | + public class CustomAdHocConfig : FileSystemAdHocConfig { |
|
| 34 | + public static void InitializeReporting() { |
|
| 35 | + //Check to see if we've already initialized. |
|
| 36 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 37 | + return; |
|
| 38 | + //Initialize System |
|
| 39 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 40 | + AdHocSettings.SqlServerConnectionString = @"INSERT_CONNECTION_STRING_HERE"; |
|
| 41 | + AdHocSettings.GenerateThumbnails = true; |
|
| 42 | + AdHocSettings.ChartingEngine = ChartingEngine.HtmlChart; |
|
| 43 | + AdHocSettings.ShowSimpleModeViewer = true; |
|
| 44 | + AdHocSettings.IdentifiersRegex = "^.*[iI][Dd]$"; |
|
| 45 | + AdHocSettings.TabsCssUrl = "Resources/css/tabs.css"; |
|
| 46 | + AdHocSettings.ReportCssUrl = "Resources/css/Report.css"; |
|
| 47 | + AdHocSettings.ShowBetweenDateCalendar = true; |
|
| 48 | + AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 49 | + AdHocSettings.ChartingEngine = ChartingEngine.HtmlChart; |
|
| 50 | + // AdHocSettings.ShowHtmlButton = true; |
|
| 51 | + //AdHocSettings.ShowPDFButton = true; |
|
| 52 | + //Initialize User |
|
| 53 | + //AdHocSettings.VisibleDataSources= |
|
| 54 | + //AdHocSettings.CurrentUserName= |
|
| 55 | + //AdHocSettings.HiddenFilters["Field"] = new string [] {"value1","value2"}; |
|
| 56 | + //Success! |
|
| 57 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 58 | + |
|
| 59 | + AdHocSettings.DashboardDateSliderMode = DashboardDateSliderMode.None; |
|
| 60 | + |
|
| 61 | + AdHocSettings.DashboardViewer = "Dash.aspx"; |
|
| 62 | + AdHocSettings.DashboardDesignerUrl = "Dash.aspx"; |
|
| 63 | + |
|
| 64 | + //EOPDF uses a DLL that converts HTML |
|
| 65 | + //AdHocSettings.PdfPrintMode = PdfMode.EOPDF; |
|
| 66 | + //PhantomJS PDF uses an EXE on the web server that produces the export |
|
| 67 | + AdHocSettings.PdfPrintMode = PdfMode.PhantomJs; |
|
| 68 | + } |
|
| 69 | + public override void ProcessDataSet(System.Data.DataSet ds, string reportPart) { |
|
| 70 | + base.ProcessDataSet(ds, reportPart); |
|
| 71 | + } |
|
| 72 | + public override void PreExecuteReportSet(ReportSet reportSet) { |
|
| 73 | + base.PreExecuteReportSet(reportSet); |
|
| 74 | + } |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | +``` |
|
| 32 | 78 | |
| 33 | 79 | |
| 34 | 80 | ###Step 4. Change Namespaces of Controllers |