show - How to display an Report using DynamicReports on a JFrame? -
i want display report
on jframe
without using show()
method.
i don't want have popup frame, want see on jframe
.
here current situation:
private void jbutton1actionperformed(java.awt.event.actionevent evt) { jasperreportbuilder jrb = new jasperreportbuilder(); int ifontsizestringi = (integer) jspinner1.getvalue(); int ifontsizestringii= (integer) jspinner2.getvalue(); string spagesize =(string)jcombobox1.getselecteditem(); string spageorientation = (string)jcombobox2.getselecteditem(); string 1 = jtextfield1.gettext(); string 2 = jtextfield2.gettext(); fontbuilder fonti = stl.font("courier new", true, false, ifontsizestringi); fontbuilder fontii = stl.font("courier new", true, false, ifontsizestringii); if(spageorientation.equalsignorecase("landscape") && spagesize.equalsignorecase("a4")) jrb.setpageformat(pagetype.a4, pageorientation.landscape); if(spageorientation.equalsignorecase("landscape") && spagesize.equalsignorecase("a3")) jrb.setpageformat(pagetype.a3, pageorientation.landscape); if(spageorientation.equalsignorecase("portrait") && spagesize.equalsignorecase("a3")) jrb.setpageformat(pagetype.a3, pageorientation.portrait); jrb.title(cmp.verticallist(cmp.text(one).setstyle(stl.style().setborder(stl.pendouble()).setfont(fonti) .sethorizontalalignment(horizontalalignment.center)),cmp.text(two).setstyle(stl.style() .setfont(fontii).sethorizontalalignment(horizontalalignment.center).setborder(stl.pendouble())))); try { jrb.show(false); } catch (drexception ex) { exceptions.printstacktrace(ex); } }
what have change let me show in jframe
? when it's possible without jrxml
file?
jframe frame = new jframe("report"); frame.getcontentpane().add(new jrviewer(jrb.tojasperprint())); frame.pack(); frame.setvisible(true);
Comments
Post a Comment