Search in sources :

Example 26 with DataSet

use of cn.cerc.jdb.core.DataSet in project summer-mis by cn-cerc.

the class MasterGridLine method output.

@Override
public void output(HtmlWriter html, int lineNo) {
    DataSet dataSet = dataSource.getDataSet();
    html.print("<tr");
    html.print(" id='%s'", "tr" + dataSet.getRecNo());
    if (this.getPrimaryKey() != null)
        html.print(" data-rowid='%s'", dataSet.getString(this.getPrimaryKey()));
    html.println(">");
    for (RowCell cell : this.getOutputCells()) {
        IField obj = cell.getFields().get(0);
        html.print("<td");
        if (cell.getColSpan() > 1)
            html.print(" colspan=\"%d\"", cell.getColSpan());
        if (cell.getStyle() != null)
            html.print(" style=\"%s\"", cell.getStyle());
        else if (obj.getWidth() == 0)
            html.print(" style=\"%s\"", "display:none");
        if (cell.getAlign() != null)
            html.print(" align=\"%s\"", cell.getAlign());
        else if (obj.getAlign() != null)
            html.print(" align=\"%s\"", obj.getAlign());
        if (cell.getRole() != null)
            html.print(" role=\"%s\"", cell.getRole());
        else if (obj.getField() != null)
            html.print(" role=\"%s\"", obj.getField());
        html.print(">");
        if (obj instanceof AbstractField) {
            AbstractField field = (AbstractField) obj;
            if (field instanceof IColumn)
                html.print(((IColumn) field).format(dataSource.getDataSet().getCurrent()));
            else if (field instanceof AbstractField)
                outputField(html, field);
            else
                throw new RuntimeException("暂不支持的数据类型:" + field.getClass().getName());
        }
        html.println("</td>");
    }
    html.println("</tr>");
}
Also used : AbstractField(cn.cerc.jpage.fields.AbstractField) DataSet(cn.cerc.jdb.core.DataSet) IColumn(cn.cerc.jpage.core.IColumn) RowCell(cn.cerc.jpage.grid.RowCell) IField(cn.cerc.jpage.core.IField)

Aggregations

DataSet (cn.cerc.jdb.core.DataSet)26 Record (cn.cerc.jdb.core.Record)4 LocalService (cn.cerc.jbean.client.LocalService)3 IField (cn.cerc.jpage.core.IField)3 Test (org.junit.Test)3 BuildQuery (cn.cerc.jdb.mysql.BuildQuery)2 IColumn (cn.cerc.jpage.core.IColumn)2 AbstractField (cn.cerc.jpage.fields.AbstractField)2 RowCell (cn.cerc.jpage.grid.RowCell)2 Font (com.itextpdf.text.Font)2 Paragraph (com.itextpdf.text.Paragraph)2 BaseFont (com.itextpdf.text.pdf.BaseFont)2 PdfContentByte (com.itextpdf.text.pdf.PdfContentByte)2 IOException (java.io.IOException)2 Label (jxl.write.Label)2 WritableSheet (jxl.write.WritableSheet)2 WritableWorkbook (jxl.write.WritableWorkbook)2 FileItem (org.apache.commons.fileupload.FileItem)2 Ignore (org.junit.Ignore)2 RemoteService (cn.cerc.jbean.client.RemoteService)1