2013年12月17日 星期二

iReport 5.5 EXCEL產生程式範例(別版未必適用)

JasperPrint jasperPrint;
JRResultSetDataSource jrds=null; 
 String filePath = application.getRealPath("test.jasper");
   /* 設定輸出 PDF 檔的路徑位置 */
   String outPath = application.getRealPath("\\pdf\\test_"+Pdf_Name+".pdf");
try   {
  
   /* 帶參數進去給報表 */
   Map map = new HashMap();
   map.put("name","王小明");
  
   JasperPrint print = JasperFillManager.fillReport(filePath,map, new JRResultSetDataSource(rs));
      JRAbstractExporter exporter = new JExcelApiExporter();
  // exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); //EXCEL分頁參數
     exporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
   exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,   outPath);
   exporter.setParameter(JRExporterParameter.JASPER_PRINT,print);
   exporter.exportReport();

}   catch   (JRException   e)   {
e.printStackTrace();
}

iReport 5.5 PDF 產生程式範例(別版未必適用)

JasperPrint jasperPrint;
JRResultSetDataSource jrds=null; 
 String filePath = application.getRealPath("test.jasper");
   /* 設定輸出 PDF 檔的路徑位置 */
   String outPath = application.getRealPath("\\pdf\\test_"+Pdf_Name+".pdf");
try   {
  
   /* 帶參數進去給報表 */
   Map map = new HashMap();
   map.put("name","王小明");
  
   JasperPrint print = JasperFillManager.fillReport(filePath,map, new JRResultSetDataSource(rs));  
   JRExporter exporter =new net.sf.jasperreports.engine.export.JRPdfExporter();
   exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outPath);
   exporter.setParameter(JRExporterParameter.JASPER_PRINT,print);
   exporter.exportReport();
}
 catch (JRException e)
{
 e.printStackTrace();
 System.exit(1);
}
 catch (Exception e)
{
 e.printStackTrace();
 System.exit(1);
}

2013年12月9日 星期一

在iRepport 5.5 中同時顯示繁體和簡體字

iReport 已內建亞洲字型, 到下圖位置引用就可以.
如果是在繁體XP要使用簡體字, 比較麻煩.
可以參考下篇文章.



 
 
設定繁體字呈現style
設定簡體字呈現style
依需求選擇要呈現的字型style

2013年1月9日 星期三

MSN 移轉到 skype

在下列網頁下載程式並依指示執行 http://beta.skype.com/en/download-skype/skype-for-computer/