I get the following exception when running a report:
System.NullReferenceException Object reference not set to an instance of an object.
at ceTe.DynamicPDF.PageElements.Group.Move(ig expansionPoints)
at ceTe.DynamicPDF.PageElements.Group.Move(ig expansionPoints)
at zz93.gl.b() at ceTe.DynamicPDF.ReportWriter.IO.LayoutWriter.b()
at ceTe.DynamicPDF.ReportWriter.IO.LayoutWriter.c()
at ceTe.DynamicPDF.ReportWriter.DocumentLayout.Run(Document document)
The exception only occurs when the web application is running on a server, in development the report runs fine. What could be wrong?
Null reference
Re: Null reference
Support · Nov 1, 2007Hello,
Can you please make sure that you have the latest build of our product. You can download from our CustomerArea
by logging in using your serial number and you can get the trail version from our website
.
Also make sure that you are using the same build dll and the dplx files in both the systems. If you still have the problem then please send over your dplx file to our [^a|mailto:support@cete.com|Support Team^] so that they can take a look at it.
Thanks,
ceTe Software Support Team.
Re: Null reference
Forum member · Nov 1, 2007I have the latest version installed and on both systems the same assembly is used. After some more browsing in the forum I think the problem is NULL values in the database. I am using a event driven report with a datareader which supplies the data. In the other post it is stated that instead of NULL values, empty strings need to be returned.
Is it possible that this problem can be fixed so that NULL values are handled correctly? In my opinion this is an elementary issue with which the reportwriter needs to work without throwing an exception.
Re: Null reference
Forum member · Nov 1, 2007After some more testing I also came up with the following: I have put some placeholders on the report and used the PlaceHolderLaidOutEventHandler event to set an image in it via e.ContentArea.Add() method.
Due to some cicrumstance nothing is placed in the placeholder thus leaving it empty. This is which causes the exception, an empty placeholder is not allowed.
Re: Null reference
Support · Nov 2, 2007Hello,
The error you are getting is not because of an empty Placeholder. You can add placeholder without any values or without placing any elements on the placeholder to the report without any problem.
You are getting this error most probably because of some Null values from the database which is assigned to a RecordBox or some other ReportElement and it is not allowed. You will have to check for the Null values.
Also this might be causing because of creating any page elements using the null values from the database in the LaidOut event of the placeholder.
Thanks,
ceTe Software Support Team.
Re: Null reference
Forum member · Nov 2, 2007Thanks for the help so far.
I have tried recreating the same error in a new simple solution with the same report file and the same code, but I couldn't reproduce the same error. The error only occurs in the original solution where the code is in a separate assembly. There I can trigger the error by doing an immediate return in the LaidOut event:
void myPlaceHolder_LaidOut(object sender, PlaceHolderLaidOutEventArgs e)
{
return;
// .... some code follow which adds an image to the e.ContentArea
}
If I disable the 'return;' statement the generate works. It seems that the exception not has anyhing to do with data, but only with layout.
The weirdest thing is that I can't reproduce it in a sample application, unfortunately I am not allowed to send you the original project.
So I solved it by making sure that in the LaidOut event of the PlaceHolder always a PageElement is added to the e.ContentArea.