Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Parameter, Filter, Charts

  1. #1
    Join Date
    Jun 2008
    Posts
    14

    Default Parameter, Filter, Charts

    Hi,

    I designed a sales report and now have the situation, that I would need the functionality, that the authentication is done partly by the sales man.

    I made a authentication over the admin site, but this is just, whether a user can use the report in generally or not.

    So, I would need the report so, that it is only performed for the transactions of the sales man, who is logged in, because he or she may not see the transactions of the colleagues.

    How I imagine, this would go with a filter, but I don't know where and how the filter should be build and propagated.

    Perhaps a parameter will be necessary to in order to give the report the information, which select will have to be performed.

    I am also interrested about information, how a chart could be added to a report, because this would also be one of the next things to do.

    Please give me information, how this could be solved with pentaho.

    Lg,

    Frank

  2. #2
    Join Date
    Dec 2005
    Posts
    531

    Default

    Hi,

    in short, you can do this in the xaction.

    There you can retrieve the user from the session, put it in a variable/parameter and then pass the parameter into the query.

    Here is the relevant WIKI page. (http://wiki.pentaho.com/display/Pent...tion+Sequences)

    Regards,
    Ingo

    P.s.: Example of an xaction that retrieves a user and uses it in a SQL query.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <action-sequence> 
      <title>Country Security - Country List</title>
      <documentation> 
        <author>xyz</author>  
        <description>xaction to determin all countries for user.</description>  
        <icon></icon>  
        <result-type/> 
      </documentation>
    
      <inputs> 
        <user type="string"> 
          <sources> 
            <security>principalName</security> 
          </sources>  
          <default-value><![CDATA[test]]></default-value> 
        </user> 
      </inputs>
    
      <outputs> 
        <country_list_result type="result-set"> 
          <destinations> 
            <session>country_list_result</session> 
          </destinations> 
        </country_list_result> 
      </outputs>
    
      <resources/>
      
      <actions> 
        <action-definition> 
          <component-name>SQLLookupRule</component-name>
          <action-type>Security Query</action-type>
          <action-inputs> 
            <user type="string"/> 
          </action-inputs>
          <action-outputs> 
            <query-result type="result-set" mapping="country_list_result"/> 
          </action-outputs>
          <component-definition> 
            <jndi><![CDATA[bl_xyz]]></jndi>  
            <live><![CDATA[false]]></live>  
            <query><![CDATA[SELECT DISTINCT g.country_name
    FROM 	dim_geography g,
    			sys_users_dimensions ud,
    			sys_users u,
    			sys_dimensions d
     WHERE d.dimension_name = 'Country'
      AND u.user_name = '{user}'
    	AND d.dimension_id = ud.dimension_id
    	AND u.user_id = ud.user_id
    	AND ud.dimension_key_value = g.country_id;]]></query> 
          </component-definition> 
        </action-definition>
     
      </actions> 
    </action-sequence>

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.