Re: NullRef exeption on designerControl.SaveReport(stream)
Data Dynamics Reports Support
NullRef exeption on designerControl.SaveReport(stream)
12-30-2008, 1:50 PM
Since i like to save the report file edited by end user in the designercontrol i am using the following code in the FormClosing Event handler of the form containing the designercontrol :
private void ReportDesigner_FormClosing(object sender, FormClosingEventArgs e)
{
MemoryStream stream = new MemoryStream();
designerControl.SaveReport(stream);
stream.Position = 0;
}
However i receive a NullReferenceException at the red line, when i take a look at the designerControl object i notice that the ReportName property is an empty string so the Exception is quit obvious. But than i still have the problem that i need to save the edited report to the db, any idea anyone?
Thanks
Re: NullRef exeption on designerControl.SaveReport(stream)
12-31-2008, 1:22 PM
Hello,
I have used the latest version (1.5.905.0) to check this issue and it seems to be working fine. Researching further, I came to know that there is a similar issue which has been earlier addressed to the development team and has been fixed in the latest version.
I would suggest you to please download the latest version from following location to resolve this issue:
http://www.datadynamics.com/Products/DDRPT/Default.aspx#release
Let me know if you require further assistance/clarifications.
Best Regards,
Amit
Amit Pal
GrapeCity- DataDynamics
Re: NullRef exeption on designerControl.SaveReport(stream)
12-31-2008, 2:21 PM
Hello Amit,
I just double checked the DDR version i am using, it is indeed 1.5.905
However i just thought about another kinda similar issue that i read about somewhere else in this forum.:
The function that i use to start up the report designer form :
1) Reports.ReportDesigner oReportDesigner = new Reports.ReportDesigner();
2) oReportDesigner = new Reports.ReportDesigner(RepFileID);
3) oReportDesigner.ShowDialog();
4) sbXMLContent = new StringBuilder();
5) sbXMLContent.Append(oReportDesigner.oDesignerStream.ToString());
where oReportDesigner = the instance of the form containing the designer control, so what i do is
1 create new instance of form
2 initialize with the ReportFileID so in the constructor i read the corresponding stream from the db
3 show dialog so nr 4 will be executed as soon as the form closes
4 init new stringbuilder
5 read the stream oDesignerStream.(property of form) so we can save this stream later.
Obviously line 5 will do nothing since the oDesignerStream = null
I will do some testing if a different behavior will occur when i do a oReportDesigner.Show(); since in earlier issues this helped solving the problem.
First however i will celebrate the new year with my family ao more comments in 2 days :-)
Re: NullRef exeption on designerControl.SaveReport(stream)
01-02-2009, 1:32 PM
Hello,
I can understand that the error is being thrown after oDesignerStream becomes null.
Can you please provide us some more information, preferably a small sample application which will help us in replicating this issue?
Any further information to isolate the issue would be highly appreciated.
Best Regards,
Amit
Amit Pal
GrapeCity- DataDynamics
Re: NullRef exeption on designerControl.SaveReport(stream)
01-03-2009, 4:16 AM
Hello Amit, i modified a designer example that i downloaded from the forum earlier.
It uses an access db for the data which is included.
just run the example, select a query, press button report and do some design.
Next close the designerform, save the file and you will get the null ref exception in the formclosing event handler.
Kind regards Henk
Re: NullRef exeption on designerControl.SaveReport(stream)
01-05-2009, 11:05 AM
Hello,
Thanks for attaching a project.
I have tried considerably however could not replicate the said issue at my end.
In the licenses.licx file of your project, I can see that you are still referencing older version DLL’s of Data Dynamics Reports.
I would suggest you to please download the latest version from the following location to resolve this issue:
http://www.datadynamics.com/Products/DDRPT/Default.aspx#release
Do let me know if you require further assistance/clarifications.
Best Regards,
Amit
Amit Pal
GrapeCity- DataDynamics
Re: NullRef exeption on designerControl.SaveReport(stream)
01-05-2009, 12:05 PM
Thanks for your reply Amit,
I just deleted everything related to DDR from my pc and did a reinstall of the latest version
then i added a line to the form closing event for showing me the product version:
MessageBox.Show(userDesignerControl1.ProductVersion.ToString());
Unfortunaly this is the latest version(see attachment)
I am Sorry but i can not get any other result.
Re: NullRef exeption on designerControl.SaveReport(stream)
01-05-2009, 2:28 PM
Hello,
The licenses.licx file has version 1.5.707.0 listed in the sample project you have attached earlier. Since you have upgraded the version to the latest one, so I would suggest you to please follow underline steps to resolve this issue:
(1) Open the licenses.licx file and change the version to 1.5.905.0
(2) Please make sure that all the references of Data Dynamics Reports are pointing to the latest version.
(3) Rebuild the project and then ran the application.
Please let me know if you require further assistance/clarifications.
Best Regards,
Amit
Amit Pal
GrapeCity- DataDynamics
Re: NullRef exeption on designerControl.SaveReport(stream)
01-06-2009, 3:06 PM
Thanks for your help Amit, i was not able to solve the problem, but i dicided to implement the custom toolbar option like in the api samples.
This way i am able to receive an event when the user closes the disigner by selecting the exit option in the file menu.
By the way when i close the form by the close button (right top hand corner)i had no problem at all, the problem only occured when i select the exit option. I noticed this will throw an applicationexit and this probably is the reason that the designer was not able to save the stream.
Anyway, i managed to solve my problem and again thanks for your efforts.
Re: NullRef exeption on designerControl.SaveReport(stream)
01-07-2009, 1:36 PM
Hello,
We have been able to replicate this issue at our end. I have entered this in our system as Case 124217 and your email address has been added to this case.
Do let me know if you require further assistance/clarifications.
Best Regards,
Amit
Amit Pal
GrapeCity- DataDynamics
Re: NullRef exeption on designerControl.SaveReport(stream)
01-27-2010, 12:54 AM
Hello,
I am taking same error, too. Is there any solution for this problem?
Re: NullRef exeption on designerControl.SaveReport(stream)
01-28-2010, 10:04 AM
Hello,
Currently there is no ETA associated with Case 124217 however I have requested the Project Management team to increase the priority of this case.
I have also added your email address to the list of affected users for this case. You will be notified once a build containing a fix for this issue will be released.
Also, this issue only arises when you click on the Exit button of the designer. If you close the by the close button (right top hand corner), then it will work fine.
Amit Pal
GrapeCity- DataDynamics
Re: NullRef exeption on designerControl.SaveReport(stream)
04-09-2010, 11:33 AM
Hi Stephen,
Case 124217 – ‘NullReferenceExcepion on UserDesignerControl SaveReport method’ has been resolved in the latest version of Data Dynamics Reports (1.6.1818.8). You may download this build from here:
http://downloads.datadynamics.com/ddr_1.6.1818.8.zip
Regards,
Amit
Amit Pal
GrapeCity- DataDynamics