Telerik reporting with .net core

15 posts, 0 answers
  1. toppo
    toppo avatar
    9 posts
    Member since:
    Jun 2017

    Posted 16 Jan Link to this post

    Hello,

    I have a solution that contains multiple .net core 2.1 projects. 

    My main goal is to generate reports from within the same solution so I either need to reference a .net core 2.1 datamodel project that has all my data contexts. The problem right now is that because all the telerik reporting services and library projects are all still running .net 4.6.1 framework when I try to reference my datamodel project I'd get a bunch of reference errors.

    Would someone point me in the right direction to get this working?

    Thanks

  2. Ivan Hristov
    Admin
    Ivan Hristov avatar
    191 posts

    Posted 17 Jan Link to this post

    Hello,

    In our R1 2019 release which was published yesterday, we introduced a .NET Core support for projects that do not require targeting the full .NET Framework. Now you will be able to render reports from pure .NET Core applications. Please note that the design-time experience is not supported, so you will not be able to use the Visual Studio designer to create reports in a .NET Core class library. We recommend to use the Standalone Report Designer to design the reports or create them programmatically. Please check the related documentation article here: .NET Core support for more details.

    Our product now ships with an ASP.NET Core example designed to help you to get started using Telerik Reporting in a .NET Core environment. Please check the last release and feel free to share your feedback.

    Regards,
    Ivan Hristov
    Progress Telerik
    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
  3. toppo
    toppo avatar
    9 posts
    Member since:
    Jun 2017

    Posted 17 Jan in reply to Ivan Hristov Link to this post

    Hi Ivan,

    I see, is there any way for the Standalone Report Designer to use external assemblies based off of .net core library? I got the report to render in a .net core environment but only for reports that uses a sql datasource. In my case I need to use a object datasource that needs to take in methods from a .net core 2.1 library. Right now the Standalone Report Designer can only find assembly references for full .net 4.6.1 libraries.

    The reason for this is I have a .net core library project called DataModels and the way I wish to have this done is by having another .net core library project called ReportingLib or something along these lines that will have a provider class that uses the DataModel project to grab data from my database using Linq. These data inside my provider class will be used to generate the report (this is the part where I'm kind of stuck as the Standalone Report Designer only finds the full .NET framework libraries and not my .NET Core ones.)

    If I create a full .NET framework library, I won't be able to reference my DataModel project as I'll get reference errors due to the 2 framework mismatch.

    Are there any way around this?

    Thanks

  4. Scott
    Scott avatar
    37 posts
    Member since:
    Aug 2011

    Posted 17 Jan in reply to toppo Link to this post

    I am in need of this same functionality as well.

     

    Thanks,

    Scott

  5. Ivan Hristov
    Admin
    Ivan Hristov avatar
    191 posts

    Posted 21 Jan Link to this post

    Hi,

    Standalone Report Designer is a WPF application built using .NET Framework 4. By design it is impossible to add a .NET Core assembly reference to a .NET Framework project. The projects that target the full .NET Framework (4.6.1+) can reference .NET Standard assemblies but not .NET Core ones. This excellent post explains how to choose a target platform and how to reference it: How to reference a .NET Core library in WinForms - Or, .NET Standard Explained.

    If your scenario allows it, please change the target framework of the business classes library to .NET Standard and these classes should appear in Standalone Report Designer. Please note that if the class library has some dependencies to other assemblies, they should be added in the Standalone Report Designer folder and listed in <probing> configuration element, as explained here: Extending Report Designer.

    Hope this helps.

    Regards,
    Ivan Hristov
    Progress Telerik
    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
  6. Scott
    Scott avatar
    37 posts
    Member since:
    Aug 2011

    Posted 21 Jan in reply to Ivan Hristov Link to this post

    Thank for the reply, Ivan. In my case I can recompile my assemblies to .NET Standard so that works for me.

     

    Regards,

    Scott

  7. toppo
    toppo avatar
    9 posts
    Member since:
    Jun 2017

    Posted 21 Jan in reply to Ivan Hristov Link to this post

    Hi Ivan,

    Thanks for the help. For the time being I'll probably hold up on porting my libraries over to .net core as this may complicate things in the future for what I want it to do. 

    I've taken a look at .net core examples that came with R1 2019 and the targetted framework for that project is targetting .net 4.6.1. Is there any plans in the future to have Reporting that will work completely with .net core framework?

    And are we able to create a .net core api project that will allow me to make calls to your rest api without having it again to target 4.6.1. I'm just trying to have my projects be consistent with the rest and have it targetting the same framework if possible. (Seems like all the nuget packages that are required for the rest services to work all only work on 4.6.1 though).

    Thanks

  8. Ivan Hristov
    Admin
    Ivan Hristov avatar
    191 posts

    Posted 22 Jan Link to this post

    Hello Stanley,

    The Telerik Reporting R1 2019 installer should have installed a project called Asp.NetCoreDemo in the \Examples\CSharp subfolder of the installation directory. This project targets .NET Core 2.1 and is a working example of using the Reporting REST API in a ASP.NET Core web application. It uses the new SDK-style project and utilizes appsettings.json as a configuration file. The assembly references are resolved through NuGet packages. The project can be used in Windows and Linux environments because it employs Kestrel as a web server.

    Please refer to the attached screenshot that shows the loaded project and its Properties page and make sure you're not using the Asp.NetCoreFullDemo project, which shows how to use Telerik Reporting in a ASP.NET Core project that targets the full .NET Framework.

    Hope this helps.

    Regards,
    Ivan Hristov
    Progress Telerik
    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
  9. Scott
    Scott avatar
    37 posts
    Member since:
    Aug 2011

    Posted 24 Jan in reply to Ivan Hristov Link to this post

    Ivan,

    I have tried creating a test .Net Standard Library - I've tried 2.0, 1.6, and 1.5 - and I cannot get them to show up in the standalone Report Designer after copying them to the folder. I have full .NET Framework dll's that work fine. I'm not referencing any other assemblies, actually, I'll just include the code below. Any help appreciated - Scott

     

    using System.Collections.Generic;

    namespace ReportingLibrary
    {
        public class Data
        {
            public static List<Customer> RetrieveData()
            {
                var data = new List<Customer>();
                Customer c = new Customer(0, "Bilbo", "Baggins", 150.00);
                data.Add(c);
                return data;
            }
        }
            public class Customer
        {
            public Customer(int id, string firstname, string lastname, double balance)
            {
                ID = id;
                Firstname = firstname;
                Lastname = lastname;
                Balance = balance;
            }

            public int ID { get; set; }
            public string Firstname { get; set; }
            public string Lastname { get; set; }
            public double Balance { get; set; }
        }
    }

     

  10. toppo
    toppo avatar
    9 posts
    Member since:
    Jun 2017

    Posted 24 Jan in reply to Ivan Hristov Link to this post

    Thanks Ivan I've gotten most of what I wanted to work. 
  11. toppo
    toppo avatar
    9 posts
    Member since:
    Jun 2017

    Posted 24 Jan in reply to Scott Link to this post

    Hi Scott

    I've done what you were trying to do before. To get the report designer to find user defined functions you'd need to put the dll generated on build into the Report Designer folder in your Telerik/Progress folder Location could vary but for example: C:\Program Files (x86)\Progress\Telerik Reporting R1 2019\Report Designer. You'd then have to edit the Telerik.ReportDesigner.exe to include the assembly reference: example on how it's done and modify the app.config file of your library example here

  12. Scott
    Scott avatar
    37 posts
    Member since:
    Aug 2011

    Posted 24 Jan in reply to Scott Link to this post

    Ignore that last post please. It's working just fine with a .NET Standard 2.0 Library. I had an issue with my naming in the .config file.

    Regards,

    Scott

  13. Scott
    Scott avatar
    37 posts
    Member since:
    Aug 2011

    Posted 24 Jan in reply to Scott Link to this post

    Ivan,

    Ignore my last post please - it's working perfectly with a .NET Standard 2.0 DLL. I had a naming issue in the .config file of the Report Designer.

    Regards,

    Scott

  14. Scott
    Scott avatar
    37 posts
    Member since:
    Aug 2011

    Posted 24 Jan in reply to toppo Link to this post

    Thanks for taking the time to reply, toopo. I am good to go now. Take care.
  15. Ivan Hristov
    Admin
    Ivan Hristov avatar
    191 posts

    Posted 25 Jan Link to this post

    Hi guys,

    I'm glad the things on your side finally work well and thanks for sharing the problems and the solutions you came up with.

    If you need further assistance please do not hesitate to ask.

    Regards,
    Ivan Hristov
    Progress Telerik
    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