2017-05-29 14 views
0

私はthis pluginのGrails Grailsのでレンダリングするプラグイン3.1.1

i also read this question

でPDFにGSPから変換しようとしていますが、これは私はまだこの

java.lang.NullPointerException: null 
    at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1337) ~[na:1.8.0_131] 
    at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1197) ~[na:1.8.0_131] 
    at java.beans.Introspector.getBeanInfo(Introspector.java:426) ~[na:1.8.0_131] 
    at java.beans.Introspector.getBeanInfo(Introspector.java:173) ~[na:1.8.0_131] 
    at grails.plugins.rendering.document.RenderEnvironment.init(RenderEnvironment.groovy:31) ~[rendering-2.0.3.jar:na] 
    at grails.plugins.rendering.document.RenderEnvironment.with(RenderEnvironment.groovy:68) ~[rendering-2.0.3.jar:na] 
    at grails.plugins.rendering.document.RenderEnvironment.with(RenderEnvironment.groovy:60) ~[rendering-2.0.3.jar:na] 
    at grails.plugins.rendering.document.XhtmlDocumentService.generateXhtml(XhtmlDocumentService.groovy:65) ~[rendering-2.0.3.jar:na] 
    at grails.plugins.rendering.document.XhtmlDocumentService.createDocument(XhtmlDocumentService.groovy:35) ~[rendering-2.0.3.jar:na] 

のようないくつかのエラーを取得する私のコード。

def createPdfReport = { 
    def cif = corporateUserService.getCurrentCifUser().cif 
    def perintahkerjaIns = PerintahKerja.findByCifAndId(cif,params.id) 
    def perintahkerjaDets = PerintahKerjaDetail.findAllByPerintahKerja(perintahkerjaIns,[sort:"pohon",order:"asc"]) 
    def perintahpekerja = PerintahPekerja.findAllByPerintahKerja(perintahkerjaIns) 

    renderPdf(template: '/perintahKerja/templatprintperintahkerja',model: [jumlahpohon: perintahkerjaDets.size(), cif: cif, perintahLerjaInstance:perintahkerjaIns, perintahKerjaDetails:perintahkerjaDets, perintahPekerjaList: perintahpekerja], filename: "PerintahKerja") 
} 

私は逃したものがわかりません。

答えて

1

build.gradleには、以下の依存関係を追加します。

dependencies { 
    ... 
    runtime "org.springframework:spring-test:4.2.1.RELEASE" 
} 

私は最近とてもthisthisが使用

+0

のものであってもよいHI、あなたのソリューションは素晴らしかったが、あなたは「Lanscape」に設定する方法を知っていますか?関連した質問をプラグインいくつかのレンダリングを持つ別のユーザーを助けましたか – akiong

+0

確かに、CSSのサイズで遊んでいる可能性がありますhttp://gpc.github.io/rendering/guide/single.html#4.%20Sizing –

+0

私はすでにCSSを「サイズ:風景;」に設定しましたが、pdfにエクスポートすると、まだpotrait – akiong

1

プラグインがgrails 3で動作することは確かですか?私はプラグインgithubを読んでいるので、それはビルドが失敗していると2年前からあなたが持っているものに非常によく似ている問題に関して開いているチケットがあると言うが、今までまだ解決されていない。 githubの最後のコミットも約2年前です。 オープンチケットはGrailsの2を使用しているので、私は(それがproblably 3プラグインをGrailsのために更新されないので)、プラグインはGrailsの3のために動作しないだろうと思い

関連する問題