This is a migrated thread and some comments may be shown as answers.

While exporting a large document(approx. 40 pages) raised an error - Object reference not set to an instance of object.

1 Answer 72 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Panch Raj
Top achievements
Rank 1
Panch Raj asked on 06 Jun 2016, 03:51 PM

Actually current i am working on a project that needs to import /export/manage a very large word document in Rich Text Editor. 

In this project user imports a word document of approx. 50 pages and then make some changes and the it saved to sql server database.

Now user can load it from database and further make some changes and again saved to database.

On importing the large word document it successfully imported in Rich Text Editor but after making some changes,

when i export it to a file then got the error "object reference not set to an instance of object".

Export functionality is working fine for small documents(approx 10 pages).

I am using this code.

Dim pathSource As String = Application.StartupPath & "\FileName.docx"
Using fsSource As Stream = New FileStream(pathSource, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, Int32.MaxValue, True)
                        provider.Export(document, fsSource):  '(error raised after executing this line of code.)
                        Dim docByte As Byte() = New Byte(fsSource.Length - 1) {}
                        fsSource.Read(docByte, 0, System.Convert.ToInt32(fsSource.Length))
                        fsSource.Close()
                        SaveFileToDatabase(docByte)
End Using

Please help....

Regards,

Panch Raj

 

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 09 Jun 2016, 01:27 PM
Hi Ranch,

Thank you for writing.

This thread duplicates a support ticket you have also opened. Since we would need to investigate the document locally I suggest that we continue our communication there.

Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Tags
RichTextEditor
Asked by
Panch Raj
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or