michal-h21 / odsfile

LaTeX package for reading opendocument spreadsheet files.
14 stars 2 forks source link

Issue with includespread without range option #5

Closed yamsu closed 9 years ago

yamsu commented 10 years ago

Hi, I have noticed that if i do not specify the range in the \includespread the document does not compile. However, everything works fine if i provide the range. I did not face this problem with V0.2. Hope you can figure something out. Thanks.

Here is the code \begin{tabular}{cp{3cm}p{2.5cm}p{2.5cm}p{2.5cm}} \includespread[file=./img/ComparisonMatrix.ods,sheet=Sheet1,coltypes=ccccc] \end{tabular}

I get the following error ! Extra alignment tab has been changed to \cr.

\endtemplate l.16 ...risonMatrix.ods,sheet=Sheet1,coltypes=ccccc] You have given more \span or & marks than there were in the preamble to the \halign or \valign now in progress. So I'll assume that you meant to type \cr instead. ComparisonMatrix.ods contains: 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 The following line works fine, in the above snippet of code. \includespread[file=./img/ComparisonMatrix.ods,sheet=Sheet1,coltypes=ccccc,range=a1:e3]
yamsu commented 10 years ago

The problem is with the getColumnCount(tbl) function. By making the following change the range value is no longer required. Exisitng: local rep = attr["table:number-columns-repeated"] or 1 Changed to: local rep = c["table:number-columns-repeated"] or 1

Please see if this makes sense and can be updated in the source. Thanks

michal-h21 commented 9 years ago

Thank you for spotting this issue, and sorry for really late reply, I was busy at the time and forgot about it later. Your solution is correct, "table:number-columns-repeated" isn't an attribute, but an element.