Where can i change the connection string?

4 posts, 1 answers
  1. Melvin Francisco
    Melvin Francisco avatar
    6 posts
    Member since:
    Nov 2016

    Posted 17 Nov 2016 Link to this post

    Hello, i just started using Telerik and im creating a project using MVC 5, I use the HTML5 viewer using the add item to the project and when i go ahead and do that i select a report i have previously made on the standalone designer but when i try to run it i get the

    "Warning: Connection string with name 'Server=127.0.0.1;Database=identity;Uid=root;Pwd=qwerty123;' is missing in the application configuration file."

    On the web.config of the MVC project itself i do have that exact connection string, like this:

    <connectionStrings>    <add name="DefaultConnection" connectionString="Server=127.0.0.1;Database=identity;Uid=root;Pwd=qwerty123;" providerName="MySql.Data.MySqlClient" />  </connectionStrings>

    Can someone help me please? Is there a way i can set up the connection string from where the report will connect to manually somewhere in the mvc project?Been stuck some time with this. Thanks in advance.

  2. Melvin Francisco
    Melvin Francisco avatar
    6 posts
    Member since:
    Nov 2016

    Posted 17 Nov 2016 in reply to Melvin Francisco Link to this post

    Follow up question, Where can i set up parameters inside the standalone design manager?

    Was looking at this video
    http://www.telerik.com/videos/reporting/telerik-trainer-reporting-parameters

    but there's nothing like that on the standalone report designer R2 2016 i have.

  3. Melvin Francisco
    Melvin Francisco avatar
    6 posts
    Member since:
    Nov 2016

    Posted 17 Nov 2016 Link to this post

    aaaand one more question, how can i make it so only 1 row appear on 1 page.

    For example i have 5 rows in the database and when i put them all 5 show up in only 1 page, instead i would like to have it show on 5 different individual pages per row.

  4. Answer
    Stef
    Admin
    Stef avatar
    3610 posts

    Posted 21 Nov 2016 Link to this post

    Hi Melvin,

    If you are starting with Telerik Reporting, please check the information below. It includes details about creating reports and using the HTML5 Viewer in any web application:

    Telerik Reports are templates that can be designed with the available Report Designers. The result is a .NET class inheriting Telerik.Reporting.Report or a TRDX file containing the serialized in XML Telerik.Reporting.Report object. The report must contain items bound to fields of the assigned data in order to display content - Quickstart (details how to create a report).

    Details how to organize the layout based on the existing sections and items, and their properties are available in Report StructureDesign Considerations for Report Item Layout and Understanding Pagination.
    There are data source components allowing you to specify how data to be retrieved. For example, the purpose of the ObjectDataSource component is to provide data to the report in a declarative manner. The ObjectDataSource.DataSource should be the assembly qualified name or Type of the data access layer (class), where the reporting engine will use System.Reflection to create the instance of the class (by using its default constructor) and to execute its method specified by the ObjectDataSource.DataMember.
    If you want to use already created data objects, you can skip the creating of a data source component.


    Once the report is designed, it can be displayed in an HTML5 Viewer suitable for any web application. If you are more comfortable to work with a wrapper for MVC, you can use the HTML5 ASP.NET MVC Viewer (wrapper) that renders its settings (markup and code) into the original Javascript object required for creating an HTML5 Viewer. The VS item template for adding the viewer will start a wizard to let you select the report for the initial configuration of the viewer.

    The available MVC and WebForms wrappers of the HTML5 Viewer let you specify the viewer's ReportSource.Report and ReportSource.Parameters in code in a declarative manner. When you use a client-side TypeReportSource (Report = TypeReportSource.TypeName and Parameters = TypeReportSource.Parameters). When you use a client-side UriReportSource (Report = UriReportSource.Uri and Parameters=UriReportSource.Parameters). Each wrapper provides means to let you send a custom string and parameters collection, in case of using a custom resolver for the reporting rest service. The type name is an assembly qualified name of a report class. The uri is a relative path to a file on the server where the Reporting REST service is hosted (the path is added to the folder mapped by the service's ReportFileResolver). The viewer sends only short string messages to the server, and data objects cannot be serialized and transferred by the client.
    For more details, please check How to: Set ReportSource for Report Viewers.


    Having the above into account, changing the connection string at run-time can happen in a custom resolver for the Reporting REST service e.g this simplified example and Changing the connection string dynamically according to runtime data.


    You can check also the local examples installed by default under C:\Program Files (x86)\Telerik\Reporting R3 2016\Examples\CSharp.
    It is recommended to have reports, data access layer and UI in separate projects.

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top