MohamedSaeed / xdocreport

Automatically exported from code.google.com/p/xdocreport
1 stars 0 forks source link

How to display the rows in correct format. #456

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Java code 
=========

List<String> headings = ti.getHeadings();
map.put("heading", headings) ;

headings list contains data below:
---------------------------------
--------
DOSstart|
--------
DOSEnd  |
--------
CodeType|
--------
CodeDesc|
--------

Above data displayed in the word document by using the below code :

-----------------------
«@before-cell#foreach  |
($d in $heading)»«$d»  |
 «@after-cell#end»     |
-----------------------

Above code have't create any problem to me, safely worked.

Java code of list contains list data :
------------------------------------
List dosData = new ArrayList();

for (int x = 0; x < ti.getRowCount(); x++){
String[] rowContent = ti.getRow(x);

List<String> listData = new ArrayList<String>();

for(int i = 0;i<rowContent.length;i++){
listData.add(rowContent[i]);
}
dosData.add(listData);
}

when I display above "dosData" list below is the content going to be display 

system.out.println(dosData); --->Java code

--------------------
[1/3/2014, 3/4/2014,|(list contains lists)
cd1, decs1]         |
------------------- |
[1/3/2014, 3/4/2014,|
cd2, decs2]         |
------------------- |
[1/3/2014, 3/4/2014,|
cd3, decs3]         |
------------------- |
[1/3/2014, 3/4/2014,|
cd4, decs4]         |
------------------- 

Above data I want to display in word document by using the below code :

-----------------------------------------
«@before-cell#foreach($d in $dosData)»  |
«@before-cell#foreach($f in $d)»        |
«$f»                                    |
«@after-cell#end»                       |
«@after-cell#end»                       |
-----------------------------------------

Above code works fine but I am not able to display correct format :
 Expected format:

1/3/2014    3/4/2014 cd1 decs1
1/3/2014    3/4/2014 cd2 decs2
1/3/2014    3/4/2014 cd3 decs3
1/3/2014    3/4/2014 cd4 decs4

Actual format I am getting when I run above code in word document(wrong format) 
: 
1/3/2014    3/4/2014 cd1 decs1 1/3/2014    3/4/2014 cd2 decs2 1/3/2014    
3/4/2014 cd3 decs3 1/3/2014    3/4/2014 cd4 decs4 .....

Please find attachments for reference :
Cook test1.dotx
Actual format.pdf

Original issue reported on code.google.com by arun.har...@gmail.com on 28 Nov 2014 at 3:41

Attachments:

GoogleCodeExporter commented 9 years ago
You should use before-row, no?

-----------------------------------------
«@before-row#foreach($d in $dosData)»  |
«@before-cell#foreach($f in $d)»        |
«$f»                                    |
«@after-cell#end»                       |
«@after-row#end»                       |
-----------------------------------------

Original comment by angelo.z...@gmail.com on 28 Nov 2014 at 8:48

GoogleCodeExporter commented 9 years ago
NO Angelo,if I use before-row i am getting attached document(Row 
Render.pdf,Cook test1.dotx )its not what i wnat, it should be like according to 
the header, below. 

DOSstart    DOSend   CodeType CodeDesc
1/3/2014    3/4/2014 cd1      decs1
1/3/2014    3/4/2014 cd2      decs2
1/3/2014    3/4/2014 cd3      decs3
1/3/2014    3/4/2014 cd4      decs4

Please help me to display like above.

Original comment by arun.har...@gmail.com on 28 Nov 2014 at 9:09

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry got it Angelo i havnt see your answer properly. Thanks a lot 
its working.

Original comment by arun.har...@gmail.com on 28 Nov 2014 at 9:13

GoogleCodeExporter commented 9 years ago
Please find attachment what I got.

Original comment by arun.har...@gmail.com on 28 Nov 2014 at 9:14

Attachments: