Browse Source

REPORT-12788 网络报表对话框标题支持字符串和公式

research/10.0
yaoh.wu 6 years ago
parent
commit
88ab9e326a
  1. 17
      designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java

17
designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java

@ -23,6 +23,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.js.ReportletHyperlink; import com.fr.js.ReportletHyperlink;
import com.fr.js.ReportletHyperlinkDialogAttr; import com.fr.js.ReportletHyperlinkDialogAttr;
import com.fr.stable.CommonUtils;
import com.fr.stable.FormulaProvider; import com.fr.stable.FormulaProvider;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -191,8 +192,13 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane<ReportletHyp
topLocation.setText(StringUtils.EMPTY); topLocation.setText(StringUtils.EMPTY);
center.setSelected(true); center.setSelected(true);
if (attr != null) { if (attr != null) {
FormulaProvider title = attr.getTitleFormula(); Object title = attr.getTitle();
String titleContent = title == null ? StringUtils.EMPTY : title.getPureContent(); String titleContent;
if (title instanceof FormulaProvider) {
titleContent = ((FormulaProvider) title).getContent();
} else {
titleContent = title == null ? StringUtils.EMPTY : title.toString();
}
titleFiled.setFormulaText(titleContent); titleFiled.setFormulaText(titleContent);
boolean isCenter = attr.isCenter(); boolean isCenter = attr.isCenter();
if (!isCenter) { if (!isCenter) {
@ -222,7 +228,12 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane<ReportletHyp
reportletHyperlink.setByPost(postComboBox.getSelectedIndex() == 1); reportletHyperlink.setByPost(postComboBox.getSelectedIndex() == 1);
ReportletHyperlinkDialogAttr attr = new ReportletHyperlinkDialogAttr(); ReportletHyperlinkDialogAttr attr = new ReportletHyperlinkDialogAttr();
attr.setTitleFormula(BaseFormula.createFormulaBuilder().build(titleFiled.getFormulaText())); String title = titleFiled.getFormulaText();
if (CommonUtils.maybeFormula(title)) {
attr.setTitle(BaseFormula.createFormulaBuilder().build(titleFiled.getFormulaText()));
} else {
attr.setTitle(title);
}
attr.setCenter(center.isSelected()); attr.setCenter(center.isSelected());
if (!attr.isCenter()) { if (!attr.isCenter()) {
attr.setLeft((int) leftLocation.getValue()); attr.setLeft((int) leftLocation.getValue());

Loading…
Cancel
Save