My problem is that when i try to export the jasperprint to text, the lines/rectangles doesn't appear in the .txt files though it works with pdf files.
I tried to modify the pen width but nothing appear .
My code is:
JRDesignLine ltest = new JRDesignLine();
ltest.setBackcolor(Color.black);
ltest.setForecolor(Color.black);
ltest.setX(10);
ltest.setY(200);
ltest.setMode(JRDesignStaticText.MODE_OPAQUE);
ltest.setWidth(500);
ltest.setHeight(10);
ltest.setPen(JRDesignLine.FILL_SOLID);
bandHeader.addElement(ltest);
Any suggestions please.
You are asking about the plain text format and it is very simple.
The JRTextExporter is skipping JRLine elements and does not draw the borders (JRLineBox).
The snippet of JRTextExporter:
protected void exportElements(List<JRPrintElement> elements) {
for (int i = 0; i < elements.size(); i++) {
Object element = elements.get(i);
if (element instanceof JRPrintText) {
exportText((JRPrintText) element);
} else if (element instanceof JRPrintFrame) {
JRPrintFrame frame = (JRPrintFrame) element;
setFrameElementsOffset(frame, false);
try {
exportElements(frame.getElements());
} finally {
restoreElementOffsets();
}
}
}
As you can see only the JRPrintText will be prinited. And the protected void exportText(JRPrintText) method does not know anything about Boxes. You can compare it whith the source of JRRtfExporter.exportText(JRPrintText) method.

_________________________________________________________

. It is \r\n at the start, the some numbers of underscore and \r\n at the end of line. The reports properties can be something like this:<property name="net.sf.jasperreports.export.text.page.height" value="66"/>
<property name="net.sf.jasperreports.export.text.page.width" value="94"/>
<property name="net.sf.jasperreports.export.text.line.separator" value="
_________________________________________________________
"/>