Using the Report Viewer with .Net Core 8 and WiseJ.Net

Stimulsoft Reports.WEB discussion
Post Reply
compuaid
Posts: 14
Joined: Mon Aug 22, 2022 3:30 pm

Using the Report Viewer with .Net Core 8 and WiseJ.Net

Post by compuaid »

I am trying to integrate the web viewer and web designer inside an AspNetControl in WiseJ.Net 3.5. The target frameworks are automatically set up by the Wisej template as 4.7 and .Net 8.0. When I try to use the StiWebViewer reference in my code I get a message in Visual Studio that the StiWebViewer is not available in .Net 8.0.

This is the code I'm attempting to use to define the StiWiseJWebViwer class:

Code: Select all

using Stimulsoft.Report;
using Stimulsoft.Report.Web;
using System;
using System.ComponentModel;
using Wisej.Web;
using Wisej.Web.Ext.AspNetControl;

namespace Using_the_Viewer_in_Wisej_NET
{
    [ToolboxItem(true)]
    public class StiWisejWebViewer : AspNetWrapper<StiWebViewer> // ************* The first error occurs here *************
    {
        #region Properties
        /// <summary>
        /// Returns the Stimulsoft designer instance.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public StiWebViewer Viewer // ******** The second error occurs here **********
        {
            get { return this.WrappedControl; }
        }

        public StiReport Report
        {
            get
            {
                return this.Viewer.Report;
            }
            set
            {
                this.Viewer.Report = value;
            }
        }
        #endregion

        #region Implementations
        protected override void OnPreInit(EventArgs e)
        {
            // set viewer options
            if (this.Viewer != null)
            {
                this.Viewer.Localization = Application.MapPath("Localization\\en.xml");
                this.Viewer.Theme = StiViewerTheme.Office2022BlackOrange;
                this.Viewer.FullScreenMode = true;

                // attach the handled events to fire the event on the wrapper.

                if (this.GetReport != null)
                    this.Viewer.GetReport += this.GetReport;

                if (this.PrintReport != null)
                    this.Viewer.PrintReport += this.PrintReport;

                if (this.ExportReport != null)
                    this.Viewer.ExportReport += this.ExportReport;

                if (this.Interaction != null)
                    this.Viewer.Interaction += this.Interaction;
            }

            base.OnPreInit(e);
        }
        #endregion

        #region Events
        /// <summary>
        /// LoadReport event.
        /// </summary>
        public event StiReportDataEventHandler GetReport;

        /// <summary>
        /// CreateReport event.
        /// </summary>
        public event StiPrintReportEventHandler PrintReport;

        /// <summary>
        /// PreviewReport event.
        /// </summary>
        public event StiExportReportEventHandler ExportReport;

        /// <summary>
        /// SaveReport event.
        /// </summary>
        public event StiReportDataEventHandler Interaction;
        #endregion
    }
}
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using the Report Viewer with .Net Core 8 and WiseJ.Net

Post by Lech Kulikowski »

Hello,

You should use the StiNetCoreViewer. The StiWebViewer is available only for the NET Framework.

Thank you.
Post Reply