Error Message when in Custom Designer Control Form

Stimulsoft Reports.NET discussion
Post Reply
codemonkey
Posts: 12
Joined: Fri Jan 17, 2020 3:02 pm

Error Message when in Custom Designer Control Form

Post by codemonkey »

Hello!

I built a DLL with complete printing, rendering, filehandling, encryption, databasehandling and a designer form.
When i use the dll with my test Application everything works perfect.
I can call the dll and use it to create, open, edit, save, render and print reports.

If i use the same DLL with the same call from a .net dll loaded into a ACCESS application i can open the designer and see the report but the preview tab is missing and as soon as i move the mouse over the report window i get a unhandled exception. Printing and and rendering + preview of reports works fine.
If i click on continue i can again use the mouse and change datasources or variables but as soon as i hover over the report i get the message again.

Screenshot is in the attachments.
Crossing the red line triggers the exception

First lines of the exception.

Code: Select all

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei Stimulsoft.Report.QuickButtons.StiQuickButtonHelper.GetQuickButtons(Type type)
   bei Stimulsoft.Report.Design.StiDesignerControl.GetQuickButtons(StiComponent component) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report.Design\StiDesignerControl.IStiDesignerBase.cs:Zeile 199.
   bei Stimulsoft.Report.Design.Tools.StiSelectToolService.CheckQuickButtons() in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report.Design\Tools\StiSelectToolService.cs:Zeile 2852.
   bei Stimulsoft.Report.Design.Tools.StiSelectToolService.OnMouseMove(Object sender, MouseEventArgs e) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report.Design\Tools\StiSelectToolService.cs:Zeile 566.
   bei Stimulsoft.Report.Design.Controls.StiViewControl.OnMouseMove(MouseEventArgs e) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report.Design\Controls\StiViewControl.cs:Zeile 1501.
   bei System.Windows.Forms.Control.WmMouseMove(Message& m)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   
The Paths in the error message dont exist in my system.

Its probably something stupid on my end.

Do you have any idea how to fix that?

Do you need more information like code of the designer control form?

Greetings and thank you for your help in advance!
Attachments
Error Message.PNG
Error Message.PNG (80.1 KiB) Viewed 2300 times
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Error Message when in Custom Designer Control Form

Post by Lech Kulikowski »

Hello,

Could you prepare a sample project and send us for analysis?

Thank you.
codemonkey
Posts: 12
Joined: Fri Jan 17, 2020 3:02 pm

Re: Error Message when in Custom Designer Control Form

Post by codemonkey »

Hello,

iam not sure if a sample project will help you helping me if my theorie is true:

On my developer testsystems are also sage officeline 8.0 and 8.1 installed. Both uses different versions of the stimulsoft librarys in the GAC and their Library folder.

My testapplication works fine on 8.0 and 8.1 testsystems.

On the 8.0 testsystemsi found Stimulsoft.Base.dll in version 2016.1.28.0 and 2019.1.1.0 (designer error and TypeConverter error)
On the 8.1 testsystemsits version 2018.2.3.0, 2019.1.1.0, 2019.3.5.0 and 2020.1.1.0 (designer error)
in C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Stimulsoft.Base\

On the 8.0 testsytem with the main application i get the "TypeConverter cannot convert from System.String" when executing PrintReport.LoadFromString(ReportString) even though i see only version 2020.02.3.0 stimulsoft dlls loaded in the debugger\module window.
Which is little bit weird since my testapplication works fine.

The access application and .net ddls use some sage officeline dlls.
So my current threorie is that the sage dlls might load their own old version of the stimulsoft dlls (from the GAC and/or the sage officeline application directory) which get used instead of the correct ones.

To fix that i tried to load the correct dlls from the applications directory during runtime with the following code:

Code: Select all

           
           For Each file In FilesInDir
                If file.Extension = ".dll" And file.Name.Contains("Stimulsoft") Then
                    Dim test As System.Reflection.Assembly = Assembly.LoadFrom(file.FullName)
                End If
            Next
But it doesn´t help.

Iam not sure if installing the new stimulsoft dlls to the GAC will help (because sage has stimulsoft dlls in its own directory) or break certain things in sage officeline application.

Do you think my theorie is correct and have any idea how to fix the problem?
Do you still need a sample project?

Thank you for your help!
codemonkey
Posts: 12
Joined: Fri Jan 17, 2020 3:02 pm

Re: Error Message when in Custom Designer Control Form

Post by codemonkey »

Additional, it works when i put the stimulsoft dlls into the C:\Program Files (x86)\Microsoft Office\Office15 folder. But only when i disable the above code that loads the same dlls from the directory where my dll runs.

In all cases, even when its not working, Visual Studio\Modules lists the correct Stimulsoft dlls with correct paths and version.

Tried it after seeing in the fusion log viewer that the first search location for the stimulsoft dlls is in the office15 folder.
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Error Message when in Custom Designer Control Form

Post by Lech Kulikowski »

Hello,


Most probably, you should send your request to sage officeline 8.0 developers. We do not know how they working with our product in that product.

Thank you.
codemonkey
Posts: 12
Joined: Fri Jan 17, 2020 3:02 pm

Re: Error Message when in Custom Designer Control Form

Post by codemonkey »

Hello,

thank you for your answer!
Our application is not directly related to sage officeline.
But a likely scenario for our application is to run on the same machines as their application and to avoid conflict i want to force my dll to use explicit versions of your dlls.

I have the similar Problems on a clean testsystem.
No Stimulsoft DLLS in the GAC, no hints on Stimulsoft Dlls in the Access Project.

Maybe the fault lies at Access 2013 (we have to use this) which loads different versions of your dll or functions inside from different locations.

I have tried the following on my clean testsystem.
1. Loading Stimulsoft dlls from application directory with Assembly.LoadFrom -> designer error and TypeConverter error
2. Placing the Stimulsoft dlls in the Office15 Directory and load the same versions from the application directory with Assembly.LoadFrom
Got the Error "Object of type Stimulsoft.Report.Components.StiImageDataExpression cannot be converted to Stimulsoft.Report.Components.StiImageDataExpression"
Seems that the same dlls are loaded multiple times.
3. Deleting the Stimulsoft dlls from the application directory so they are only in the Office15 directory -> No error messages, everything works. But it will probably conflict with other software that uses Access 2013 as GUI and different versions of Stimulsoft Reports.

It seems the DLLs are not fully loaded from the application directory and .net dll fallbacks are producing the errors.

I don´t want my setup to litter dlls over the system other than the installation directory.
That may lead to other conflicts.

Do you have a way to point to specific location for dlls to use?
Would be perfect to set it during runtime.

Thank you!
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Error Message when in Custom Designer Control Form

Post by Lech Kulikowski »

Hello,

Unfortunately, we can not change in he direction, all assemblies automatically loaded by NET Framework, you can check it on the msdn.

Thank you.
Post Reply