Problem with binding variables in XML with data in code


#1

We have an XML file that defines a report.
In the middle of the report we have one segment which must be filled from the code.
So I put:



and then in my code I say:

Dim multiviewTitle As Aspose.Pdf.Text = CType(m_Section.Paragraphs(“MultiviewTitle”), Aspose.Pdf.Text)
Dim multiviewSegment As Segment = New Segment
multiviewSegment.Content = “title from code"

but I get this error:

Paragraph ID not found in Paragraphs indexer: MultiviewTitle

I just want to create a segment with an ID=”…" and then fill this segment from the code. How can I do this?

Thanks,
Edward


#2

Dear Edward,

Thank you for considering Aspose.

Segment is not paragraph. So you should not try to get it in Section.Paragraphs. You should get the Text object first and then get the segment object in the text’s Segments.