solution of upgrading our old telerik report from using VS designer to Web Designer

4 Answers 710 Views
Converters DataSources Report Designer - Web Report Designer (standalone) Upgrade
Jx
Top achievements
Rank 1
Iron
Jx asked on 24 May 2021, 05:48 AM | edited on 26 May 2021, 07:00 AM

Hi, currently we are using version 12.2.18.1017 of telerik reporting.

we are thinking of upgrading to the latest version since you guys have release the web designer which is really awesome.

however, we are still using VS designer to modified all the template. as far as I know, if we want to use web designer, we need to convert all templates to standalone template.

our currently project is rely on the report REST Service to get the report. we may want to switch away from the REST service or may be stay on it depends what is it offered in web designer.

So here are my questions:

1. What would be best solution for us from your perspective / expertise?

2. If we want to convert our old VS template to standalone template, how do we do it. We are using store procedure as Data source which means our old template is not parameterless (I think). What is the best way to convert them?

an example of how we import the data right now is attached in the file.

 

 

Recent update, I have managed to convert the file from our class object to trdx format. I am thinking to store it inside our DB so that we can call this format from an RESP API endpoint and present it to the html designer.

However, this template has alot funtions. not sure how would I called those functions if I am trying to access the template from a standalone designer or a html designer.

new xml file is attached.

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 26 May 2021, 01:52 PM

Hi Jx,

If I understand correctly, currently you are using the Visual Studio Designer and your reports are in the .CS format, is that correct? If that is the case, then indeed you will need to convert them to trdp/trdx files as the Web Report Designer does not work with .CS reports. For this task, you may use the Standalone Designer to convert the reports into the correct format - How to import reports created with the VS Report Designer. It should successfully convert it to the template format without needing to do extra work on the report, the stored procedures should also work as expected after the conversion, if they do not, please let us know about that.

Regarding REST services, the Web Report Designer uses a dedicated REST service as a backend. The service is responsible for the storage operations like creating, opening, or saving report definitions in a specified folder, as well as handling the various requests that concern server-side processing and rendering. The Web Report Designer can not work without a REST service doing the backend tasks.

Also, I noticed that you are using an ObjectDataSource in the report definition that you have sent me. At the current time, the ObjectDataSource is not greatly supported in the Web Designer, for more information, please see - Web Report Designer doesn't have design-time support for ObjectDataSource component

Regarding the functions, I am not sure exactly what you mean by that but if you mean user functions, they can be used in the Standalone designer but not in the Web Designer. For more information, you may check Extending Report Designer.

Regarding using DB storage, Out-of-the-box we provide a FileDefinitionStorage that is configured to use the file system. To open reports stored differently, you need to implement the IDefinitionStorage interface. This will enable the web designer to load reports from a custom location, such as a database, cloud, in-memory, etc. For more information, please see How to implement a report definition storage

Please note that while the current version of the Web Report Designer offers beyond-basics functionality, it is still under active development. Please give it a thorough review to make sure the designer fits your scenario before including it in a production project.

I hope you will find the provided information helpful, please let us know if you have any other questions.

Regards,
Dimitar
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
Jx
Top achievements
Rank 1
Iron
answered on 27 May 2021, 12:28 AM | edited on 27 May 2021, 05:20 AM

Hi Dimitar,

Thanks for getting back to me. Our company is using telerik since 2018 however the one who build the telerik report with REST Service has gone and I am the one who is now that picking up the project. So I am sorry if things that I mentioned in the question don't make sense because I am still learning it.

1. Yes we use store procedure however I forgot to mention we actually using dapper to call those SP. and our template is in .cs file.

2. For Telerik Web Designer, yes it looks promising and most of the functionalities are good enough. the primary goal for us to using the Web designer is to allow our customer / end-user to custom the template themselves regarding to fonts, colors, potions and decimals places etc..

However, I still have a few questions and concerns.

1. If we are trying to use web designer for our end-users. It's possible to hide the connection string or datasource to our user so they cannot change the datasource or add new datasource.

2. If we want to store the template in either cloud or DB. how do we programatically save the tempalte after end-user have changed the template. any article that can explain would be nice.

3. If we use RESTFUL API, instead of getting template from dll or local folders that contains the .cs file (im not sure which one it's actually getting from). Can we get the template from database or cloud to rendering the report? is it the same as that you mentioned FileDefinitionStorage?

4. in FileDefinitionStorage documentation,if i am correct, to get the template is using GetDefinition Function in the example. the byte[] is the actually template file whatever we store right?

 

0
Dimitar
Telerik team
answered on 31 May 2021, 05:00 PM

Hello Jx,

Regarding using custom templates, styles, etc. in the Web Designer, we currently have a feature request about such functionality that you may vote for if that is something you would like to see implemented in the future - Make Web Report Designer UI customizable.

I am not familiar with Dapper and I don't remember clients that have mentioned using it, but you may create a demo project or use one of our demos to test and see if you can make it work. As I mentioned in my last reply, you can follow the How to import reports created with the VS Report Designer article to import a CS file to a trdp/trdx that you can then use in the web designer.

Regarding the first question, I am not sure what exactly you mean by hiding the connection string, perhaps you mean to hide a certain option when creating a SqlDataSource component? I don't think that is possible, however, you could hide data source components from the users, so you can simply hide the SqlDataSource if you do not wish to have the users see it as an option. For example, you can hide the CsvDataSource with the following CSS:

 [aria-label = "CSV Data Source"] {
        display: none !important;
    }

Perhaps you may want such features as setting to set in the web report designer, if that functionality would important to you, you may make a feature request about it on our feedback portal.

Regarding the second and third questions, you can use a DB as storage for the reports if you can implement the IDefinitionStorage as explained in the article - How to implement a report definition storage. The saving of the report happens through the SaveDefinition method in which, in the case where you are using a DB, you can save the report definiton bytes to the database. Users can save the report through the UI of the web designer, from the menu in the bottom left. If you have checked the demos, we do not allow saving in them so the save option will not be visible in the menu but if you run the integration demos in the install directory of reporting, you will see the Save option available in the menu. And to answer the question regarding the templates, yes you can get them from a DB by implementing the GetDefinition method.

Regarding the last question, yes the byte[] being returned should be the report definition extracted either from a folder, a database, cloud, etc.

I hope this information will be helpful to you, please do not hesitate to ask if you have any other questions.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
0
Bob
Top achievements
Rank 1
Iron
Iron
Iron
answered on 30 Jun 2024, 11:09 PM | edited on 30 Jun 2024, 11:10 PM

Hello,

We very recently upgrade our very old Telerik.Reporting framework to the v18 2024 QA (.305) release with .Net Framework 4.6. It worked out well, and our ReportsController was able to call down into the Reports.dll (which was built from our Reports project, from the very old designer going back probably 10 years ago). And everything renders in the browser under the v18 ReportViewer.html template in our Angular app.

Now our big problem: all of these .cs report designs are no longer opening in Visual Studio 2022. I've tried to import via the StandAlone Designer tool, but so far getting some Windows.Forms 4.0 errors.

What's my best way forward to getting these up and running as soon as possible, without redesigning everything from scratch - not to mention that the Charts lib is no longer available.

Please help.

Bob

Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 30 Jun 2024, 11:10 PM

sorry, this was not meant as an "Answer"
Dimitar
Telerik team
commented on 03 Jul 2024, 02:15 PM

Hello Bob,

Have you by chance migrated the "Reports" project to .NET? If yes, that would explain why the Visual Studio Report Designer does not open and why the reports cannot be converted in the Standalone Report Designer tool.

If that is indeed the case, you may create a new .NET Framework Class Library project in which you may copy the existing .CS reports. You may build the project, then use the produced .DLL to import those reports into TRDP files through the Standalone Report Designer -  Importing reports created with the Visual Studio Report Designer - Telerik Reporting. However, before performing the conversion, you will need to re-create the charts with the new Graph item, otherwise they might get lost during the conversion. 

If your "Reports" project is still targeting .NEt Framework, then the issue may be due to not all Telerik Reporting assemblies referenced in the project not being updated or that some of them are missing. I recommend running the "Upgrade Wizard" tool from the Telerik Reporting VS Extension if that is the case - Using the Upgrade Wizard - Telerik Reporting. Even if the project is still targeting .NET Framework and continues to do so in the future, it is still recommended to re-create the charts with the Graph item.

 

  

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

Hi Dimitar,

Thank you for your response. I actually have some of the details in my original post here: https://www.telerik.com/forums/charting-namespace-no-longer-exists-in-core

And in my response to Dess (at 01 Jul 2024, 11:19 AM), I showed how I launched the Standalone Designer to "open" that .net framework DLL

(produced by building my old 4.6 framework "Reports" project containing all those .cs designer reports).

It just crashes out on the connection string (inside our connectionResolver.cs code) on this line:

ConfigurationManager.ConnectionStrings["serverName"].ConnectionString

 

I also REMOVED the Chart item, and replaced it with the Graph item. I did that within our old Framework project, which still uses your old Reports Designer extension. So using the older reports designer, and with the v18 Q2 telerik.reporting package for framework 4.62, I can get access to the reports design tools, etc. That's where I removed the Chart item in every rept.

 

 

It really would be great to have your tool convert to the new format so we can move on with our .Net 8 upgrade.

Again, we already upgraded our main API Solution to .Net 8, and also pulled the latest Telerik.Report v18 Q2 nuget packages (.514 build) into our API project. But we kept the OLD Telerik framework "Reports" project reference in there, hoping we could still run it that way - i.e. .Net 8 calling into a Framework project.

We also updated our ReportsController.cs to use your IReportServiceConfiguration

 

 public ReportsController(IReportServiceConfiguration reportServiceConfiguration)
     : base(reportServiceConfiguration)
 {
 }

So it does partially work; meaning, it renders the initial Telerik.Viewer.v18...514.html page within our web app. I can also debug the whole API project on localhost on my dev box - until it calls into t a specific Report. Once it hits the ReportManager in the framework project - it crashes out on the connection string.

This is also AFTER removing Charts ..

 

Thank you,

 

 

 

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

Hi Dimitar,

I also tried to upgrade the framework "Reports" project to .Net 8. I also used the "Upgrade wizard" off the Reporting menu under Extensions.

The upgrade to .Net 8 at the project level was successful, and no build errors. And again, the Chart item already removed.

However, at this point I cannot fully render the initial Reports Manager page.

I assume it's because the Report files are still in the OLD Telerik format, and not converted to the newer TRDP format.


{
    "Message": "",
    "ExceptionMessage": "Report 'SynReports.ReportCatalog%2C%20SynReports' cannot be resolved.",
    "ExceptionType": "InvalidReportException",
    "StackTrace": null
}

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

Good news. I creatively hacked our connection string code and hard coded some values to bypass the older ConfigurationManager, which no longer works in our envir.

Now your import tool worked !

Dimitar
Telerik team
commented on 08 Jul 2024, 11:07 AM

Thanks for the update Bob,  I am glad to hear that you were able to convert the reports!

About the error from the previous reply, with the "unable to get report parameters" message, usually, this is caused by the Reporting REST Service, and its UriReportSoutceResolver, being unable to locate the TRDP/TRDX file at the given directory.

For details on how to fix that, as well as other possible reasons for the issue, you may visit the Unable to get report parameters - Report reportName cannot be resolved - Telerik Reporting KB article.

Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 08 Jul 2024, 09:04 PM

Can you help to clarify how my ReportsController will now resolve into my new "Reports" folder, in which I have now placed all the newly-converted .trdp files ?

I just rt-clicked on my Solution and added a new folder, then copied those TRDP files into that.

I'm reading thru lots of Telerik docs, so anything more specific would help.

Again, I'm using vs2022 in a .Net 8 environment.

Here's what my Report Config looks like in Program.cs -


// Configure dependencies for ReportsController.
builder.Services.TryAddSingleton<IReportServiceConfiguration>(sp =>
    new ReportServiceConfiguration
    {
        // The default ReportingEngineConfiguration will be initialized from appsettings.json or appsettings.{EnvironmentName}.json:
        ReportingEngineConfiguration = sp.GetService<IConfiguration>(),

        // In case the ReportingEngineConfiguration needs to be loaded from a specific configuration file, use the approach below:
        //ReportingEngineConfiguration = ResolveSpecificReportingConfiguration(sp.GetService<IWebHostEnvironment>()),
        HostAppId = "HarmonyReports",
        Storage = new FileStorage(),
                                                                                 
        ReportSourceResolver = new UriReportSourceResolver(Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "Reports"))
    });

 

and ReportsController.cs

 


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

namespace HarmonyWAPICore.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ReportsController : ReportsControllerBase
    {

        public ReportsController(IReportServiceConfiguration reportServiceConfiguration)
            : base(reportServiceConfiguration)
        {
        }

    }
}

 

 

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

Hi again,

It turns out that I had a Object Data Source in my old VS project which calls into our c# Assembly (as seen in the screenshot).

And that ReportManager (seen in the screen shot) is a cs file which uses Reflection to get the available report names. This would setup the list of reports - before actually making any SQL SP connection.

So it looks like we'll have to find a different way to list the reports (using the Standalone Designer) for the user to choose to display.

Here's a screen shot of our OLD visual studio project, if I rt-click to Configure an ObjDataSource:

and in the Standalone Report Designer, after the upgrade tool converted to .trdp format - of course there are NO business object because that ReportManager.cs above is NOT a design file.

 

In the meantime, we found something regarding viewing the Designer within a .Net Core project: https://docs.telerik.com/reporting/knowledge-base/how-to-use-vs-designer-in-dotnet-core

Dimitar
Telerik team
commented on 11 Jul 2024, 03:18 PM | edited

Hello Bob,

Let me start with the topic of how the TRDP reports from the "Reports" folder can be resolved by the reporting service. The TRDP/TRDX/TRBP reports are resolved by the UriReportSourceResolver, and it uses the directory provided to its constructor as the base directory:

// Configure dependencies for ReportsController.
builder.Services.TryAddSingleton<IReportServiceConfiguration>(sp =>
    new ReportServiceConfiguration
    {
        // The default ReportingEngineConfiguration will be initialized from appsettings.json or appsettings.{EnvironmentName}.json:
        ReportingEngineConfiguration = sp.GetService<IConfiguration>(),

        // In case the ReportingEngineConfiguration needs to be loaded from a specific configuration file, use the approach below:
        //ReportingEngineConfiguration = ResolveSpecificReportingConfiguration(sp.GetService<IWebHostEnvironment>()),
        HostAppId = "HarmonyReports",
        Storage = new FileStorage(),
                                                                                 
        ReportSourceResolver = new UriReportSourceResolver(Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "Reports"))
    });

The path that you have used in your previous reply already looks to be correct but please double-check to be sure. I cannot determine from the image if the "Reports" folder is at the root level of the project's base dir or if it is somewhere else.

Regarding the ObjectDataSource component situation, this component can be used in TRDP/TRDX reports as well. You may follow the Connecting the ObjectDataSource component to a Data Source explained - Telerik Reporting article for details on how to use this component while the report is rendered in a report designer, report viewer or through the ReportProcessor.

Regarding using the VS Designer in .NET, yes, there is a workaround explained in the article that you have found - Use VS Report Designer to edit CS Reports in .NET. - Telerik Reporting, however, it is not recommended as to use it, you would need to keep two separate class library projects up-to-date which for a lot of reports may be quite cumbersome work, and since the ObjectDataSource can be used in the other report definition formats as well, there is no need to use this workaround.

Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 11 Jul 2024, 11:46 PM | edited

Hi Dimitar,

I struggled yesterday to connect the ReportDesigner's ObjDataSource to my .Net 8 Assembly, as it seemed to only work intermittently - but then at some point it never saw my assembly any longer. i.e. I followed the instructions in that link above, "Connecting the ODS component to a...".

Today, however, I built my .Net 8 ClassLib as Debug x64. I also copied that DLL over to the Telerik .NET Designer folder. After updating the designer config file with my AssemblyInfo, the Designer tool finally recognized my ClassLib DLL.

I think your "connecting-the-objectdatasource" online doc needs to be updated. It still says "Visual Studio is a 32-bit application...", but I'm running VS2022 Pro 64bit. And it seems that building my DLL as "Debug/AnyCPU" did not work, however the x64 build worked (i.e. the designer tool does see my Assembly info).

DETAILS:

Acc. to Connect a DataSourceObject, I did the following:

1) Add a Class Library Project to my current Solution (which I did via VS2022 X64).

2) Copy my new ClassLib.dll files to C:\Program Files (x86)\Progress\Telerik Reporting 2024 Q2\Report Designer\.NET

3) Add the assemblyReferences section to your Telerik.ReportDesigner.exe.config file

4) Run the designer exe at C:\Program Files (x86)\Progress\Telerik Reporting 2024 Q2\Report Designer\.NET\Telerik.ReportDesigner.exe

5) Create a new trdp report. go to Data tab, and add the ObjDataSource. The AssemblyInfo and methods would then show up (which it did a couple of times).

6) In your .Net API project, you may also need to add a reference to your new class library created in step 1.

 

And SynergyReportsLibrary.cs

 

namespace SynergyReportsLibrary
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Reflection;
    using System.Text;

    public class ReportInfo
    {
        string name;
        string description;
        Type reportType;
        bool isVisible;

        public string Name
        {
            get { return this.name; }
            set { this.name = value; }
        }

        public string Description
        {
            get { return this.description; }
            set { this.description = value; }
        }

        public string AssemblyQualifiedName
        {
            get
            {
                return this.reportType.AssemblyQualifiedName;
            }
        }

        public Type ReportType
        {
            get { return this.reportType; }
            set { this.reportType = value; }
        }

        public bool IsVisible
        {
            get { return this.isVisible; }
            set { this.isVisible = value; }
        }

        public ReportInfo(string name
            , string description
            , Type reportType
            , bool isVisible)
        {
            this.name = name;
            this.description = description;
            this.reportType = reportType;
            this.isVisible = isVisible;
        }
    }

    public class ReportManager
    {
        Assembly reportAssembly;       

        public ReportManager()
            : this(typeof(ReportManager).Assembly)
        {
        }

        public ReportManager(Assembly reportAssembly)
        {
            this.reportAssembly = reportAssembly;
        }

        public IEnumerable<ReportInfo> GetReports()
        {
            if (null != this.reportAssembly)
            {
                foreach (Type t in this.reportAssembly.GetTypes())
                {
                    if (typeof(Telerik.Reporting.IReportDocument).IsAssignableFrom(t)
                        && !t.IsAbstract)
                    {
                        yield return CreateReportInfo(t);
                    }
                }
            }
        }

        static ReportInfo CreateReportInfo(Type t)
        {
            string description = string.Empty;
            bool isVisible = true;
            object[] attributes = null;

            attributes = t.GetCustomAttributes(typeof(DescriptionAttribute), false);
            if (attributes.Length > 0)
            {
                description = ((DescriptionAttribute)attributes[0]).Description;
            }

            attributes = t.GetCustomAttributes(typeof(BrowsableAttribute), false);
            if (attributes.Length > 0)
            {
                isVisible = ((BrowsableAttribute)attributes[0]).Browsable;
            }

            return new ReportInfo(FormatName(t.Name)
                , FormatDescription(description)
                , t
                , isVisible);
        }

        static string FormatDescription(string text)
        {
            if (!text.EndsWith("."))
            {
                text += ".";
            }
            return text;
        }

        static string FormatName(string name)
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < name.Length; i++)
            {
                char c = name[i];
                if (i == 0)
                {
                    c = Char.ToUpper(c);
                }
                else if (Char.IsUpper(c))
                {
                    sb.Append(" ");
                }
                sb.Append(c);
            }
            return sb.ToString();
        }
    }
}

 

Perhaps you can clarify some of the technical gaps here.

thank you again...

Bob

 

 

 

Dimitar
Telerik team
commented on 16 Jul 2024, 02:22 PM

Hello Bob,

You are correct, Visual Studio 2022 is a 64-bit application and I have created a PR on our docs repo to add a small note about that.

With that being said, I am surprised that the assembly wasn't loaded when it was built for "Any CPU". I am not sure why it did not work but it is expected to work without having to explicitly target 64-bit.

As a side, both the Standalone Report Designer for .NET Framework and .NET have 32-bit executable files that are located in the same directory as the main 64-bit exe. You may use that if you ever need to use 32-bit assemblies.

One thing that I find strange is that in the steps that you have listed to finally connect to the ObjectDataSource component, it seems that you are using the Standalone Report Designer for .NET Framework which should not be able to load .NET 8 assemblies. Perhaps you meant to paste the path for the .NET Designer - C:\Program Files (x86)\Progress\Telerik Reporting 2024 Q2\Report Designer\.NET.

About the last step, besides adding a reference to the custom assembly in the API project, it will also be necessary to register it in the configuration file - Configuration for the Report Viewer/Web Report Designer.

 

Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 16 Jul 2024, 05:25 PM | edited

Hi Dimitar,

Yes, I meant to say "...ReportDesinger\.NET" when running the standalone tool. Initially I was a bit unclear, but eventually figured it out. I'll update my original comment.

And yes, I also updated the Telerik Config file in that same .Net folder (in step 3 above).

All is going well at this point. I'm actually trying to resolve our encrypted connection string. I'd  like to store the encrypted string in your config file and decrypt it at runtime. There's a separate forum post for that. https://www.telerik.com/forums/can-i-encrypt-my-connection-string-for-telerik-reporting

 

Thanks again,

Bob

Bob
Top achievements
Rank 1
Iron
Iron
Iron
commented on 06 Aug 2024, 06:31 PM

Hi Dimitar,

Everything worked out great, thanks to your help.

Only one minor question re: creating graphs. I couldn't find any real good video tutorial for creating pie charts via the Standalone designer. I only found vids re: the online report creator.

I did use this as a reference, and it was somewhat helpful. https://docs.telerik.com/reporting/report-items/graph/chart-types/pie

Thanks again.

Bob

Dimitar
Telerik team
commented on 09 Aug 2024, 08:57 AM

Hi Bob,

We do not have a video specifically for creating a Pie Chart in the Standalone Report Designer, however, we do have content for creating graphs in general that you can find in the Virtual Classroom - Video Tutorials for Starting with Telerik Reporting - Telerik Reporting.

The content about creating graphs is the last video in Chapter 3 of the Virtual Classroom. I hope that it will be of use to you. 

Tags
Converters DataSources Report Designer - Web Report Designer (standalone) Upgrade
Asked by
Jx
Top achievements
Rank 1
Iron
Answers by
Dimitar
Telerik team
Jx
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or