Page 1 of 1

set_PageViewMode null reference exception

Posted: Fri Mar 16, 2018 7:22 am
by symphonytech
We have a software product where we use Stimulsoft reports. The software has been installed at various places (at least 100 computers). But only on 1 client's computer facing an issue of null reference exception. PFA screenshot of the error.

Any help is appreciated.

Re: set_PageViewMode null reference exception

Posted: Mon Mar 19, 2018 2:46 am
by Edward
Hi Symphonytech,

Please check, that there is a valid default printer installed on that machine.

Thank you,
Edward

Re: set_PageViewMode null reference exception

Posted: Mon Mar 19, 2018 9:52 am
by symphonytech
Thank you Edward for you reply!

Yes, there is a default printer installed and configured.

Re: set_PageViewMode null reference exception

Posted: Tue Mar 20, 2018 1:46 pm
by Edward
Hi Symphonytech,

No problem at all.
If you execute the application as Administrator on that machine, is the exception still happening? Maybe there something different about that machine, something like OS version or any difference in some configuration from others? Is it using the local printer or a network printer as a default?

Thank you,
Edward

Re: set_PageViewMode null reference exception

Posted: Tue May 29, 2018 5:06 am
by symphonytech
Apologies for the delay in reply.. we tried it with the admin login too, but error continues. There is a local printer installed and it is configured properly.

Re: set_PageViewMode null reference exception

Posted: Thu May 31, 2018 5:36 am
by Edward
Hi Symphonytech,

It still looks like more of the local machine or printer configuration issue really or maybe some local configuration settings got saved corrupted. As the error points to the page preview settings, please try to change the preview mode from 'Single Page' to 'Continuous' or 'Multiple Pages' and re-render the report.

The local settings are stored by default in the following folder:
c:\Users\[UserName]\AppData\Local\Stimulsoft

Something similar was happening a while ago and was explained in the following post;
viewtopic.php?f=8&t=38017&p=71862

There are some hints also on rebuilding the references to default Stimulsoft dlls and maybe reinstalling them into GAC if that option was used?

Thank you,
Edward

Re: set_PageViewMode null reference exception

Posted: Tue Jul 31, 2018 5:31 am
by allenmarsh
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null. A NullReferenceException exception typically reflects as developer error. To fully understand why a NullReferenceException is thrown, it is important to know the difference between value types and reference types.

So, if you're dealing with value types, NullReferenceExceptions can not occur. Though you need to keep alert when dealing with reference types!

Only reference types, as the name is suggesting, can hold references or point literally to nothing (or 'null'). Whereas value types always contain a value.

Reference types (these ones must be checked):

dynamic
object
string


Value types (you can simply ignore these ones):

Numeric types
Integral types
Floating-point types
decimal
bool
User defined structs

Re: set_PageViewMode null reference exception

Posted: Tue Jul 31, 2018 7:01 am
by Lech Kulikowski
Hello,

Thank you for the additional information.