1. Home
  2. Docs
  3. Getting Started
  4. Schema Setup
  5. Setup Data Connection

Setup Data Connection

The Dotnet Report system is a powerful tool for generating reports from various databases. To leverage its capabilities, you must first configure the databases as “Data Connections” within the system. Each Data Connection contains the necessary schema setup for a specific database. This guide provides a step-by-step process to set up and manage Data Connections in Dotnet Report, ensuring seamless integration and efficient report generation.

Prerequisites

Before proceeding, ensure the following:

  1. You have an active account on dotnetreport.com.
  2. You have access to the database(s) you want to connect to.
  3. You have installed Dotnet Report in your project (if working locally).

Step 1: Open Dotnet Report in Your Development Environment

  1. Open your local installation of Dotnet Report (via Visual Studio, or Angular).
  2. Navigate to the Setup Page of the application, its usually /dotnetsetup route.
  3. Look for the Manage Database section on the welcome page.

Step 2: Add a New Data Connection

  1. On the Manage Database page, go to Data Connections and click on Add New  Connection. This step is crucial as it allows Dotnet Report to recognize and connect to your database.

  1. You will be directed to a form where you need to provide the following details:
    • Data Connect Name: Enter a name for your connection. This can be any name you prefer (e.g., “NorthWindDb”).
    • Connection Key: This is a critical field. The Connection Key must match exactly with the key name of your connection string in your web.config file. This key enables Dotnet Report to establish a connection to your database.

Important Note: Ensure your connection string uses SSPI (Security Support Provider Interface) for security if it currently uses Domain Authorization. This enhances the security of your database connection.

After filling in the required details, click Save Changes. The new Data Connection will now be added to your list of database connections.

Step 3: Retrieve API Keys

  1. To setup the API keys in case of Nuget/Angular installation, you need to access the online portal. You can log in to the online portal via https://dnreport.app/portal/Account/Login and navigate to the Get API Keys on the left-hand menu.
  2. You will see three API Keys listed:
    • Public Account API Token
    • Data Connect API Token
    • Private Account API Token
  3. These keys are essential for integrating Dotnet Report with your local environment.
  4. Map these keys to their respective appSetting tags in your web.config/appsettings file in Visual Studio based on the Anuular and Nuget package used respectively:
    • Public Account API Token ⇒ dotNetReport.accountApiToken
    • Data Connect API Token ⇒ dotNetReport.dataconnectApiToken
    • Private Account API Token ⇒ dotNetReport.privateApiToken
  5. If you haven’t installed Dotnet Report in your project yet, refer to the installation guide provided on the platform.

Step 4: Verify Data Connections on Dotnet Report Portal

Any Data Connections added from your local application will also be visible on the Dotnet Report portal. This ensures consistency and allows you to manage connections from both platforms seamlessly.

Additional Notes

  • Schema Replication: When adding a new Data Connection, you can replicate the schema of an existing connection. This is particularly useful for databases with similar structures.
  • Security Best Practices: Always ensure your connection strings are secure. Use SSPI for enhanced security and avoid hardcoding sensitive information in your web.config file.

Next Steps

Once your Data Connections are set up, the next step is to add Tables and Columns to Dotnet Report. This process will be covered in a subsequent article, enabling you to fully customize and generate reports based on your database schema.

By following this systematic guide, you can efficiently set up and manage Data Connections in Dotnet Report, ensuring a smooth and secure integration with your databases.

How can we help?