BUG: Non-matching fields in DataSource cause AutoFiller to only use first row


#1

We are currently using the AutoFiller function to take a DataTable full of data and rows to auto-fill a fill-in PDF form. If the DataTable contains columns that do not match any of the fields in the fill-in form, the AutoFiller creates a PDF document with the first row of the data source repeated over and over rather than there being different data filled into each one.

I determined this by returning columns I needed in code, but not in the form and the PDF document produced were all duplicates. As soon as I removed the columns that did not match field names, the PDF document produced all the correct data for each row in the data source.

Is it documented that the data source must match the form fields exactly? I can't remember. If not, I would think this is a bug.

Michael Sumerano


#2

Dear Sumerano,

Thank you for considering Aspose.

It seems this is really a bug. We will study this issue and try to fix it ASAP.


#3

Dear Sumerano,

When we test this problem, we have not get the error you have reported. Please look at the attachment and see what is the difference between our test case and yours.


#4

The only difference I see is that you’re outputting to a file rather
than the Response.OutputStream. I’m assuming that it shouldn’t
make any difference. I’m also using a DataAdapter to fill
the DataTable after defining the columns using a
DataColumnCollection. Does this have any affect on the defined
DataTable if I define the columns, then use the DataAdapter’s Fill
method?


forever wrote:

Dear Sumerano,

When we test this problem, we have not get the error you have reported. Please look at the attachment and see what is the difference between our test case and yours.


#5

1)DataAdapter.Fill() is the same as my way to fill data into the DataTable. I think it is not the reason.
2)I have tested another example: a DataTable without any valid field name. All the fields are not filled but the doc is created.
3)If the field name(DataTable's column name)is not a valid name, nothing will be done to the field. So please check the dataTable's column name and data. You could print the dataTable's column names and all the data to see whether the data is the same as you imagine.

Any more question is welcome.