This is a migrated thread and some comments may be shown as answers.

How to associate a report to the report Viewer

3 Answers 234 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
pierre-jean
Top achievements
Rank 1
Veteran
Iron
pierre-jean asked on 08 Sep 2020, 07:07 PM

Hello

 

I am trying to integrate reports in my Winform application but visible I am missing a step:

My application is a Winform application using an EntityFramework to manage the data (stored in y SQLServer database)

I have created a form with a Reportviewer in my project

In visual studio I have created a report (named rptStartList.vb) that has the datasource : rptEntityDataSource [Telerik.Reporting.EntityDataSource]
and the entityDatasource as a proper connectionstring, context ad contextdatamember. The report displays correctly the underlying data in preview

Now I need to "associate" this report to the report Viewer. I have read everything I found, but have failed to understand, in particular I do not understand how to

"Add reference to the class library that contains your reports in the windows form application." found in : https://docs.telerik.com/reporting/winforms-report-viewer-manual-setup

and how to create this class library and what is in it

Can you guide me on how to procee, clearly I am missing a, probably simple, step ....

Thanks in advance

P.S. should you have a complete sample application with the same environment I would appreciate greatly

3 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 11 Sep 2020, 12:06 PM

Hello pierre-jean,

If I understood correctly, you are not able to connect the report to the report viewer. Basically, with this step we mean that ou need to add a project reference in the project of the report viewer to the project of the report library (the project that contains rptStartList.vb).

Note that basically, we recommend adding the report viewer through our item template.

You can also check our WinForms demo which can be found in the installation folder of Telerik Reporting: C:\Program Files (x86)\Progress\Telerik Reporting Version\Examples\CSharp\WinFormsDemo.

Let us know if everything works as expected.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 11 Sep 2020, 05:01 PM

Hello Neli and thank you for your reply

With your guidance I have managed to create a test report as well as a report viewer in my main application 

Now I have a few of additional questions:

1. My Report is collecting the data from a EntityDataSource and I need to be able to change the connection of the data source to another database. In my main application I do this by passing the new connection string when I instanciate the SQLEntity:

------------------------------------------------------------------
Imports System.Data.Entity

Partial Public Class WJSQLEntities
    Inherits DbContext
    Public Sub New(ByVal connString As String)
        MyBase.New(connString)
        My.Settings.myConnectionString = connString
    End Sub
End Class

---------------------------------------

I guess I have to pass the new connection string to the telerik.reporting.datasource ? Where do I do this

 

2. I will have many reports how do I change the report source of the report viewer to switch from one report to another ?

my current viewer ReportSource is:

WJReportLibrary.rptStartList, WJReportLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

3. The data source of my report is a view on the database (through the entityframework) and I need to pass one or more parametres to it, where do I do it ? or even better I would like to pass to te report a list(of object) that is generate throug queries on the entity framework (as I do it to populate radgrids)

Sorry for these questions that may sound very basic, but I a new to telerik reporting

Thanks a lot

Best Regards

    

0
Neli
Telerik team
answered on 16 Sep 2020, 11:09 AM

Hi pierre-jean,

For the first questions, I would suggest to test the approach from Change Connection String dynamically through a report parameter article. For the second question, you can use Navigate to Report Action. For example, you can add a textbox with text "Go to next report", then set its Action property to be Navigate to Report and select the report source of the next report. For the last question, please test the approaches from the following articles:

- Using parameters with the EntityDataSource component;

- Retrieving data from an Entity Data Model with the EntityDataSource component

Please, do not hesitate to ask if you have any questions or if you need any assistance.

Regards,
Neli
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
General Discussions
Asked by
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Answers by
Neli
Telerik team
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Share this question
or