From: Emilian B. <emi...@gm...> - 2006-09-27 10:23:54
|
Thanks for your answers. I'll try them out and see it it's ok by me. Right now I've patched ForEachTag.java and use my own attributes (startRow/endRow). I force tagContext.getTagBody().setEndRowNum(Integer.parseInt(endRow)); in init() and then alter the check for singleRow: if (body.getNumberOfRows() == 1 || endRow != null) { return processOneRowTag(sheetTransformer); } This seems to be working in my case. If you want I'll send a diff but the code is all messed-up now due to the Eclipse indentation engine. Emilian On 9/27/06, Leonid Vysochyn <le...@gm...> wrote: > Hi Emilian, > > The functionality of using jx:forEach for dynamic column generation is > rather limited right now. > So you have to put jx:forEach into each row which you want to duplicated. I > believe this should be enhanced in some way but still could not find good > solution. > Also you can try to output all your rows using jx:forEach tag for rows and > inside the tag body put jx:forEach tag for columns if appropriate. > Something like this, > <jx:forEach items="${employees}" var="employee"> > <jx:forEach items="${employee.notes}" var="note> | ${note.text} | > </jx:forEach> > <jx:forEach items="${employee.skills}" var="skill"> | ${ skill.name}| > </jx:forEach> > </jx:forEach> > Similar example can be found in XLSTransformerTest class, see a template > jxls-core/src/test/resources/foriftagonerow.xls. > I am not sure it will help you much but you can take a look. If something is > not working in this way please let us know. > > Also if you have any ideas/propositions on how to enhance dynamic columns > handling from user perspective please share them and then we'll think on how > they could be implemented. > > Regards, > Leonid > > > On 9/27/06, Emilian Bold <emi...@gm...> wrote: > > Ok, found the bug: the original template had somehow 255 columns > > (basically only the background was set). So I copy-pasted only the > > first 10 columns to another template and now it doesn't throw an > > exception anymore. > > > > But... I still doesn't do what I need. > > > > I would like to use jx:forEach on columns C-J (or at least something > > like C3:D70 region if you can imagine) and have in the resulting file > > 15 columns. > > > > So I've tryed setting jx:forEach on the same row (row 3) or on row 3 > > and row 70 but the resulting excel either duplicated the columns for > > only one row or duplicates the rows. > > > > Imagine a yearly calendar with a month per column. This is what I'm > > trying to achieve with jx:forEach. > > > > Emilian > > > > On 9/27/06, Emilian Bold <emi...@gm...> wrote: > > > Looks to me like row.getLastCellNum(), returns 256 and this is why I > > > get the exception. I guess the excel file has non-void/empty columns > > > till the end ? > > > > > > Emilian > > > > > > On 9/27/06, Emilian Bold <emi...@gm...> wrote: > > > > I was using an older release but I've downloaded the new 0.9.1 and > > > > it's the same: > > > > > > > > java.lang.RuntimeException: You cannot have more than 255 columns in a > > > > given row (IV). Because Excel can't handle it > > > > at > org.apache.poi.hssf.usermodel.HSSFCell.checkBounds > (HSSFCell.java:940) > > > > at > org.apache.poi.hssf.usermodel.HSSFCell.<init>(HSSFCell.java:151) > > > > at > org.apache.poi.hssf.usermodel.HSSFRow.createCell(HSSFRow.java:139) > > > > at > net.sf.jxls.util.Util.shiftCellsLeft(Util.java:596) > > > > at > net.sf.jxls.util.TagBodyHelper.removeLeftRightBorders(TagBodyHelper.java:152) > > > > at > net.sf.jxls.controller.SheetTransformationControllerImpl.removeLeftRightBorders > (SheetTransformationControllerImpl.java:79) > > > > at > net.sf.jxls.tag.ForEachTag.processOneRowTag(ForEachTag.java:201) > > > > at > net.sf.jxls.tag.ForEachTag.process(ForEachTag.java:125) > > > > at > net.sf.jxls.transformer.TagRowTransformer.transform(TagRowTransformer.java:36) > > > > at > net.sf.jxls.transformer.SheetTransformer.transformSheet(SheetTransformer.java:88) > > > > at > net.sf.jxls.transformer.XLSTransformer.transformXLS > (XLSTransformer.java:225) > > > > > > > > On 9/27/06, Leonid Vysochyn <le...@gm...> wrote: > > > > > Hi Emilian, > > > > > > > > > > Can you provide some more information? > > > > > Exception stack trace at least.. > > > > > > > > > > Thanks, > > > > > Leo > > > > > > > > > > > > > > > On 9/27/06, Emilian Bold < emi...@gm...> wrote: > > > > > > > > > > > > Hy, > > > > > > > > > > > > I have on a row a jx:forEach and /jx:forEach between columns C and > column > > > > > I. > > > > > > > > > > > > The problem is that I have 3 items so generally I *should* have > 3*5=15 > > > > > > new columns. > > > > > > > > > > > > But, strangely I get: > > > > > > > > > > > > java.lang.RuntimeException: You cannot have more than 255 columns > in a > > > > > > given row (IV). Because Excel can't handle it. > > > > > > > > > > > > Why is that ? What am I doing wrong ? > > > > > > > > > > > > Emilian > > > > > > > > > > > > -- > > > > > > Emilian Bold > > > > > > +40 740235562 > > > > > > http://emilian-bold.blogspot.com/ > > > > > > http://web.info.uvt.ro/~fierarul/typo3/ > > > > > > > > > > > > Java and NetBeans Platform-loving consulting services from > Timisoara, > > > > > Romania. > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > > > Take Surveys. Earn Cash. Influence the Future of IT > > > > > > Join SourceForge.net's Techsay panel and you'll get the chance to > share > > > > > your > > > > > > opinions on IT & business topics through brief surveys -- and earn > cash > > > > > > > > > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > > _______________________________________________ > > > > > > jXLS-user mailing list > > > > > > jXL...@li... > > > > > > > https://lists.sourceforge.net/lists/listinfo/jxls-user > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Emilian Bold > > > > +40 740235562 > > > > http://emilian-bold.blogspot.com/ > > > > http://web.info.uvt.ro/~fierarul/typo3/ > > > > > > > > Java and NetBeans Platform-loving consulting services from Timisoara, > Romania. > > > > > > > > > > > > > -- > > > Emilian Bold > > > +40 740235562 > > > http://emilian-bold.blogspot.com/ > > > http://web.info.uvt.ro/~fierarul/typo3/ > > > > > > Java and NetBeans Platform-loving consulting services from Timisoara, > Romania. > > > > > > > > > -- > > Emilian Bold > > +40 740235562 > > http://emilian-bold.blogspot.com/ > > http://web.info.uvt.ro/~fierarul/typo3/ > > > > Java and NetBeans Platform-loving consulting services from Timisoara, > Romania. > > > > -- Emilian Bold +40 740235562 http://emilian-bold.blogspot.com/ http://web.info.uvt.ro/~fierarul/typo3/ Java and NetBeans Platform-loving consulting services from Timisoara, Romania. |