We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Problem cloning/merging DocFiles

I'm trying to merge several files generated at runtime using SyncFusion 5.1.0.54

but i'm getting the following exception:

?ex
{System.NullReferenceException}
[System.NullReferenceException]: {System.NullReferenceException}
HelpLink: Nothing
InnerException: Nothing
Message: "A referência de objecto não foi definida como uma instância de um objecto."
Source: "Syncfusion.DLS.Base"
StackTrace: " at Syncfusion.DLS.Picture..ctor(Picture pic, IParagraph paragraph)
at Syncfusion.DocIO.DLS.WPicture..ctor(WPicture pic, IParagraph paragraph)
at Syncfusion.DocIO.DLS.WPicture.Clone(IParagraph paragraph)
at Syncfusion.DLS.Paragraph..ctor(IParagraph paragraph, IDocument doc)
at Syncfusion.DocIO.DLS.WParagraph.CloneImpl(IDocument doc)
at Syncfusion.DLS.TableCell..ctor(TableCell cell, TableRow row)
at Syncfusion.DocIO.DLS.WTableCell..ctor(WTableCell cell, TableRow row)
at Syncfusion.DocIO.DLS.WTableCell.CloneImpl(TableRow row)
at Syncfusion.DLS.TableRow..ctor(TableRow row, Table owner)
at Syncfusion.DocIO.DLS.WTableRow..ctor(WTableRow row, Table owner)
at Syncfusion.DocIO.DLS.WTableRow.CloneImpl(Table table)
at Syncfusion.DLS.Table..ctor(ITable table, IParagraph paragraph)
at Syncfusion.DocIO.DLS.WTable.Clone(IParagraph paragraph)
at Syncfusion.DLS.Paragraph..ctor(IParagraph paragraph, IDocument doc)
at Syncfusion.DocIO.DLS.WParagraph.CloneImpl(IDocument doc)
at Syncfusion.DLS.TableCell..ctor(TableCell cell, TableRow row)
at Syncfusion.DocIO.DLS.WTableCell..ctor(WTableCell cell, TableRow row)
at Syncfusion.DocIO.DLS.WTableCell.CloneImpl(TableRow row)
at Syncfusion.DLS.TableRow..ctor(TableRow row, Table owner)
at Syncfusion.DocIO.DLS.WTableRow..ctor(WTableRow row, Table owner)
at Syncfusion.DocIO.DLS.WTableRow.CloneImpl(Table table)
at Syncfusion.DLS.Table..ctor(ITable table, IParagraph paragraph)
at Syncfusion.DocIO.DLS.WTable.Clone(IParagraph paragraph)
at Syncfusion.DLS.Paragraph..ctor(IParagraph paragraph, IDocument doc)
at Syncfusion.DocIO.DLS.WParagraph.CloneImpl(IDocument doc)
at Syncfusion.DLS.Section..ctor(ISection section, IDocument doc)
at Syncfusion.DocIO.DLS.WSection.CloneImpl(IDocument document)
at Syncfusion.DLS.Section.Clone(IDocument document)


the exception ocurres with the following code:

For Each MySection In aSyncDocument.Document.Sections
DirectCast(Me.Document.Sections, Syncfusion.DLS.ISectionCollection).Add(MySection.Clone(Me.Document))
Me.Document.LastSection.BreakCode = MySection.BreakCode
Next

the content of aSyncDocument.Document is the attachment. i got it using aSyncDocument.Document.Save method.

aSyncDocument.Document is the SyncFusion.DocIO.DLS.WordDocument.

the Me.Document is the final merger document.

test96.zip

3 Replies

AJ Ajish Syncfusion Team July 4, 2007 08:47 PM UTC

Hi Lima ,

Thank you for your interest in Essential DocIO,

I was unable to reproduce the issue. I tested this issue with CloningAndMerging Sample that is available along with the installs with the document provided to us. The sample can be found at the following place.

C:\Documents and Settings\{user}\My Documents\Syncfusion\EssentialStudio\5.1.0.54\Windows\DocIO.Windows\Samples\2.0\Advanced Features\CloningandMerging\CS

Can you provide us with the sample application, documents with which your are able to reproduce the issue.Kindly take a look and us know if you have any other questions.

Regards,
Ajish.


RL RL July 5, 2007 09:37 AM UTC

I attach a sample application.
The problem comes on the line:

DirectCast(Me.Document.Sections, Syncfusion.DLS.ISectionCollection).Add(MySection.Clone(Me.Document))

a think it can be related with the insert of the image at runtime.
if I put the line
MyTemDocument.Save("C:\test\result" & System.Guid.NewGuid.ToString & ".doc", FormatType.Doc)
before the line
AppendDocument(MyTemDocument)

it saves all the document with success.


SyncTestProblem.zip


MW Melba Winshia Syncfusion Team July 5, 2007 01:01 PM UTC

Hi Lima,

Thank you for bringing this issue to our attention.

Could you please open a new direct – trac incident with subject line as Forum 63485 - Problem cloning/merging DocFiles? So that it would be possible for us to provide more details regarding this issue.

Thanks,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon