Hi,
I have a simple Word document with JUST a line of text and a DocumentVariable in it, named VAR1. I try to set a value for it in my ASP application, and it works, but when I try to update the field using the UpdateFields() methods, it throws a NullReferenceException. I think it might be a bug in the library, because I tried on several different documents. Can you please help me figure this out? The code it's pretty straightfoward. Maybe it's something wrong with the document?
DocxFormatProvider docxProvider = new DocxFormatProvider();
RadFlowDocument document;
using (Stream input = File.OpenRead(docxFilePath))
document = docxProvider.Import(input)
//document.DocumentVariables.Add("VAR_LINE1", "testline1");
document.DocumentVariables["VAR1"] = "testline1";
try
{
document.UpdateFields(); // throws exception
} catch (Exception ex) {}
Thank you!
8 Answers, 1 is accepted
We are aware of a similar issue, but to be sure this is the case could you please share with us the version of the library you are using. Also, I will appreciate if you could send us the document you are importing.
Regards,
Boyko
Telerik by Progress
Hi,
The version of the library is: 2015.3.1111.40, and the .net runtime version: v4.0.30319.
I attached the docx file with a .jpg extesion, because of the restrictions, simply rename it to the old extension and it should be ok.
Thank you!
I understand.
Thank you very much.
Daniel
Hi Boyko,
Can you please tell in which file version is this bug fixed? Apparently in 2016.2.421.40 it still throws the error. Isn't this version part of the 2016 SP1 release?
Thank you!
Hi Boyko,
I have just downloaded the brand new UI for ASP, as a trial. I can confirm it is 2016 SP1 (as the installer also said). All the UI dlls are 2.607, but those from the AdditionalLibraries folder are still 2.421 (after a clean install).
Can you please tell me how can I get the latest document processing libraries, because I still cannot get rid of the exception when I call UpdateFields.
Thanks!
Please, excuse me for misleading you. The Document Processing libraries are independent of platform and thus distributed with several of the suites we provide. All of the teams responsible for the different platform suites should test the compatibility between the technology and the Document Processing Libraries. This is the reason why not all suites will release a version of Telerik Document Processing that is up to date with the source code in releases between the official ones.
I have checked which bundle has the most recent build that includes the fix for the discussed in this thread issue and that is the UI for WPF suite. You could test the fix using the assemblies from this suite or wait for the next official release of UI for ASP.NET AJAX.
Hope this helps.
Regards,
Boyko
Telerik by Progress