Q1 to pure .net core with R1

2 posts, 0 answers
  1. nethanlor
    nethanlor avatar
    1 posts
    Member since:
    Jan 2019

    Posted 01 Feb Link to this post

    Hello there!

    I would like to know if it's possible to reuse all of our Q1 2016 TypeReport (.cs and .designer.cs) in a pure .net core 2.1 app? Do I to rewrite them in the TRDP format?

    I read in the implemented features and limitations that : 

    • [...] type reports are not supported. In such scenario the reports can be converted to .trdx/.trdp definitions through the Standalone Report Designer’s Import Wizard or these classes can be used as a runtime-created report instances.
    • The supported report definition types are TRDX, TRDP and report classes, created in Visual studio without the VS designer-specific code.

    Does that mean I can copy my report cs/designer files into a new .net core project and call them through code?
    I did migrate with the upgrade wizard my .net 4.6 project but I did not manage the import the report files with the stand alone report designer. I always get an error message.

    Thanks!

  2. Silviya
    Admin
    Silviya avatar
    335 posts

    Posted 06 Feb Link to this post

    Hi nethanlor,

    The class library that contains report definitions must target .NET Framework 4.0 or greater in order to provide design-time support in Visual Studio through the Visual Studio Report Designer. Such library cannot be referenced in a .NET Core project because .NET Core projects can reference only .NET Standard or .NET Core assemblies (see this post for detailed explanation). Therefore the existing type report definitions must be migrated to a .NET Standard or .NET Core class library. The drawback is that there is no design-time support for .NET Core or .NET Standard and the Visual Studio Report Designer cannot be used in such projects. This is mainly because of the current limitations of the framework and Visual Studio toolset (for example, ComponentDesigner class which is used as a base class for our components, is not yet supported by .NET Core framework).

    There are two approaches to resolve the problem depending on the amount of custom code used in the report definitions.
    1. If the report classes do not contain custom code (i.e. handlers for events like NeedDataSourceItemDataBound, etc.) or this code can be substituted with conditional formatting and bindings in the report definition, it is recommended to use the Standalone Report Designer to import them into a set of .trdp/.trdx reports, as explained in How to: Import reports created with the VS Report Designer. The .trdp/.trdx definitions now can be used through a UriReportSource in a .NET Core application.
    2. If the custom code in the report definitions must be retained, copy the code from .cs and .designer.cs files of your reports to a new .NET Standard or .NET Core library. Add references to NuGet packages for the missing classes (i.e. System.Drawing.Common for the PaperKind class) and remove all the references to VisualStudio-specific routines. Once the project compiles, the report classes it contains can be used through a TypeReportSource or InstanceReportSource in a .NET Core application.

    It is recommended to use the first approach and migrate the reports to .trdp or .trdx report definitions, so the design-time support will be provided by the Standalone Report Designer.

    I hope that this information would be helpful.

    Still, I'm not sure what is the error message that you received after trying to import a report created in ClassLibrary (or ReportLibrary) project. Could you provide more information or step-by-step instructions in order to test it locally?

    Regards,
    Silviya
    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