{"id":1718,"date":"2010-09-15T01:00:57","date_gmt":"2010-09-14T19:30:57","guid":{"rendered":"https:\/\/2thenew.today\/blog\/?p=1718"},"modified":"2016-12-19T15:16:58","modified_gmt":"2016-12-19T09:46:58","slug":"passing-parameters-to-sub-reports-in-jasper","status":"publish","type":"post","link":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/","title":{"rendered":"Passing parameters to sub-reports in Jasper"},"content":{"rendered":"<p>In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following tag in the .jrxml file: &lt;subreportParameter&gt;<\/p>\n<p>\nIn the Grails Jasper plugin, the  Jasper controller searches for the &#8220;<strong>SUBREPORT_DIR<\/strong>&#8221; in the params when the request is forwarded to it. If it does not find any key named &#8220;SUBREPORT_DIR&#8221; in the params map, it initializes the variable SUBREPORT_DIR with the value of &#8220;<strong>jasperFilePath<\/strong>&#8221; i.e. the location where the Jasper&#8217;s .jasper and .jrxml files can be found. Now suppose you want to give seperate file location for your sub-reports, you can easily do this using the following code in the .jrxml file inside the <strong><\/strong> tag:<\/p>\n<blockquote>\n<div class=\"code\">\n<pre>\r\n\r\n   ...\r\n \r\n        \r\n \r\n  ...\r\n\r\n<\/pre>\n<\/div>\n<\/blockquote>\n<p>Note the value of &#8220;<strong>![CDATA[$P{SUBREPORT_DIR}]]<\/strong>&#8221; parameter can be passed as a parameter from the controller to the master report but afterwards you can make use of the  tag to pass on the information to the subsequent sub-reports to any level.<\/p>\n<p>For more information on the jasper .jrxml tags, please visit the following link here: <\/p>\n<p>Hope this helps !!<\/p>\n<p>&#8211; Abhishek Tejpaul<br \/>\nabhishek@intelligrape.com<br \/>\n[IntelliGrape Software Pvt. Ltd]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":23,"footnotes":""},"categories":[1],"tags":[159,586,588,587],"class_list":["post-1718","post","type-post","status-publish","format-standard","hentry","category-technology","tag-jasper","tag-jasper-reports","tag-parameters-in-jasper-reports","tag-sub-reports"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Abhishek Tejpaul\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Passing parameters to sub-reports in Jasper | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Passing parameters to sub-reports in Jasper | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/#article\",\"name\":\"Passing parameters to sub-reports in Jasper | TO THE NEW Blog\",\"headline\":\"Passing parameters to sub-reports in Jasper\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/abhishek\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2010-09-15T01:00:57+05:30\",\"dateModified\":\"2016-12-19T15:16:58+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/#webpage\"},\"articleSection\":\"Technology, Jasper, jasper reports, parameters in jasper reports, sub-reports\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/#listItem\",\"name\":\"Passing parameters to sub-reports in Jasper\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/#listItem\",\"position\":3,\"name\":\"Passing parameters to sub-reports in Jasper\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/abhishek\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/abhishek\\\/\",\"name\":\"Abhishek Tejpaul\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9aad3b7249e392a23dee22fda2eb99c64c33950f509a91e8c37e82efd8c3a388?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Abhishek Tejpaul\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/\",\"name\":\"Passing parameters to sub-reports in Jasper | TO THE NEW Blog\",\"description\":\"In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/passing-parameters-to-sub-reports-in-jasper\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/abhishek\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/abhishek\\\/#author\"},\"datePublished\":\"2010-09-15T01:00:57+05:30\",\"dateModified\":\"2016-12-19T15:16:58+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Passing parameters to sub-reports in Jasper | TO THE NEW Blog","description":"In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following","canonical_url":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/#article","name":"Passing parameters to sub-reports in Jasper | TO THE NEW Blog","headline":"Passing parameters to sub-reports in Jasper","author":{"@id":"https:\/\/2thenew.today\/blog\/author\/abhishek\/#author"},"publisher":{"@id":"https:\/\/2thenew.today\/blog\/#organization"},"datePublished":"2010-09-15T01:00:57+05:30","dateModified":"2016-12-19T15:16:58+05:30","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/#webpage"},"articleSection":"Technology, Jasper, jasper reports, parameters in jasper reports, sub-reports"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.today\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/2thenew.today\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/#listItem","name":"Passing parameters to sub-reports in Jasper"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/#listItem","position":3,"name":"Passing parameters to sub-reports in Jasper","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.today\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.today\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.today\/blog\/author\/abhishek\/#author","url":"https:\/\/2thenew.today\/blog\/author\/abhishek\/","name":"Abhishek Tejpaul","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/9aad3b7249e392a23dee22fda2eb99c64c33950f509a91e8c37e82efd8c3a388?s=96&d=mm&r=g","width":96,"height":96,"caption":"Abhishek Tejpaul"}},{"@type":"WebPage","@id":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/#webpage","url":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/","name":"Passing parameters to sub-reports in Jasper | TO THE NEW Blog","description":"In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.today\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.today\/blog\/author\/abhishek\/#author"},"creator":{"@id":"https:\/\/2thenew.today\/blog\/author\/abhishek\/#author"},"datePublished":"2010-09-15T01:00:57+05:30","dateModified":"2016-12-19T15:16:58+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.today\/blog\/#website","url":"https:\/\/2thenew.today\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.today\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Passing parameters to sub-reports in Jasper | TO THE NEW Blog","og:description":"In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following","og:url":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/","og:image":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Passing parameters to sub-reports in Jasper | TO THE NEW Blog","twitter:description":"In one of our recent project, we made quite a good use of Grails Jasper plugin (v-0.9.7) to generate reports in the form of PDFs and Excel sheets. The reports contain sub-reports, which in many cases, contain sub-reports again. The way to pass parameters to sub-reports at the deeper level is to use the following","twitter:image":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"1718","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 19:56:55","updated":"2024-02-29 09:31:27","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.today\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.today\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tPassing parameters to sub-reports in Jasper\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.today\/blog"},{"label":"Technology","link":"https:\/\/2thenew.today\/blog\/category\/technology\/"},{"label":"Passing parameters to sub-reports in Jasper","link":"https:\/\/2thenew.today\/blog\/passing-parameters-to-sub-reports-in-jasper\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts\/1718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/comments?post=1718"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts\/1718\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/media?parent=1718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/categories?post=1718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/tags?post=1718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}