Changes for page Reports
on 2015/10/23 19:12
on 2015/10/23 19:17
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (31 modified, 0 added, 0 removed)
- VoilaCapture25.png
- VoilaCapture26.png
- jsr-field.jpg
- jsr-tool.jpg
- jsr-datasource.jpg
- jsr-sourceinst.jpg
- jsr-queryl.jpg
- jsr-query.jpg
- jsr-queryfields.jpg
- jsr-opttitle.jpg
- jsr-fields.jpg
- jsr-subreport1.jpg
- jsr-subreport2.jpg
- jsr-subreport3.jpg
- jsr-subreport4.jpg
- jsr-subreportdir.jpg
- jsr-subreportdir2.jpg
- jsr-deploy1.jpg
- jsr-deploy2.jpg
- jsr-deploy3.jpg
- jsr-deploy4.jpg
- jsr-deploy5.jpg
- jsr-deploy6.jpg
- jsr-deploy7.jpg
- jsr-deploy8.jpg
- jsr-deploy9.jpg
- jsr-deploy10.jpg
- jsr-deploy11.jpg
- jsr-deploy12.jpg
- print.jpg
- printstep.jpg
Details
- Page properties
-
- Content
-
... ... @@ -191,99 +191,58 @@ 191 191 192 192 [[image:jsr-deploy3.jpg]] 193 193 194 -== Générationdu rapport==194 +== Report processing == 195 195 196 - Les rapportspeuventêtre générés dansuneaction(sur click puis download durésultatparl'utilisateur), ou dansuneopératio,ce quiermet demettrele résultatenattachementd'unobjetetdoncde le stockerou del'envoyerviaunworkflow par exemple.196 +Reports can be generated in an action or by an operation script, in order to attach the result to an instance of an entity or to send it using a notification 197 197 198 198 199 199 200 -=== Dansuneaction ===200 +=== Within an action === 201 201 202 - Dansuneaction,le rapportpeutêtre généréenutilisantuneétapedetype "Print".202 +Within an action, the report can be generated by using a step of type "Print". 203 203 204 204 205 - Parexemple,essayonsd'imprimerunrapportquicontient2paramètresdetypedateàsaisirparl'utilisateur.205 +(% style="font-size: 14px; background-color: rgb(245, 245, 245);" %)Create an action named "print", click "Instance" and add a step of type "Print" (the PDF icon in the toolbar)[[image:print.jpg]] 206 206 207 -Dans cet exemple, nous avons un rapport jrxml qui utilise les 2 paramètres de type java.util.Date: parameter1 et parameter2 208 208 209 209 210 -[[image:jsr-deploy4.jpg]] 211 211 212 212 213 -==== définition du rapport ==== 214 214 215 -Dans Design / Rapports et graphiques / Rapports Jasper, on crée un nouveau rapport: 216 216 217 -[[image:jsr-deploy5.jpg]] 218 218 219 219 220 -A noter les 2 paramètres qui sont définis : parameter1 et parameter2 et les expressions pour les valeurs (plus d'explications dans la suite) 221 221 222 - ====définitiondel'entitéqui vapermettrela saisiedesparamètres====216 +Select the "Printing Type" to "Report" and select your report in the "Report" property.[[image:printstep.jpg]][[image:jsr-deploy11.jpg]] 223 223 224 -Les 2 paramètres doivent être saisis par l'utilisateur. Pour cela on crée une entitée non persistée. 225 - 226 -[[image:jsr-deploy6.jpg]] 227 - 228 -On lui ajoute 2 propriétés de type date: Param1 et Param2. Dans cet exemple, l'entité a été crée dans le bundle customisations, dont le préfixe est "cust". Le nom complet des propriétés est donc custParam1 et custParam2. D'ou le nom et la syntaxe des expressions des 2 paramètres. A adapter en fonction de vos entités. 229 - 230 -[[image:jsr-deploy6.jpg]] 231 - 232 - 233 -Puis on crée une action testPrint: 234 - 235 -[[image:jsr-deploy8.jpg]] 236 - 237 - 238 -La première étape construit un objet custTestReportParams en mémoire et le stocke dans la variable "params" 239 - 240 -La seconde étape permet la saisie des 2 parametres par l'utilisateur de l'objet stocké dans "params" 241 -[[image:jsr-deploy9.jpg]] 242 - 243 - 244 -La 3ème étape déclache la géneration du rapport. Sa définition est la suivante: 245 - 246 -[[image:jsr-deploy10.jpg]] 247 - 248 -A noter le champs Entrée qui permet de préciser l'objet utilisé pour évaluer les expressions de valeur de paramètre (ici "params"). 249 -C'est cet objet qui servira de base au calcul des ${custParam1} défini dans l'objet "JasperReport" et dont les valeurs seront passées à JasperReports comme paramètres du rapport. 250 - 251 - 252 - 253 -Le résultat est alors le suivant:\\ 254 - 255 -[[image:jsr-deploy11.jpg]] 256 - 257 257 [[image:jsr-deploy12.jpg]] 258 258 259 -=== Dansuneopération ===220 +=== Using an Operation script === 260 260 261 - Dansune opération,la génération du rapport sefaitpar duscript:222 +Add a "Script" step to your operation : 262 262 263 -// retrieve the report 224 +// ~/~/ retrieve the report 264 264 var report = sysReport.Get("402881ff1cbdc5aa011cbde9dfc915ac"); 265 - // retrieve the PDF result 226 + // ~/~/ retrieve the PDF result 266 266 var result = report.PrintReport(data); 267 - // set the report as an attachement 228 + // ~/~/ set the report as an attachement 268 268 data.custFile = result.sysData;// 269 269 270 - Danscet exemple,le rapportestattachédansla propriétécustFile de l'objet231 +In the example the report in attached to the custFile property defined as a "File Attachment" type. 271 271 272 272 273 -==== Valorisationdesparamètresdansl'appeld'opération====234 +==== Passing parameters to the report ==== 274 274 275 - Les paramètrespeuventêtrevalorisésde 2manières:236 +Parameters value can be passed in 2 ways: 276 276 277 -* s oit enpassantun objetencontexte.Lesdéfinitionsde paramètresutiliséesetlesexpressions ${xxxx}serontvalorisées parrapportà cet objet.238 +* Using an entity instance. (% style="font-family: sans-serif; font-size: 14px; font-style: normal; line-height: 19.6000003814697px; text-align: start;" %)${xxxx} (%%)expressions refer to entity properties 278 278 279 -// retrieve the PDF result 280 - var result = report.PrintReport(data); // the params are calculated based on 'data' 240 +// var result = report.PrintReport(data); // ~/~/ the params are calculated based on 'data' 281 281 282 282 283 -* soit en passant un tableau de paramètres en utilisant un objet avec une notation JSON 284 - // retrieve the PDF result 285 - var params = { 243 +* Using a JSON object 244 +// var params = { 286 286 param1:"test", 287 287 param2:"test2" 288 288 } 289 - var result = JasperReports.Print(report, null, report.rqFormat, params); // the params are in params' 248 + var result = JasperReports.Print(report, null, report.rqFormat, params); // ~/~/ the params are in params'
- VoilaCapture25.png
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +57.9 KB - Content
- VoilaCapture26.png
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +93.9 KB - Content
- jsr-field.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 -0 bytes1 +22.0 KB - Content
- jsr-tool.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +3.1 KB - Content
- jsr-datasource.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 -0 bytes1 +40.1 KB - Content
- jsr-sourceinst.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 -0 bytes1 +20.2 KB - Content
- jsr-queryl.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +32.5 KB - Content
- jsr-query.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +67.6 KB - Content
- jsr-queryfields.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +87.6 KB - Content
- jsr-opttitle.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +4.4 KB - Content
- jsr-fields.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +4.2 KB - Content
- jsr-subreport1.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +31.6 KB - Content
- jsr-subreport2.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +35.3 KB - Content
- jsr-subreport3.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +27.9 KB - Content
- jsr-subreport4.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +31.1 KB - Content
- jsr-subreportdir.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +25.7 KB - Content
- jsr-subreportdir2.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 -0 bytes1 +20.6 KB - Content
- jsr-deploy1.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +67.8 KB - Content
- jsr-deploy2.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +16.6 KB - Content
- jsr-deploy3.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 -0 bytes1 +46.0 KB - Content
- jsr-deploy4.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 -0 bytes1 +101.9 KB - Content
- jsr-deploy5.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +32.3 KB - Content
- jsr-deploy6.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 -0 bytes1 +28.0 KB - Content
- jsr-deploy7.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +23.4 KB - Content
- jsr-deploy8.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +36.5 KB - Content
- jsr-deploy9.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +15.9 KB - Content
- jsr-deploy10.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 -0 bytes1 +39.0 KB - Content
- jsr-deploy11.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +15.3 KB - Content
- jsr-deploy12.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +18.5 KB - Content
- print.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +46.3 KB - Content
- printstep.jpg
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 0bytes1 +31.4 KB - Content