Error while starting Stimulsoft in Visual Studio

Stimulsoft Reports.NET discussion
Post Reply
StixStax
Posts: 46
Joined: Wed Aug 12, 2015 9:41 am

Error while starting Stimulsoft in Visual Studio

Post by StixStax »

Hi,

I'm trying to start Stimulsoft in Visual C# 2010 Express in order to debug. I've referenced dlls from the newest .Net Trial Version and tried to compile following code:

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            StiReport report = new StiReport();
            report.Load("C:\\1966.GanttWithDate.mrt");
            report.Render(false);
            report.Show();
        }
    }
}
I get the following stack trace:

at Stimulsoft.Report.StiGuiOptions.GetViewerForm(StiReport report, StiGuiMode guiMode)
at Stimulsoft.Report.StiReport.Show(Form parentForm, IWin32Window win32Window, Boolean dialogForm)
at Stimulsoft.Report.StiReport.Show()
at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\xx\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs:line 30
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsFormsApplication1.Program.Main() in C:\Users\xx\AppData\Local\Temporary Projects\WindowsFormsApplication1\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

with error: Assembly 'Stimulsoft.Report.Win' is not found

Is there any workaround for this issue?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error while starting Stimulsoft in Visual Studio

Post by HighAley »

Hello.

Please, add the Stimulsoft.Report.Win assembly to the Referenced Assemblies.

Thank you.
StixStax
Posts: 46
Joined: Wed Aug 12, 2015 9:41 am

Re: Error while starting Stimulsoft in Visual Studio

Post by StixStax »

Hey Aleksey,

I get the same result ...

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;
using Stimulsoft.Report.Win;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            StiReport report = new StiReport();
            report.Load("C:\\1966.GanttWithDate.mrt");
            report.Render(false);
            report.Show();
        }
    }
}
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error while starting Stimulsoft in Visual Studio

Post by HighAley »

Hello.

We wrote about project reference but not about using directive.
Please, add the Stimulsoft.Report.Win to the Project References.
Untitled.png
Untitled.png (23.14 KiB) Viewed 3788 times
Thank you.
StixStax
Posts: 46
Joined: Wed Aug 12, 2015 9:41 am

Re: Error while starting Stimulsoft in Visual Studio

Post by StixStax »

Hey Aleksey,

Code: Select all

using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Stimulsoft.Report.Win;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            stiReport1.Render();
            stiReport1.Show();
            
        }
    }
}
I already referenced Stimulsoft.Reprt.Win.dll that way. Same error. I installed the Visual Studio Community Version and it works now. With the code above I can open an empty rendered file, no option for designing a report. Following the video "Create report in visual studio" doen't help either because i don't have the option "Show report" in the context menu in visual studio. Is there a way to start the designer via code?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error while starting Stimulsoft in Visual Studio

Post by HighAley »

Hello.

To see Show Report item in Visual Studio you should add Stimulsoft.Report.Design assembly to project reference.
To call the Designer from code use Design() method.
You could get some additional information from Stimulsoft Reports.Net FAQ.

Thank you.
StixStax
Posts: 46
Joined: Wed Aug 12, 2015 9:41 am

Re: Error while starting Stimulsoft in Visual Studio

Post by StixStax »

Thanks that helped!
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error while starting Stimulsoft in Visual Studio

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
Post Reply