2014年5月19日 星期一

JavaWebApp+Struts2+JasperReport 功能實作

功能需求:
  1. 另存新檔產出的報表。
  2. 顯示當前頁數以及總頁數。
  3. 控制每頁顯示筆數。

實作:
  1. 另存新檔產出的報表(以annotation方式為例):
    @Result(name = "genPDF", type="jasper", location = "/views/Report/testReport.jasper",
params={"dataSource","dataList","format","PDF"})
    上述為於web上顯示。
    @Result(name = "genAttachPDF", type="jasper", location = "/Report/testReport.jasper",
params={"dataSource","dataList","format","PDF","contentDisposition","attachment",
                                      "documentName","Report"})
    上述為另存新檔的寫法。兩者差異在,加入了contentDispostion參數設為attachment是另外新
    檔,以及documentName參數將檔案名稱設為Report。

  2. 顯示當前頁數以及總頁數:
    在調色板中有個「Page X of Y」物件,拉進page footer即可。Y代表當前頁數,Y代表總頁 數。

  3. 控制每頁顯示筆數:
    原本想要做到動態顯示,由使用者設定每頁顯示筆數 ,不過目前先做固定筆數。
    以每頁顯示10筆為例。在<Detail>尾端加入page break,在page break的Print When Expression加
    入「($V{REPORT_COUNT}%10)==0」,REPORT_COUNT代表在這張報表中的第幾筆資
    料,當顯示到第10筆時,印出page break來換頁。

2014年4月18日 星期五

開發iReport web application 遭遇的exception

SAXParseException: 不允許屬性'uuid',出現在jasper。
原因:jasperrport.jar是4.2,與iReport Designer 5.5製作出來的jrxml不符。
解決方法:將.jar改成5.5即可。


PDF無法顯示中文字。
原因:iReport Designer 5.5並無中文字型。
解決方法:請參考別人撰寫的解決方法。
http://blog.kent-chiu.com/blog/2013/05/12/jasper-report-font-issue/
注意:所要加入的字型.jar要加到iReport Designer的ClassPath。

2013年12月25日 星期三

如何跨領域研究以及困難

  選擇進入IT領域後,不斷學習是必然的。不管是在自已的專業領域,或是跨領域知識,都是要學習的項目。那如何開始學習跨領域知識,洪教授有分享他的心得,如以下網誌:

台大資工 洪士灝&PAS Lab
http://hungsh-ntucsie.blogspot.tw/2013/12/blog-post_23.html



2013年12月6日 星期五

寫程式這件事在學校與在業界中有何差異?

What's difference between college-level and corporate programming?


從台大洪教授fb分享的連結看到這篇,我想把他翻成中文,希望自已進入職場前多了解一些,甚至在研究所就開始加入一些觀點,來快速適應職場環境。也希望中文版的內容可以幫助到更多人。


(待)




quote from:
http://arstechnica.com/information-technology/2013/12/whats-the-difference-between-college-level-and-corporate-programming/
by Stack Exchange

About the emguCV running in Windows Phone 8

在十月份的時候我在EmguCV的社群發了一封留言,請教EmguCV有沒有支援在WP8 APP。就在11/3我收到回覆,內容為:

Sorry, Windows Phone 8 is not supported. Windows 8 App store refers to the Windows 8 store running on x86, not Windows phone 8 store running arm. Microsoft is having too many different platforms at the moment:

1. Windows Desktop (regular windows executable)
2. Windows 8 App store App running on x86 (used to be called the metro interface)
3. Windows RT App store running on ARM (e.g. MS Surface, Surface 2) 
4. Windows Phone 8 App store running on ARM (e.g. Nokia phones)

As silly as it seems, app build for one platform cannot run on the others. None of platform 2, 3 and 4 seems to be a success at the moment and market share is small. Emgu CV currently support platform 1 & 2. It is possible to support platform 3 but we do not see enough demand for it. We don't have a road map for platform 4 yet because open cv do not support Windows Phone 8. 

Best regards,

Canming



整理:
    EmguCV目前支援在x86架構上,所以Windows Desktop跟Windows 8 App可以呼叫來用。但是WinRT跟WP8是ARM架構,所以不支援。
    在最後一段他寫了一些原因,也似乎婊了一下Microsoft。Win8 App、WinRT App跟WP8 App都是你家的東西,但build出來的App卻不能全部支援,有點愚蠢,而且這三個東西現在似乎還沒成功,市場也小。
    WinRT目前需求不大,不支援。OpenCV不支援WP8,所以EmguCV也無法支援。