Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Aug 12, 2022 1:13 pm

I am trying to save a Word document that I dynamically create from data in my SQL db. The document is generated but it will not save. I get a NullReferenceException when I hit the following line: doc.SaveToFile(filename, Spire.Doc.FileFormat.Docx2013). The exception is coming from Spire.Doc and I do not know why. Any suggestions are appreciated.

aebrey84
 
Posts: 5
Joined: Mon Aug 08, 2022 5:47 pm

Mon Aug 15, 2022 10:01 am

Hello,

Thanks for your inquiry.

As there can be many different scenarios for a null pointer exception, I can't tell you exactly what might be the cause of it. In order to reproduce and investigate this issue, could you please provide us your test code and Word files(if any)?
Since your code should contain the part that reads data from the database, and I obviously can't do this part locally, I need to trouble you a little more to refine the code. Please omit this part and use java variables directly to place the data read from the database.
You can upload them here or send them to us via email ([email protected]).
Thank you very much for your understanding and assistance.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.Doc

cron