如何将我的arrayList集合传递给jasper报告?

时间:2019-04-04 18:24:59

标签: jasper-reports

我有这堂课

public class ExtraContList {

    private List<String> data;
    private List<String> contDC;
    private List<String> sum_deb;
    private List<String> sum_cred;
    private List<String> sold_curent;

    public List<String> getData() {
        return data;
    }

    public List<String> getContDC() {
        return contDC;
    }

    public List<String> getSum_deb() {
        return sum_deb;
    }

    public List<String> getSum_cred() {
        return sum_cred;
    }

    public List<String> getSold_curent() {
        return sold_curent;
    }

    @Override
    public String toString() {
        return "ExtraContList [data=" + data + ", contDC=" + contDC + ", sum_deb=" + sum_deb + ", sum_cred=" + sum_cred
                + ", sold_curent=" + sold_curent + "]";
    }

    public ExtraContList(List<String> data, List<String> contDC, List<String> sum_deb, List<String> sum_cred,
            List<String> sold_curent) {
        super();
        this.data = data;
        this.contDC = contDC;
        this.sum_deb = sum_deb;
        this.sum_cred = sum_cred;
        this.sold_curent = sold_curent;
    }

    public ExtraContList(List<? extends Object> asList) {
        // TODO Auto-generated constructor stub
    }
}

然后我在另一个类中创建了这个集合:

Collection<ExtraContList> coll = new ArrayList<ExtraContList>();

从mySQL检索数据库字段后,我在循环中看到这一行。

 coll.add(new ExtraContList(Arrays.asList(resultSet.getString("d_o")),Arrays.asList(ConturiUserIDint),Arrays.asList(" "),Arrays.asList(resultSet.getString("tsum")),Arrays.asList(resultSet.getString("sCD"))));

问题是:如何创建静态方法以将我的集合检索到jasper报告中?从零到十行不等。 如何在jasper报告中打印所有收藏?

0 个答案:

没有答案