Skip to content

Commit

Permalink
Add support to display type for column
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Jun 17, 2024
1 parent 6ffb83b commit cfe2c29
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
Binary file not shown.
11 changes: 11 additions & 0 deletions src/main/java/org/spin/report_engine/data/ColumnInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,28 @@ public class ColumnInfo {
private String code;
private String title;
private int printFormatItemId;
private int displayTypeId;

private ColumnInfo(PrintFormatItem item) {
this.title = item.getPrintText();
this.printFormatItemId = item.getPrintFormatItemId();
this.code = String.valueOf(item.getPrintFormatItemId());
this.displayTypeId = item.getReferenceId();
}

public static ColumnInfo newInstance(PrintFormatItem item) {
return new ColumnInfo(item);
}

public int getDisplayTypeId() {
return displayTypeId;
}

public ColumnInfo withDisplayTypeId(int displayTypeId) {
this.displayTypeId = displayTypeId;return this;

}

public String getColor() {
return color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.adempiere.core.domains.models.I_AD_PrintFormatItem;
import org.compiere.model.MColumn;
import org.compiere.print.MPrintFormatItem;
import org.compiere.util.DisplayType;
import org.compiere.util.Util;

/**
Expand Down Expand Up @@ -168,6 +169,8 @@ private PrintFormatItem(MPrintFormatItem printFormatItem) {
isMandatory = column.isMandatory();
columnSql = column.getColumnSQL();
isVirtualColumn = !Util.isEmpty(column.getColumnSQL());
} else {
referenceId = DisplayType.String;
}
if(!Util.isEmpty(printFormatItem.getFormatPattern())) {
formatPattern = printFormatItem.getFormatPattern();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/spin/report_engine/service/Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ private static Report.Builder convertReport(ReportInfo reportInfo, int limit, in
.setTitle(ValueManager.validateNull(column.getTitle()))
.setColor(ValueManager.validateNull(column.getColor()))
.setStyle(ValueManager.validateNull(column.getStyle()))
.setDisplayType(column.getDisplayTypeId())
.build()
).collect(Collectors.toList())
)
Expand Down
1 change: 1 addition & 0 deletions src/main/proto/service/report_engine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ message ReportColumn {
string title = 2;
string color= 3;
string style = 4;
int32 display_type = 5;
}

message ReportRow {
Expand Down

0 comments on commit cfe2c29

Please sign in to comment.