Connection string in Asp.Net Core

4 posts, 0 answers
  1. Marcel
    Marcel avatar
    21 posts
    Member since:
    Jun 2008

    Posted 15 Apr Link to this post

    I have an Angular / Asp.Net Core web application. The report viewer component is working in the Angular application. Parameters are passed correctly. But when the report is loaded I get the error message in the viewer:

    An error has occurred while processing Table 'crosstab1': Invalid key value.

    The passed parameters values are displayed in textboxes so the report is loaded and rendered.

    I guess it has something to do with the connection string that cannot be found.I created the report in the Report Designer application (so no class library/project which contains the reports) and the name of the connection string is "Reports" in the designer.

    In the appsettings.json file I added an entry into the ConnectionStrings section with the name "Reports" (just as in the examples)

    "ConnectionStrings": [
    {"name": "Reports",     "connectionString": "Data Source=.;Initial Catalog=DatabaseName;Integrated Security=True",     "providerName": "System.Data.SqlClient"   }
    ]

     

    I also created an app.config file with the connection strings

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
     
      <!-- To customize the asp.net core module uncomment and edit the following section.
      <!--
      <system.webServer>
        <handlers>
          <remove name="aspNetCore"/>
          <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
        </handlers>
        <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
      </system.webServer>
      -->
     
      <connectionStrings>
        <add name="Reports"
            connectionString="Data Source=.;Initial Catalog=DatabaseName;Integrated Security=True"
            providerName="System.Data.SqlClient" />
      </connectionStrings>
     
    </configuration>

     

    It seems that the Report Engine cannot find the connection string. Or does the Report Engine use another name for finding the connection string?

  2. Marcel
    Marcel avatar
    21 posts
    Member since:
    Jun 2008

    Posted 15 Apr Link to this post

    Connection string seams not be the problem because I added a normal table which display's data. The problem is the cross table which works fine in the designer but not in the report viewer.

  3. Marcel
    Marcel avatar
    21 posts
    Member since:
    Jun 2008

    Posted 16 Apr Link to this post

    This thread can be closed. Problem is the format of the connection string in the config files. See https://www.telerik.com/forums/connection-strings-format
  4. Marcel
    Marcel avatar
    21 posts
    Member since:
    Jun 2008

    Posted 16 Apr Link to this post

    This thread can be closed. Problem is the format of the connection string section in the config files. See https://www.telerik.com/forums/connection-strings-format
Back to Top