ActiveReports 14 .NET Edition
ActiveReports 14 User Guide / Concepts / Section Report Concepts / Designing Code-based Section Reports in .NET Core
In This Topic
    Designing Code-based Section Reports in .NET Core
    In This Topic

    The existing limitation in .NET Core 3.1 does not allow the ActiveReports Integrated Designer to be used for designing Code-based Section Reports in WinForms applications in Visual Studio.
    As workaround, you need to use Visual Studio's option to link report files from .NET Core project in the .NET Framework project, and use the .NET Framework WinForms Designer.

     

    The steps to enable design-time report creation in .NET Core project for Code-Based Section reports are as follows:

    1. Create a new Windows Forms .NET Core project.


      Create a new project window

      Configure your new project dialog
    2. Add the code-based section report item to the .NET Core project. To do so, right-click the project and go to Add > New Item.

      Solution Explorer
    3. Select ActiveReports 14 Section Report (code-based) report item. All the required dependencies will be installed automatically.

      Add New Item dialog
    4. Add a new .NET Framework project using built-in Section Report (code-based) template.

      1. In the Solution Explorer, right-click the solution node and go to AddNew Project.

        Solution Explorer
      2. Select ActiveReports 14 Section Report Application (code-based) template and configure the project for the target .NET Framework version.


        Add a new project dialog

        Configure your new project dialog
    5. Remove the code-based report (SectionReport1.cs) from the .NET Framework project, which was added automatically in the previous step.

      section report moved to net core project
    6. Add report from the .NET Core project to the .NET Framework project as link.

      1. In the Solution Explorer, right-click the .NET Framework project, go to Add > Add Existing Item.
      2. Navigate to the .NET Core project and select report files: 'SectionReport1.cs', 'SectionReport.Designer1.cs', and 'SectionReport1.resx'.
      3. Select Add As Link option to add the report files as link.
        Solution Explorer

        added section report

    7. Update the .csproj file of the .NET Framework project.

      You need to add the dependency information in the .csproj file of the .NET Framework project. The instruction to do so are as follows:
      1. In the Solution Explorer, right, right-click the .NET Framework project node and select Edit Project File.
      2. In the .csproj file that opens, find the line 

        <Compile Include="..\WindowsFormsAppCore\SectionReport1.Designer.cs">

        and insert

        <DependentUpon>SectionReport1.cs</DependentUpon> as follows:


        <Compile Include="..\WindowsFormsAppCore\SectionReport1.Designer.cs">
        <Link>SectionReport1.Designer.cs</Link>
        <DependentUpon>SectionReport1.cs</DependentUpon>
        </Compile>

      Note: If you do not find the .csproj file, you will need to first unload the project:

      1. In the Solution Explorer, right-click the .NET Framework project node and select Unload Project.

      2. Again, right-click the project, select Edit projectname.csproj, and modify the project file as described before.

    8. Double-click the linked SectionReport1.cs (in .Net Framework project) to open the ActiveReports Integrated Designer for the report.

      added section report
    9. Now design the report. The following gif shows how the modification of a report in .NET Framework project leads to modification of the report in the .NET Core project.

      added section report