Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Plan your Crypto & Forex entries before you take the trade
romeshnonis
Updated:
Today at 3:20 AM
RHCSA, RHCE, AWS, Docker, Kubernetes Training
Sanjeewani95
Updated:
Tuesday at 10:28 AM
🛡️ Kaspersky Antivirus – 1 Year / 1 Device | Rs. 2,300 | Only 9 Left
KSPathirana
Updated:
Sep 7, 2026
Ad icon
Professional CCTV Installation Service
Techguy231
Updated:
Sep 6, 2026
Ad icon
I'll research & write an article - Rs. 2000 onwards
Blogerwiki
Updated:
Sep 3, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
JAVA
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="adasi" data-source="post: 10768826" data-attributes="member: 363430"><p>meken wenne <span style="color: Blue">"This method call by itself"</span>....ewa mata therenawa ayya.....</p><p></p><p>data bits ,status bits(status registry) ,ack bits gananam mama echchara danne na ayya...</p><p></p><p>Mata one report(jasper) ekak, view wenne nathuwa..print dialog eka open wenne nathuwa..kelinma print button eka press kalama print kara ganna..</p><p></p><p>Mekata kiyanne direct print kiyalada koheda....... </p><p></p><p>mata cord ekak hambuna...eka wada karanne na.......that is below..</p><p></p><p></p><p><span style="color: Blue">public class cls_Report_passBook {</span></p><p><span style="color: Blue"> String reportDir = "D:\\easyBanker\\src\\Report\\";</span></p><p><span style="color: Blue"> public void generateReport(String reportname, Map params) throws JRException{</span></p><p><span style="color: Blue"> String printer="CutePDF Writer";</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> PrintService service = null;</span> <span style="color: Blue"></span></p><p><span style="color: Blue"> PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();</span></p><p><span style="color: Blue"> aset.add(MediaSizeName.ISO_A4);</span></p><p><span style="color: Blue"> PrintService[] services3 = PrintServiceLookup.lookupPrintServices(null, null);</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> for(int k=0;k<services3.length;k++){</span> <span style="color: Blue"></span></p><p><span style="color: Blue"> if(services3[k].getName().trim().equals(printer.trim())){</span></p><p><span style="color: Blue"> service = services3[k];</span></p><p><span style="color: Blue"> }</span></p><p><span style="color: Blue"> }</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> if(service == null){</span> <span style="color: Blue"></span></p><p><span style="color: Blue"> System.out.println("PRINTER NOT FOUND->"+printer);</span></p><p><span style="color: Blue"> }else {</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> JasperReport jr = JasperCompileManager.compileReport(reportDir + reportname);</span> <span style="color: Blue"></span></p><p><span style="color: Blue"> JasperPrint jp = JasperFillManager.fillReport(jr, params, new cls_Connect().connect());</span></p><p><span style="color: Blue"> // JasperViewer.viewReport(jp, false);</span></p><p><span style="color: Blue"> JRExporter exporter = new JRPrintServiceExporter();</span></p><p><span style="color: Blue"> exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);</span></p><p><span style="color: Blue"> exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, service.getAttributes());</span></p><p><span style="color: Blue"> exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, service.getAttributes());</span></p><p><span style="color: Blue"> exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE);</span></p><p><span style="color: Blue"> exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE);</span></p><p><span style="color: Blue"> exporter.exportReport();</span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> }</span> <span style="color: Blue"></span></p><p><span style="color: Blue"></span></p><p><span style="color: Blue"> }</span> <span style="color: Blue"></span></p><p><span style="color: Blue"></span>}</p><p></p><p>if you can put some cording regarding my problem..please..</p></blockquote><p></p>
[QUOTE="adasi, post: 10768826, member: 363430"] meken wenne [COLOR=Blue]"This method call by itself"[/COLOR]....ewa mata therenawa ayya..... data bits ,status bits(status registry) ,ack bits gananam mama echchara danne na ayya... Mata one report(jasper) ekak, view wenne nathuwa..print dialog eka open wenne nathuwa..kelinma print button eka press kalama print kara ganna.. Mekata kiyanne direct print kiyalada koheda....... mata cord ekak hambuna...eka wada karanne na.......that is below.. [COLOR=Blue]public class cls_Report_passBook { String reportDir = "D:\\easyBanker\\src\\Report\\"; public void generateReport(String reportname, Map params) throws JRException{ String printer="CutePDF Writer"; PrintService service = null;[/COLOR] [COLOR=Blue] PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); aset.add(MediaSizeName.ISO_A4); PrintService[] services3 = PrintServiceLookup.lookupPrintServices(null, null); for(int k=0;k<services3.length;k++){[/COLOR] [COLOR=Blue] if(services3[k].getName().trim().equals(printer.trim())){ service = services3[k]; } } if(service == null){[/COLOR] [COLOR=Blue] System.out.println("PRINTER NOT FOUND->"+printer); }else { JasperReport jr = JasperCompileManager.compileReport(reportDir + reportname);[/COLOR] [COLOR=Blue] JasperPrint jp = JasperFillManager.fillReport(jr, params, new cls_Connect().connect()); // JasperViewer.viewReport(jp, false); JRExporter exporter = new JRPrintServiceExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp); exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, service.getAttributes()); exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, service.getAttributes()); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE); exporter.exportReport(); }[/COLOR] [COLOR=Blue] }[/COLOR] [COLOR=Blue] [/COLOR]} if you can put some cording regarding my problem..please.. [/QUOTE]
Insert quotes…
Verification
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom