  | 
              
	              
	                
 
  
    |   | 
   
  
    
        
        Java ขอสอบถามเรื่องการใช้ JasperReport ใน Netbeans ครับ     | 
   
  
    |   | 
   
 
 
 
	
		
			  | 
	   | 
	    | 
		
			  | 
	 
	
		
			  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                ขอรบกวนหน่อยครับคือติดนิดเดียวจิงๆ  
การใช้งานทั่วไปพอทำได้ครับ แต่! ที่อยากถามคือ 
 
เมื่อเราเปิดรีพอร์ทมาเพื่อปริ้นหรือเพื่อดูก็แล้วแต่ พอเรากดปิดทำโปรแกรมทั้งที่ยังทำงานอยู่ถูกปิดไปด้วยอ่ะครับ 
(หมายถึงโปรแกรมที่เราเขียนขึ้นมานี่แหละครับ JAVA, NETBEANS, MS ACCESS)  
 
โค้ดตอนเปิด 
 
Code (Java) 
try {
            JasperReport report = JasperCompileManager.compileReport("report1.jrxml");
            JasperPrint print = JasperFillManager.fillReport(report, param, conn);
            JasperViewer.viewReport(print);
        } catch (JRException ex) {
            Logger.getLogger(mainPage.class.getName()).log(Level.SEVERE, null, ex);
        }
 
 
  Tag : Java, Ms Access, iReport, JAVA, Windows               
                        | 
           
          
            | 
			
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2014-01-21 01:41:48 | 
                      By :
                          ideasza | 
                      View :
                          2019 | 
                      Reply :
                          6 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  | 
	 
	
		
			  | 
		  | 
		
			  | 
		
			  | 
	 
 
              
  
          
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 คิดว่าไม่น่าจะเกี่ยวกับตัวนี้น่ะครับ                          
               
               | 
             
            
              
			  			  
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2014-01-21 09:49:26 | 
                        By :
                            mr.win | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ผมงง คำถาม                         
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2014-01-22 15:16:34 | 
                        By :
                            panyapol | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ได้แล้ว มาแชร์ให้กับคนที่ยังติดอยู่นะครับ 
 
อันนี้เป็นโค้ดที่ผมติดปัญหาครับ 
 
Code (Java) 
try {
JasperReport report = JasperCompileManager.compileReport("report1.jrxml");
JasperPrint print = JasperFillManager.fillReport(report, param, conn);
JasperViewer.viewReport(print);
} catch (JRException ex) {
Logger.getLogger(mainPage.class.getName()).log(Level.SEVERE, null, ex);
}
 
 
แก้ไขนิดเดียวครับ 
 
Code (Java) 
JasperViewer.viewReport(print, false);
  
 
ให้ใส่ false ต่อเข้าไปครับ 
 
เมื่อปริ้นรีพอร์ทเสร็จปิดรีพอร์ทเพื่อพิมพ์รีพอร์ทอื่นต่อ โปรแกรมก็จะไม่ถูกปิดไปด้วยครับ 
 
***ขออภัยสำหรับคนที่รู้แล้วนะครับ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2014-01-28 11:09:48 | 
                        By :
                            ideasza | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                   จัดไปครับ                        
               
               | 
             
            
              
			  			  
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2014-01-28 12:09:38 | 
                        By :
                            mr.win | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     | 
   
 
                 |