當textfield中,資料長度過長時,過長的部份會被截掉,希望若遇到過長的部份能夠折行處理。

Solution
利用iReport打開jrxml file,點選特定的textfield

將Stretch With Overflow此選項打勾即可。

Result

1 2 3 4 5 6 7 | net.sf.json.JSONException: There is a cycle in the hierarchy! at net.sf.json.util.CycleDetectionStrategy$StrictCycleDetectionStrategy.handleRepeatedReferenceAsObject(CycleDetectionStrategy.java:97) at net.sf.json.JSONObject._fromBean(JSONObject.java:674) at net.sf.json.JSONObject.fromObject(JSONObject.java:181) at net.sf.json.JSONArray._processValue(JSONArray.java:2381) at net.sf.json.JSONArray.processValue(JSONArray.java:2412) Truncated. see log file for complete stacktrace |
[10/09/03 15:22:21:394 GMT] 00000031 SystemErr R com.ibm.websphere.management.exception.AdminExcept ion: ADMA0174E: The filepermission argument contains an invalid format or contains an invalid regular expression pattern: {0}. Correct format is file_pattern=permission. Multiple filepermissions are separated by a # (Example: .*\.jsp=644#.*\.xml=744).
[10/09/03 15:22:21:394 GMT] 00000031 SystemErr R at com.ibm.ws.management.application.UpdateSchedulerI mpl.validateParams(UpdateSchedulerImpl.java:301)
[10/09/03 15:22:21:394 GMT] 00000031 SystemErr R at com.ibm.ws.management.application.UpdateSchedulerI mpl.setupTasks(UpdateSchedulerImpl.java:214)
[10/09/03 15:22:21:410 GMT] 00000031 SystemErr R at com.ibm.ws.management.application.SchedulerImpl.ru n(SchedulerImpl.java:250)
[10/09/03 15:22:21:410 GMT] 00000031 SystemErr R at java.lang.Thread.run(Thread.java:797)
[10/09/03 15:22:33:301 GMT] 00000034 SystemErr R com.ibm.websphere.management.exception.AdminExcept ion: ADMA0174E: The filepermission argument contains an invalid format or contains an invalid regular expression pattern: {0}. Correct format is file_pattern=permission. Multiple filepermissions are separated by a # (Example: .*\.jsp=644#.*\.xml=744).
[10/09/03 15:22:33:301 GMT] 00000034 SystemErr R at com.ibm.ws.management.application.UpdateSchedulerI mpl.validateParams(UpdateSchedulerImpl.java:301)
[10/09/03 15:22:33:301 GMT] 00000034 SystemErr R at com.ibm.ws.management.application.UpdateSchedulerI mpl.setupTasks(UpdateSchedulerImpl.java:214)
[10/09/03 15:22:33:301 GMT] 00000034 SystemErr R at com.ibm.ws.management.application.SchedulerImpl.ru n(SchedulerImpl.java:250)
[10/09/03 15:22:33:301 GMT] 00000034 SystemErr R at java.lang.Thread.run(Thread.java:797)
1: package gov.fdc.nig.query.service.nig687;
2: import gov.fdc.common.table.Paging;
3: import gov.fdc.nig.query.service.params.NIG687Params;
4: /**
5: * @author albert
6: *
7: */
8: public interface Strategy {
9: Paging doQuery(NIG687Params params, final int rowsPerPage, final String sortDir);
10: }
1: package gov.fdc.nig.query.service.nig687;
2: import gov.fdc.common.table.Paging;
3: import gov.fdc.nig.query.service.params.NIG687Params;
4: /**
5: * @author albert
6: *
7: */
8: public class Context {
9: private Strategy strategy;
10: public void setNIGU001Strategy() {
11: this.strategy = new NIGU001Strategy();
12: }
13: public void setNIGU005Strategy() {
14: this.strategy = new NIGU005Strategy();
15: }
16: public void setNIGU008Strategy() {
17: this.strategy = new NIGU008Strategy();
18: }
19: public void setNIGU014Strategy() {
20: this.strategy = new NIGU014Strategy();
21: }
22: public void setNIGU015Strategy() {
23: this.strategy = new NIGU015Strategy();
24: }
25: public void setNIGU020Strategy() {
26: this.strategy = new NIGU020Strategy();
27: }
28: public void setNIGU021Strategy() {
29: this.strategy = new NIGU021Strategy();
30: }
31: public void setNIGU036Strategy() {
32: this.strategy = new NIGU036Strategy();
33: }
34: public void setNIGU037Strategy() {
35: this.strategy = new NIGU037Strategy();
36: }
37: public void setNIGU038Strategy() {
38: this.strategy = new NIGU038Strategy();
39: }
40: public void setNIGU039Strategy() {
41: this.strategy = new NIGU039Strategy();
42: }
43: public void setNIGU040Strategy() {
44: this.strategy = new NIGU040Strategy();
45: }
46: public void setNIGU042Strategy() {
47: this.strategy = new NIGU042Strategy();
48: }
49: public void setNIGU050Strategy() {
50: this.strategy = new NIGU050Strategy();
51: }
52: public void setNIGU081Strategy() {
53: this.strategy = new NIGU081Strategy();
54: }
55: public void setNIGU086Strategy() {
56: this.strategy = new NIGU086Strategy();
57: }
58: public Paging executeStrategy(NIG687Params params,final int rowsPerPage, final String sortDir) {
59: return strategy.doQuery(params, rowsPerPage, sortDir);
60: }
61: }
1: package gov.fdc.nig.query.service.nig687;
2: import gov.fdc.common.dao.wherecon.SimpleCriteria;
3: import gov.fdc.common.table.Paging;
4: import gov.fdc.nig.dao.Nigu001Dao;
5: import gov.fdc.nig.domain.Nigu001;
6: import gov.fdc.nig.domain.Nigu001PK;
7: import gov.fdc.nig.query.service.params.NIG687Params;
8: import org.apache.commons.lang.StringUtils;
9: import org.springframework.beans.factory.annotation.Autowired;
10: /**
11: * @author albert
12: *
13: */
14: public class NIGU001Strategy implements Strategy {
15: @Autowired
16: private transient Nigu001Dao nigu001Dao;
17: /* (non-Javadoc)
18: * @see gov.fdc.nig.query.service.nig687.Strategy#doQuery(gov.fdc.nig.query.service.params.NIG687Params)
19: */
20: @Override
21: public Paging doQuery(NIG687Params params, final int rowsPerPage, final String sortDir) {
22: final SimpleCriteria whereCondition = new SimpleCriteria();
23: Nigu001PK primaryKey = (Nigu001PK)params.getPrimaryKey();
24: if(StringUtils.isNotEmpty(primaryKey.getDlvUnit()) &&
25: StringUtils.isNotEmpty(primaryKey.getTaxCd()) &&
26: StringUtils.isNotEmpty(primaryKey.getDlvYr()) &&
27: StringUtils.isNotEmpty(primaryKey.getFlgTp()) &&
28: StringUtils.isNotEmpty(primaryKey.getSerialNo())){
29: whereCondition.eq("id.dlvUnit", primaryKey.getDlvUnit());
30: whereCondition.eq("id.taxCd", primaryKey.getTaxCd());
31: whereCondition.eq("id.dlvYr", primaryKey.getDlvYr());
32: whereCondition.eq("id.flgTp", primaryKey.getFlgTp());
33: whereCondition.eq("id.serialNo", primaryKey.getSerialNo());
34: }
35: // 取得排序方向, 如果有的話代表是要排序
36: if (sortDir != null){
37: whereCondition.orderBy("id", sortDir.equals("asc"));
38: }else{
39: whereCondition.orderBy("id", true); // 預設照seqNo由小到大排
40: }
41: // 執行查詢
42: return new Paging(new Nigu001(), null, whereCondition, rowsPerPage, 100, nigu001Dao);
43: }
44: }
1: package gov.fdc.nig.query.service.nig687;
2: import gov.fdc.common.dao.wherecon.SimpleCriteria;
3: import gov.fdc.common.table.Paging;
4: import gov.fdc.nig.dao.Nigu005Dao;
5: import gov.fdc.nig.domain.Nigu005;
6: import gov.fdc.nig.domain.Nigu005PK;
7: import gov.fdc.nig.query.service.params.NIG687Params;
8: import org.apache.commons.lang.StringUtils;
9: import org.springframework.beans.factory.annotation.Autowired;
10: /**
11: * @author albert
12: *
13: */
14: public class NIGU005Strategy implements Strategy {
15: @Autowired
16: private transient Nigu005Dao nigu005Dao;
17: /*
18: * (non-Javadoc)
19: *
20: * @see
21: * gov.fdc.nig.query.service.nig687.Strategy#doQuery(gov.fdc.nig.query.service
22: * .params.NIG687Params, int, java.lang.String)
23: */
24: @Override
25: public Paging doQuery(NIG687Params params, int rowsPerPage, String sortDir) {
26: final SimpleCriteria whereCondition = new SimpleCriteria();
27: Nigu005PK primaryKey = (Nigu005PK) params.getPrimaryKey();
28: if (StringUtils.isNotEmpty(primaryKey.getDlvUnit()) &&
29: StringUtils.isNotEmpty(primaryKey.getTaxCd()) &&
30: StringUtils.isNotEmpty(primaryKey.getDlvYr()) &&
31: StringUtils.isNotEmpty(primaryKey.getFlgTp()) &&
32: StringUtils.isNotEmpty(primaryKey.getSerialNo())) {
33: whereCondition.eq("id.dlvUnit", primaryKey.getDlvUnit());
34: whereCondition.eq("id.taxCd", primaryKey.getTaxCd());
35: whereCondition.eq("id.dlvYr", primaryKey.getDlvYr());
36: whereCondition.eq("id.flgTp", primaryKey.getFlgTp());
37: whereCondition.eq("id.serialNo", primaryKey.getSerialNo());
38: }
39: // 取得排序方向, 如果有的話代表是要排序
40: if (sortDir != null) {
41: whereCondition.orderBy("id", sortDir.equals("asc"));
42: } else {
43: whereCondition.orderBy("id", true); // 預設照seqNo由小到大排
44: }
45: // 執行查詢
46: return new Paging(new Nigu005(), null, whereCondition, rowsPerPage, 100, nigu005Dao);
47: }
48: }
1: public static void main(String[] args){
2: Context context;
3: //搜尋NIGU001 table的資料
4: context = new Context();
5: context.setNIGU001Strategy();
6: context.executeStrategy(params, rowsPerPage, sortDir);
7: //搜尋NIGU005 table的資料
8: context = new Context();
9: context.setNIGU005Strategy();
10: context.executeStrategy(params, rowsPerPage, sortDir);
11: }