xinyongshu / xdocreport

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

Display list data in two different tables. #459

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
My Requirement is like below :

                      Sublist of main list                  
                       __________
                      |          |                    
                      |----------| 
My main list          |          |
-----------------|    |----------|(Part1)
        ---------|----|----------|
-----------------|    |__________|
         |  
         |    ___________               
    -------------|           |
                 |   |           |          
-----------------    |___________|(Part2)
                     |           |
             |           |
                     |___________|

Part 1 contains the list data is 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]         |
------------------- |

part 2 contains the list data is below :

--------------------
[name, rank, serial]|
--------------------
[Bilbo, Private,    |
8675309]            |
--------------------
[Mordecai, Colonel, |
3567]               |
--------------------

I want to display the data like below (Expected result is below):Two individual 
tables  and first row elements should be bold or like heading(Thick black 
colour).

Tables 1:
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

Table 2: 
name rank serial
---------------------
Bilbo Private 8675309
----------------------
Mordecai Colonel Dear
----------------------

I have tried below code to generate above expected output :

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

Attached file is generated --->render.pdf

Please help me what modifications I need to change above word document code to 
get required output(expected output).

Java code : which I am following.

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

for (TableInterpreter ti : tis) {
List<List<String>> headelements = new ArrayList<List<String>>();

List<String> listOfHeadings     = new ArrayList<String>();
String[] headings = ti.getHeadings();
for (String heading : headings) {
//System.out.println(heading);
listOfHeadings.add(heading);                        
}
headelements.add(listOfHeadings);

for (int x = 0; x < ti.getRowCount(); x++) {
String[] rowContent = ti.getRow(x);
List<String> listOfElements = new ArrayList<String>();
for (String columnData : rowContent) {
//System.out.println(columnData);
listOfElements.add(columnData);
}
headelements.add(listOfElements);
System.out.println(headelements);
}
listOfTables.add(headelements);
}

Original issue reported on code.google.com by arun.har...@gmail.com on 8 Dec 2014 at 12:50

Attachments:

GoogleCodeExporter commented 9 years ago
To be honnest with you, I have never managed this complex case. Goal of 
XDocReport is to  design simple report. Perhaps it's possible to support your 
case, but never done. I have no time to study your case.

Original comment by angelo.z...@gmail.com on 8 Dec 2014 at 1:08

GoogleCodeExporter commented 9 years ago
Sorry Angelo, I will simplify my question.

Original comment by arun.har...@gmail.com on 9 Dec 2014 at 9:19