When using the Clone function from RadFlowDocument, the below exception is thrown :
[2022-10-07T13:06:32.329Z] Error: System.ArgumentException: The document element is associated with another document. (Parameter 'item')
at Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.VerifyDocumentElementOnInsert(T item)
at Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.AddClonedChildrenFrom(DocumentElementCollection`2 fromCollection, CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Paragraph.CloneCore(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.AddClonedChildrenFrom(DocumentElementCollection`2 fromCollection, CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Footer.CloneCore(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.HeadersFootersBase`1.CloneHeadersFootersFrom(HeadersFootersBase`1 headersFooters, CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Section.ClonePropertiesAndHeadersFooters(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Section.CloneCore(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.AddClonedChildrenFrom(DocumentElementCollection`2 fromCollection, CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.RadFlowDocument.CloneCore(CloneContext cloneContext)
at Telerik.Windows.Documents.Flow.Model.RadFlowDocument.Clone()
at Perspex.Shared.OOPGenerator.OOPGenerator.SetWordDocumentTemplate(Schools school, SchoolYear schoolyear) in D:\projecten\cip\Perspex\src\Perspex.Shared\OOPGenerator\OOPGenerator.cs:line 62
It occurs after I upgraded to the latest version (2022.3.906) of RAD Document processing. In the previous version it worked as expected.
Steps I take to reproduce the issue :
1) Load a word document
2) Clone the document.
Having a basic docx document with two tables and bookmarks generates an invalid word document when saving.
Steps to reproduce :
I have included a simple project to demonstrate the issue.
Version 2022.2.613 does not have the above issues.
I can't share the document publicly.
Stack trace:
System.ArgumentException: Unexpected value = 100.0%
at Telerik.Windows.Documents.Flow.FormatProviders.Docx.Model.Types.FractionalValueConverter.ConvertFromString(String value)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Core.ConvertedOpenXmlAttribute`1.SetStringValue(IOpenXmlImportContext context, String value)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadAttributes(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Parts.OpenXmlPartBase.Import(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.Flow.FormatProviders.Docx.Model.Parts.HeaderPart.Import(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Parts.OpenXmlPartBase.Import(Stream stream, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.ImportPartFromArchive(ZipArchiveEntry zipEntry, PartBase part, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.Import(Stream input, IOpenXmlImportContext context)
at Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider.ImportOverride(Stream input)
at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Import(Stream input)
One cannot build the source code for document processing.
Error Message: StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets" was not found. Confirm that the expression in the Import declaration "..\Tools\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets" is correct, and that the file exists on disk.
Telerik expose beautyfull document processing: you can automate a lot of thinks in document without user interaction.
But doesn't exists nothing about print this documents without user interaction: you have to open document on a webpage in a component and the print it.
For example: filling out a form can be done internally by process but not printed it.
Renato
The problem can be found in two places:
1. When the value "7400-5" is pasted, the result in Spreadsheet is 2008956, which is the underlying raw date value.
2. When 7400-5 is written in the control directly, the result is 5/1/7400, which is 2008956 with a date format on it.