cancel
Showing results for 
Search instead for 
Did you mean: 

Error when trying to generate a table in Doc Comp

Jed_Kaplowitz
Star Contributor
Star Contributor

I am getting this error when I use the API to generate a table in a doc comp:

"Unable to cast object of type 'System.String' to type 'Hyland.Office.Services.DocumentComposition.Composer.TableData'."

The XML is a string that I pass into the API that looks like this:

<?xml version="1.0"?>
<Installs>
<Install>
<Bill>XXX</Bill>
<Date>ddmmyy</Date>
<Amount>000</Amount>
</Install>
<Install>
<Bill>XXX</Bill>
<Date>ddmmyy</Date>
<Amount>000</Amount>
</Install>
<Install>
<Bill>XXX</Bill>
<Date>ddmmyy</Date>
<Amount>000</Amount>
</Install>
<Installs>

Something like that (Sorry if there is a typo)

I tried different ways of building the XML but they all produce the same error

The columns in the Placeholder look like this:
Bill,Date,Amount

Any help would be appreciated

1 ACCEPTED ANSWER

Jed_Kaplowitz
Star Contributor
Star Contributor

Well, I figured it out.  Thanks for your help with this.
Here is my original post:
This is the actual Placeholder:
Enter PlaceHolder:  data/rowdata

And there is the error.  

The PlaceHolder should look like this:
Enter PlaceHolder:  /data/rowdata

Do you see the difference?  

Thanks again for taking a look.  Took me half a day to realize I needed to start with a foward slash.

Jed Kaplowitz

View answer in original post

13 REPLIES 13

Tony_Maimone
Star Collaborator
Star Collaborator

Ok, let's see if it is something else on the template.

Is this a brand new template or on the existing template? If its on the existing template, did you delete the original placeholder that was giving you problems? If you did not delete the original placeholder, it would continue to give you the same error.

Jed_Kaplowitz
Star Contributor
Star Contributor

I have started from scratch... Everything is brand new.

So looking at that last XML I sent... the one that starts with <data><rowdata><column1>data1</column1...

I changed the placeholder to be just: data  (was data/rowdata)

that got rid of the exception inside ComposeDocument and the "Document" property has data.  This actually creates a new document but now the composed document shows a blank table placeholder.   I created a non table placeholder with the same XPath:  "data" and that shows: "data1data2data3".

I feel like I'm getting closer. 

Jed_Kaplowitz
Star Contributor
Star Contributor

Well, I figured it out.  Thanks for your help with this.
Here is my original post:
This is the actual Placeholder:
Enter PlaceHolder:  data/rowdata

And there is the error.  

The PlaceHolder should look like this:
Enter PlaceHolder:  /data/rowdata

Do you see the difference?  

Thanks again for taking a look.  Took me half a day to realize I needed to start with a foward slash.

Jed Kaplowitz

Kevin_Ngo
Star Contributor
Star Contributor

Hello,

Where can I get more information regarding how to create an XML Path besides contacting my first line of support? Is it in any MRG's?


What I am trying to do is extract the keyword information from a MIKG in a document type and create a custom report with it using Doc Comp. I can create a XML file manually but where do I store it?


Thanks!

Kevin Ngo