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

Jed_Kaplowitz
Star Contributor
Star Contributor

Oops.. 

That first line is an IE thing and not in the actual XML.  (xml version) line.

Derrick_Maldona
Confirmed Champ
Confirmed Champ

Good Afternoon Jed,

I was able to compose with the following changes to the XML provided.

<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>

I placed a "/" in front of the final Installs.  Hopefully this helps out.

Derrick Maldonado

Jed_Kaplowitz
Star Contributor
Star Contributor

OK, sorry..  I typed that in really fast.  That was a typo.

This is not the real XML, this is just a mock-up of the XML.  The real XML has too much data I can't put up on a public forum.  

Assume all the syntax is correct.

Thanks for your quick reply though.

If you were able to compose, can you tell me what your Placeholder looked like?
What was your XPath?  What did your columns look like?

Thanks,
Jed K

The XPath is Installs/Install and the columns are Bill,Date,Amount.

Derrick Maldonado