Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: Subreport parameters

  1. #1

    Default Subreport parameters

    I'm using ReportDesigner 1.6.0 build 348. Java Version 1.6.0_03-b5 . KUbuntu 7.10

    How do I send parameters between the main report to the subreport?.
    I need to send the the "value" of the group in the main report to the subreport so the subquery filter the resultset only for that "value" group and make the subreport show that result.

    I've already try with:
    http://wiki.pentaho.org/display/Repo...7.+Sub+Reports

    This is a similar isue:
    http://forums.pentaho.org/showthread.php?t=56505
    http://forums.pentaho.org/showthread.php?p=179811


    Name:  snapshot_main_report.jpg
Views: 1151
Size:  35.1 KB

    Name:  snapshot_subreport.jpg
Views: 1097
Size:  32.9 KB

    the queries are:
    main report query

    SELECT DISTINCT descripcion_grupo_lineas_produccion FROM dw_mahle.d_familia

    subreport query

    SELECT
    cod_grupo_lineas_produccion,
    descripcion_grupo_lineas_produccion,
    SUM(cantidad_rechazada) AS cant_rechazada
    FROM
    `d_familia` INNER JOIN `fact_rechazos` ON `d_familia`.`cod_familia` = `fact_rechazos`.`cod_familia`
    WHERE
    descripcion_grupo_lineas_produccion = ${descripcion}
    GROUP BY
    cod_grupo_lineas_produccion,
    descripcion_grupo_lineas_produccion
    Last edited by jemarroyo; 02-18-2008 at 07:46 AM. Reason: add something

  2. #2

    Default

    Hi,

    the subreport definition on the master report shows some settings on the right side. Next to the file path and the query you can edit the parameters. I activated the "Global Import" for all parameters I think. It works, but what's the export for?

    My problem is the parameter of pageOfPagesFunction:
    I have a parent report with 2 pages and 6 subreports on the report footer band. I use the pageOfPagesFunction and import the global parameters into the subreports. The first report shows the correct page number 3/8. But the other reports show also page 3/8. I think that the subreport doesn't return the incremented page number to the parent report.
    Any ideas how to solve the problem?

    THX 4 Ur help.

    Regards
    myma

  3. #3

    Default I could not send parameters

    I ve been searching all the web about that issue and did not find anything important.... sorry :-( .. I still cant make subreport read main report parameters....
    regards

  4. #4

    Default This works for me...

    1) Page Numbers: Put the pageofpagesfunction on the mainpage footer only and then add the style expression to the footer for sticky:="true"
    2) Add the import specifcally for the columns you want. I have have 14 subreports and all are based upon data from the default query on the main page.

  5. #5

    Default Page Numbers and Subreports

    I am having a problem getting page numbers & subreports to work properly. I'm using Report Designer 1.6 GA, the report (with several subreports) runs fine except that I only get the page number on the very last page of the report (page 36). The page number value on this last page is correct.

    Here is what I have done (following the previous poster's advice):

    1. Put the pageofpagesfunction on the main page footer only.

    2. This is where I may have a problem, previous poster says to - add the style expression to the footer for sticky:="true". I took this to mean that I should add "sticky;" to the Style Expression for the footer. I also tried adding "sticky;" to the message field in the footer that references the pageofpagesfunction.

    Where am I going wrong?

    Thanks,

    Chris

  6. #6

    Default

    Hi clavigne

    AS you started the Private message so nicely I decided to take a look

    I added a page of pages function and set the name and group accordingly I then added a text field in the page footer with the fieldname set to the page of pages function and previewed the report and it worked fine.

    Dunno quite what your doing wrong but it can't be much.

    Tom
    This is a signature.... everyone gets it.

    Join the Unofficial Pentaho IRC channel on freenode.
    Server: chat.freenode.net Channel: ##pentaho

    Please try and make an effort and search the wiki and forums before posting!
    Checkout the Saiku, the future of Open Source Interactive OLAP(http://analytical-labs.com)

    http://mattlittle.files.wordpress.co...-bananaman.jpg

  7. #7

    Question

    Quote Originally Posted by jemarroyo View Post
    I ve been searching all the web about that issue and did not find anything important.... sorry :-( .. I still cant make subreport read main report parameters....
    regards
    Has anyone found a solution to this problem? I'm unable to pass parameters to a sub-report using Report Designer 1.7.0

  8. #8

    Default Passing Params to Subreports...

    Hi,

    Have you solved that issue that you have faced. If you have solved those issue, can you please share the idea?

    Thanks,
    Prabhakar.

  9. #9

    Default

    Hi,
    I'm running pentaho report designer 2.0.0 i have a main report with several subreports, my problem is with the PageOfPages Function i added the function then put the message field having the same name of the function than added the style expresssion (in the page footer) : sticky:="true" .But in the preview the first and the last page have the page of pages number and some of the other pages but not all of them!!!!!!! I didn't figure it out,
    I didn't undrestand what do you mean by this : " Add the import specifcally for the columns you want"???
    Last edited by wafastat; 02-24-2010 at 11:58 AM.

  10. #10
    Join Date
    Dec 2014
    Posts
    3

    Default

    Quote Originally Posted by prabhakar_tce View Post
    Hi,

    Have you solved that issue that you have faced. If you have solved those issue, can you please share the idea?

    Thanks,
    Prabhakar.
    I know this is much later date than the original posting, but I struggled for hours on this issue and finally get to work.
    ISSUE DESCRIPTION:
    Get the Subreport to work with a Query which uses a Parameter which is fed from a column in the main report. I used that same column in a group by in my main report and want which of the subreports generated in the group Header to have a query result dependant on the value of that column.

    SOLUTION:
    1. First in your main report you need to add a new parameter that you leave empty at the main report level and you will fed with a Parameter Import in the subreport. I called it pSecurityType in my case.
    2. Then you have the define your query that you will use in the SubReport directly in the Main report (This is the key to make it work properly). So in other word in the Data Source of your main report you put both the Query that you will use in the Main report (loop on each SecurityType) and also the 2nd Query which uses the parameter you have defined in my case my second query has a condition WHERE SecurityType=${pSecurityType} and you select the first query in the main report
    3. Then you create a subreport, in the Data Source, you do not define a new data source but select the one from the inheritance section coming from your Main report. The column will not display yet
    4. For the columns of the 2nd query that you have selected to appear, it seems that you have to go to the bottom of the right panel and click on Parameter Import section and then not use * | * but instead you add all the parameters which are the same between the Main report and the subreport and also you have the column (Outter) from your Main report = SecurityType and link it to the Parameter pSecurityType. Then click OK
    5. Once you have defined the Parameter Import one by one and link to the Main report for the Parameter you want to fed from Main to Subreport, it works.
    Name:  Pentaho-SubReport-w-Parameter-FromMainReport.png
Views: 572
Size:  14.2 KBName:  Pentaho-SubReport-InheritanceQuery.png
Views: 565
Size:  14.0 KBName:  Pentaho-SubReport-QueryDefinedInMainReport.jpg
Views: 581
Size:  25.5 KB
    Last edited by cplouvier; 12-30-2016 at 12:56 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.