The Izenda Mvc5 Starterkit illustrates how to embed Izenda within a MVC5 application.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Mvc5StarterKit
SQLScript/MSSQL
.gitignore
Mvc5StarterKit.sln
README.md

README.md

Izenda Mvc5Starterkit

Overview

Q. What is in this repository?

A. This is a simple example using an MVC Visual Studio project template with Izenda Embedded into it. This repository is only an example of integrating Izenda into another application. The Visual Studio project template used in this scenario is used as a substitute for your application. This repository shows examples of how you might embed Izenda into your application.

⚠️ The MVC Kit is designed for demonstration purposes and should not be used as an “as-is” fully-integrated solution. You can use the kit for reference or a baseline but ensure that security and customization meet the standards of your company.

Getting Started

Download the v2.6.20 (https://downloads.izenda.com/v2.6.0-v2.6.24/v2.6.20/) of the API and EmbeddedUI and copy the following:

All files & folders inside:

  • API\bin -> Mvc5StarterKit\IzendaReferences

The folder itself for:

  • API\Content -> Mvc5StarterKit\IzendaResources
  • API\EmailTemplates -> Mvc5StarterKit\IzendaResources
  • API\Export -> Mvc5StarterKit\IzendaResources
  • API\Themes -> Mvc5StarterKit\IzendaResources
  • EmbeddedUI -> Mvc5StarterKit\Scripts\izenda

Open SSMS

  • Create a new database named Retail
  • Run script located at Mvc5StarterKit\SQLScript\RetailDbScript.sql

Run Application and login by System Admin Account below:

After start up and logging in as Admin Go to Settings on top Nav

  • Add Izenda License Key and Token (leave Izenda Configuration Database Connection string set this is using an MDF file included in this kit)

  • Go to Data Setup > Connection String add the connection string to the Retail database created above for system and all tenants and move tables/views to visible More Info here: How To Set Up A Connection String

  • In Data Setup > Advanced Settings > Security Set the Tenant Field to [CustomerID] (please ensure you use the brackets) for each Tenant / CustomerID in the Retail Database are the tenants (DELDG/NATWR/RETCL) and this will filter data based on the current user's TenantID More Info here: Updating settings in Performance, Security/Additive Fields and Others group

  • For each Role in the tenant set datamodel access (what tables / views each role can access) More Info here: How To Set Up A Role

Tenants, Users, and Roles

For each Tenant the following users / roles are configured all use the same password: Izenda@123

Tenant: DELDG
User: employee@deldg.com Role: employee
User: manager@deldg.com Role: manager
User: vp@deldg.com Role: VP

Tenant: NATWR
User: employee@natwr.com Role: employee
User: manager@natwr.com Role: manager
User: VP@natwr.com Role: VP

Tenant: RETCL
User: employee@retcl.com Role: employee
User: manager@retcl.com Role: manager
User: vp@retcl.com Role: VP

When registering a new user in this sample all users are hardcoded to the manager role here: Mvc5StarterKit\Controllers\AccountController.cs (Line 177)

Please review the following file: mvc5starterkit\mvc5starterkit\izendaboundary\customadhocreport.cs This is where you can find samples for: Hidden Filters Filter Dropdown Overrides See more information here: All About IAdhocExtension, Hidden Filters, and Filter Dropdown Overrides

The CSS can be configured per tenant and an example is provided see below: This is configured here ~\mvc5starterkit\Mvc5StarterKit\Views\Shared_Layout.cshtml And folder structures are located here ~\mvc5starterkit\Mvc5StarterKit\Content

SQL Scripts

The MVC5Starterkit is pre-set to use locally installed instances of SQL LocalDB (mdf) for the Izenda database and the MVC5Starterkit database. You can configure the kit to use full-fledged sql server instances by following the instructions below.

Creating the Izenda database

This is the database for the Izenda configuration. It contains report definitions, dashboards,etc.

  • Create a database named 'IzendaMVC'. You may use any name of your choosing, just be sure to modify the script below to use the new database name.
  • Download and execute the IzendaMVC.sql script.
  • Modify the izendadb.config file with a valid connection string to this new database.
{"ServerTypeId":"572bd576-8c92-4901-ab2a-b16e38144813","ServerTypeName":"[MSSQL] SQLServer","ConnectionString":"[Your Izenda Configuration Database Connection String Here]","ConnectionId":"00000000-0000-0000-0000-000000000000"}

Creating the Mvc5StarterKit database

This is the database for the Mvc5 application. It contains the users, roles, tenants used to login.

  • Create a database named 'Mvc5StarterKit'. You may use any name of your choosing, just be sure to modify the script below to use the new database name.
  • Download the Mvc5StarterKit.sql script.
  • Modify the web.config (Line 86) file with a valid connection string to this new database.
  <connectionStrings>
    <add name="DefaultConnection" connectionString="[your MVC Database Connection String here]" providerName="System.Data.SqlClient" />
  </connectionStrings>

Post Installation

⚠️ In order to ensure smooth operation of this kit, the items below should be reviewed.

Exporting

Update the WebUrl value in the IzendaSystemSetting table with the URL for your front-end. You can use the script below to accomplish this. As general best practice, we recommend backing up your database before making any manual updates.

UPDATE [IzendaSystemSetting]
SET [Value] = '<your url here including the trailing slash>'
WHERE [Name] = 'WebUrl'

If you do not update this setting, charts and other visualizations may not render correctly when emailed or exported. This will also be evident in the log files as shown below:

[ERROR][ExportingLogic ] Convert to image: System.Exception: HTML load error. The remote content was not found at the server - HTTP error 404