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

Error when trying to export to DOCX

3 Answers 144 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
AnneArents
Top achievements
Rank 1
AnneArents asked on 16 Sep 2011, 10:38 AM
Hi,

I have a web application that generates a report and sends it to the browser.
Everything works fine when I export as PDF, but when I try to export as DOCX, it returns an error:
'Object reference not set to an instance of an object.'.
I guess I'm missing something then.
My project has the following Telerik DLL's in the BIN folder:
  • DocumentFormat.OpenXml.dll
  • Telerik.Reporting.dll
  • Telerik.Reporting.OpenXmlRendering.dll

I've included a screenshot of the code that errors.

3 Answers, 1 is accepted

Sort by
0
Squall
Top achievements
Rank 1
answered on 16 Sep 2011, 03:33 PM
Hi,

Most probably you passing a reference to null/nothing to the RenderReport method. Use the VS debugger  http://msdn.microsoft.com/en-us/library/awtaffxb.aspx to trace the required method parameters.

Squall
0
AnneArents
Top achievements
Rank 1
answered on 19 Sep 2011, 08:41 AM
Exporting to PDF works fine. I only change "PDF" to "DOCX" and it fails.
To me that looks like the library responsible for creating the docx file is missing or failing.
0
Steve
Telerik team
answered on 21 Sep 2011, 03:39 PM
Hello Cj Scholten,

We would appreciate if you provide us with a runnable sample that exhibits the problem as we are not able to reproduce it locally. Note this code is part of a KB article and has been used by lots of users so far, so definitely the problem should come from something else.

Regards,
Steve
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
AnneArents
Top achievements
Rank 1
Answers by
Squall
Top achievements
Rank 1
AnneArents
Top achievements
Rank 1
Steve
Telerik team
Share this question
or