Charting namespace no longer exists in core.

1 Answer 52 Views
.NET Core
Bob
Top achievements
Rank 1
Iron
Iron
Iron
Bob asked on 26 Jun 2024, 09:31 PM | edited on 27 Jun 2024, 02:05 PM

Hello,

We have recently upgraded our .net solutions/projects to .Net 8.0.

In our old version, we have a ReportsController.cs which requests into the v18 Telerik.Reports framework project, and renders the report on the front end view the TelerikHtmlViewer template.

ex/ The Report Controller 4,6 framework code working fine with Telerik.Reporting.18.0.24.305.


using Microsoft.AspNetCore.Mvc;
using Telerik.Reporting.Services;

namespace HarWAPICore.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ReportsController : APIBaseController
    {
        static readonly ReportServiceConfiguration configurationInstance =
                new ReportServiceConfiguration
                {
                    HostAppId = "MyApp",
                    ReportSourceResolver = new UriReportSourceResolver(httpContextAccessor.HttpContext.GetServerVariable()..Current.Server.MapPath("~/Reports"))
                        .AddFallbackResolver(new TypeReportSourceResolver()),
                    Storage = new Telerik.Reporting.Cache.Interfaces.IStorageProvider(),
                };

        public ReportsController(IConfiguration configuration, IWebHostEnvironment hostEnvironment,
                IHttpContextAccessor httpContextAccessor) : base(configuration, hostEnvironment, httpContextAccessor)
        {
            ReportServiceConfiguration = configurationInstance;
        }
    }
}

 

And of course there's a separate Reports Projects with all of the Report designs, Charts, etc.

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

Now....after UPGRADING our Reports project to .Net 8 (via the Visual Studio upgrade tool) it is breaking on the Charts lib. And I found this link below that Charts is obsolete.

https://docs.telerik.com/reporting/report-items/chart-(obsolete)

Here's an example of one Exams.Designer.cs file that breaks everywhere on"Charting".


namespace MyReports
{
    partial class Exams
    {
        #region Component Designer generated code
        /// <summary>
        /// Required method for telerik Reporting designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Telerik.Reporting.TableGroup tableGroup1 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup2 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup3 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.NavigateToReportAction navigateToReportAction1 = new Telerik.Reporting.NavigateToReportAction();
            Telerik.Reporting.TypeReportSource typeReportSource1 = new Telerik.Reporting.TypeReportSource();
            Telerik.Reporting.Charting.Styles.ChartMargins chartMargins1 = new Telerik.Reporting.Charting.Styles.ChartMargins();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem1 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem2 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem3 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem4 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem5 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem6 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartAxisItem chartAxisItem7 = new Telerik.Reporting.Charting.ChartAxisItem();
            Telerik.Reporting.Charting.ChartSeries chartSeries1 = new Telerik.Reporting.Charting.ChartSeries();
            Telerik.Reporting.TableGroup tableGroup4 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup5 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup6 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.NavigateToReportAction navigateToReportAction2 = new Telerik.Reporting.NavigateToReportAction();
            Telerik.Reporting.TypeReportSource typeReportSource2 = new Telerik.Reporting.TypeReportSource();
            Telerik.Reporting.Charting.Styles.ChartMargins chartMargins2 = new Telerik.Reporting.Charting.Styles.ChartMargins();
            Telerik.Reporting.Charting.Styles.ChartMargins chartMargins3 = new Telerik.Reporting.Charting.Styles.ChartMargins();
            Telerik.Reporting.Charting.ChartSeries chartSeries2 = new Telerik.Reporting.Charting.ChartSeries();
...
...

 

Here's what it looks like after a rebuild.

What do I do at this point ? Can my API Core projectI somehow call into my old Reports Framework project? Or is there a Telerik upgrade tool that I can download ?

Please advise...

thanks,

Bob

Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 28 Jun 2024, 01:46 AM | edited

We made some progress and got past a big hurdle where it couldn't resolve the Reports DLL.

We downloaded and installed the v18...514 msi package, and created a new project to see how your system would scaffold it.

We used some code from your ReportsController.cs in .Net 8, and used it in our .Net 8 ReportsController.cs (with success).

We also added our OLD 4.6 Framework Reports project as a reference to our API Core Project.

This worked to resolve the to the Reports DLL, but our reports crash out on the CHARTS lib.

Our current idea is to separate out the old Telerik.Reporting DLLs, so our old framework reports project doesn't use the new Telerik Core DLL.

Any further ideas on what to do ? Again, we'd like to keep the OLD .Net Framework Reports projects working as-is, with charts and all.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Jul 2024, 02:50 PM

Hi, Bob,

I am glad to see that you achieved some progress in the application. However, I would like to note that as of Telerik Reporting Q1 2013, the Chart report item is superseded by the more advanced Graph report item. The Chart report item is not supported in .NET Core projects and in projects deployed on Azure.

I would recommend you to replace the chart item with a graph. The following section in the online documentation is quite useful about getting familiar with the graph: Getting Started with the Graph Report Item.

I hope you find this information helpful. Please, let me know if there is anything else I can assist you with.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 01 Jul 2024, 03:19 PM

Hi Dess,

Thank you for your response. And yes, I do see that the Graph lib replaces Charts.

So the progress we made was the face that our older .Net Framework API Solution (including the old ReportsController) was successfully upgraded to .Net 8. But now the big hurdle is to actually render our old framework reports.

Ideally I would like to have our .Net Core ReportsController.cs call into the old Telerik .Net Framework version of Reporting - but it seems impossible to separate those two DLLs - i.e. the v18 .Net 8 DLL gets built to bin\output and takes precedence.

Now in terms of these old .cs design files - is there a way to upgrade them and then remove all the reference to Charts ? Or as you said, perhaps convert to the Graph item if it's easy to accomplish..

 

And btw, I have tried to use the standalone Report Designer tool and "import" the old Reports DLL, but it's failing. i.e. I read this older post - https://www.telerik.com/forums/solution-of-upgrading-our-old-telerik-report-from-using-vs-designer-to-web-designer

This is what happens when Iaunch the Report Designer 2024 Q2 and try to OPEN our older SynergyReports.dll

 

 

Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 01 Jul 2024, 09:03 PM | edited

Dess,

We managed to get the .net framework 4.6.2 version (tele reports v18...514) of our reports working in Designer Mode within VS2022. We are now trying to convert those CHART widgets to use GRAPH instead. We have the toolbox open, and we can drag the Graph onto the design surface. We'll try to complete all the chart conversions, then eventually upgrade this whole proj to Core.

Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 01 Jul 2024, 10:04 PM

For anyone else reading this, if you're working on your old Framework project - you might need the Telerik Upgrade Wizard to bring the reports up to the latest Framework version (i.e. v18...514 , the Q2 2024 version).

I also needed to change my Target Framework to 4.62 - at which point the designer worked again in Vis Studio 22.


Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 03 Jul 2024, 10:02 PM

Good news. We managed to resolve the ConnectionString issue.

This line not working anymore in the old Reports framework project, cause at runtime all the new Core DLLs are loading.

ConfigurationManager.ConnectionStrings[name].ConnectionString;

So I had to hard-code some conn strings to get it all to work.

In the end, the Standalone import tool worked successfully.

Dess | Tech Support Engineer, Principal
Telerik team
commented on 04 Jul 2024, 08:20 AM

Hi, Bob,

I am really glad to hear that the problems you were facing are now resolved and the report is imported successfully.

Off topic, I am sharing with the community several useful articles related to the Upgrade Wizard option:

- Visual Studio Report Designer Not Available After Upgrading

Unable to Upgrade after Using the Upgrade Wizard

- Upgrade Wizard Overview

Should you have further questions please let me know.

Tags
.NET Core
Asked by
Bob
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or