Each database that the dotnet Report system can connect to and generate reports for is setup as a “Data Connection” in the system. Each data connection contains all the Reports and the schema setup for that particular database.
To manage data connections, you are required to have an account on https://dotnetreport.com. The following steps explain how to setup your Data Connections.
Log in to your dotnetreport account and click on Setup Database. As shown in the image below, the first thing to do to is to add a new data connection so that dotnet Report can know your database schema.
You will now see the screen where you have to provide some information about the data connection you are going to add. First, in Data Connect Name, provide any name of this connection you may like. Description is optional here and you are welcome to leave it empty if you like.
Connection Key is very important, this relates to your database’s connection string key in your web config file and helps dotnet Report to connect to your database.
IMPORTANT! Your Connection key should match exactly with the key name of your connection string. Also, it is recommended that you change the security of your connection string to use SSPI if it’s using Domain Authorization.
After filling the form, hit save changes. Now you can see the connection is added to your database connections.
adNow click on Get API Keys, which is below Setup Database on the left-hand pane. Here you can see three API Keys which you will need to add to the API configuration in your local environment. dotnet Report adds some settings to your web.config when you install it in your project in visual studio. If you have not installed dotnet Report yet, click here to learn how to.
These keys should map against their respective appSetting tag in visual studio. The respective tag of each API key is given below and also shown in the below image.
- Public Account Api Token ⇒ dotNetReport.accountApiToken
- Data Connect Api Token ⇒ dotNetReport.dataconnectApiToken
- Private Account Api Token ⇒ dotNetReport.privateApiToken
You can also add new data connections from your application. Just move to www.yourwebsiteaddress.com/dotnetsetup and here you can manage your data connections. As you can see NorthWindDb is already shown in the image below along with its Database schema and table structures.
You can add, edit or delete Data Connections from this page.
Now to add new data connection click on add new connection button and provide the name of the connection string along with the name of connection as shown in the screenshots below.
NOTE: You can also copy the schema of previously added connection when you are adding a new data connection. This is pretty useful if you have databases that have the same schema, with slight changes.
To switch between data connections, just select it from the drop down, and click switch connection. Now you will be able to see the newly added connection’s database schema.
You can also view these newly added connections which are added from your local application on dotnetreport’s portal.
The next step is to add Tables and Columns to dotnetreport which is presented in next article.