Hitachi Vantara Pentaho Community Forums
Results 1 to 1 of 1

Thread: How to use PivotViewComponent in report

  1. #1

    Default How to use PivotViewComponent in report

    Hi All:

    I'm evaluating Pentaho Reporting for past 3-4 days for the company I work for. First impression is good. However, one of the must have features for us is "pivoting capability". From the samples, I can see couple of analysis reports with pivoting capability. So, I know its possible.
    As a second step, I tried to create such analysis report with PivotViewComponent myself. However, I am running into issues.

    I configured Pentaho BI Platform with Oracle 10g. All the reports are working fine and I even created and published couple of .report files. So, there are no environment setup issues.

    Next, I took "samples/analysis/query1.xaction" and "samples/analysis/SampleData.mondrian.xml" as the starting-point and created my own .xaction file and mondrian schema. However, when I try to execute the report, I get following NullPointException:

    Failed
    Error: Base.ERROR_0002 - Component execution failed - java.lang.NullPointerException (org.pentaho.plugin.olap.PivotViewComponent)

    Debug: Starting execute of samples/analysis/demo.xaction (org.pentaho.core.solution.SolutionEngine)
    Debug: Getting runtime context and data (org.pentaho.core.solution.SolutionEngine)
    Debug: Loading action sequence definition file (org.pentaho.core.solution.SolutionEngine)
    Debug: SolutionRepository.DEBUG_FILE_PATH - getFile path=D:\Pentaho\pentaho-solutions\samples\analysis\demo.xaction (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding variable source request to parameter merchant (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding default value of "[]" to parameter merchant (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding variable source request to parameter activityDate (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding default value of "[]" to parameter activityDate (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding variable source request to parameter status (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding default value of "[]" to parameter status (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding variable source request to parameter mdx (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding default value of "select NON EMPTY {[Measures].[AMOUNTSMS]} ON COLUMNS, NON EMPTY Crossjoin({ {merchantSelects} }, Crossjoin({ {activityDateSelects} }, { {statusSelects} } ) ) ON ROWS from [Merchant Analysis]" to parameter mdx (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding variable source request to parameter mode (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding default value of "execute" to parameter mode (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding variable source request to parameter cube (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding default value of "Merchant Analysis" to parameter cube (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: Adding variable source response to parameter url (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: audit: instanceId=0a70c6aa-a326-11dc-b50e-b33e1883b48c, objectId=org.pentaho.core.runtime.RuntimeContext, messageType=action_sequence_start (org.pentaho.core.runtime.RuntimeContext)
    Debug: validateComponent validating component JavascriptRule (org.pentaho.core.runtime.RuntimeContext)
    Debug: Validating component for action demo.xaction (org.pentaho.plugin.javascript.JavascriptRule)
    Debug: validateComponent validating component PivotViewComponent (org.pentaho.core.runtime.RuntimeContext)
    Debug: Validating component for action demo.xaction (org.pentaho.plugin.olap.PivotViewComponent)
    Debug: Executing action sequence (org.pentaho.core.runtime.RuntimeContext)
    Debug: Executing action definition: Iteration 0 (org.pentaho.core.runtime.RuntimeContext)
    Debug: audit: instanceId=0a70c6aa-a326-11dc-b50e-b33e1883b48c, objectId=JavascriptRule, messageType=component_execution_started (org.pentaho.core.runtime.RuntimeContext)
    Debug: execute pre-audit (org.pentaho.core.runtime.RuntimeContext)
    Debug: Setting component log level to DEBUG (org.pentaho.core.runtime.RuntimeContext)
    Debug: Initializing component (org.pentaho.core.runtime.RuntimeContext)
    Debug: executeComponent starting audited execute (org.pentaho.core.runtime.RuntimeContext)
    Debug: SolutionRepository.DEBUG_FILE_PATH - getFile path=D:\Pentaho\pentaho-solutions (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: execute validation=true (org.pentaho.plugin.javascript.JavascriptRule)
    Debug: script=function getSelects( baseStr, values ) { rtnStr = baseStr; if ( values == null ) { // Do nothing and the baseStr will be returned } else if ( typeof( values ) == "string" ) { rtnStr += values; } else { rtnStr = baseStr; if ( (values != null) && (values.length >= 1) ) { rtnStr += values[0]; for ( i = 1; i < values.length; ++i ) { rtnStr += ", " + baseStr + values[i]; } } } java.lang.System.out.println("tapasvi"+ rtnStr ); return( rtnStr ); } merchantSelects = getSelects( "[Merchant].[All Merchants]", merchant ); activityDateSelects = getSelects( "[ActivityDate].[All ActivityDates]", activityDate ); statusSelects = getSelects( "[Status].[All Status]", status ); (org.pentaho.plugin.javascript.JavascriptRule)
    Debug: executeComponent finished audited execute (org.pentaho.core.runtime.RuntimeContext)
    Debug: execute post-audit (org.pentaho.core.runtime.RuntimeContext)
    Debug: audit: instanceId=0a70c6aa-a326-11dc-b50e-b33e1883b48c, objectId=JavascriptRule, messageType=component_execution_ended (org.pentaho.core.runtime.RuntimeContext)
    Debug: audit: instanceId=0a70c6aa-a326-11dc-b50e-b33e1883b48c, objectId=PivotViewComponent, messageType=component_execution_started (org.pentaho.core.runtime.RuntimeContext)
    Debug: execute pre-audit (org.pentaho.core.runtime.RuntimeContext)
    Debug: Setting component log level to DEBUG (org.pentaho.core.runtime.RuntimeContext)
    Debug: Initializing component (org.pentaho.core.runtime.RuntimeContext)
    Debug: executeComponent starting audited execute (org.pentaho.core.runtime.RuntimeContext)
    Debug: SolutionRepository.DEBUG_FILE_PATH - getFile path=D:\Pentaho\pentaho-solutions (org.pentaho.repository.filebased.solution.SolutionRepository)
    Debug: execute validation=true (org.pentaho.plugin.olap.PivotViewComponent)
    Error: Base.ERROR_0002 - Component execution failed - java.lang.NullPointerException (org.pentaho.plugin.olap.PivotViewComponent)
    Debug: executeComponent finished audited execute (org.pentaho.core.runtime.RuntimeContext)
    Error: RuntimeContext.ERROR_0012 - ActionDefinition for PivotViewComponent did not execute successfully (org.pentaho.core.runtime.RuntimeContext)
    Debug: audit: instanceId=0a70c6aa-a326-11dc-b50e-b33e1883b48c, objectId=org.pentaho.core.runtime.RuntimeContext, messageType=action_sequence_failed (org.pentaho.core.runtime.RuntimeContext)
    Error: SolutionEngine.ERROR_0007 - Action sequence execution failed (org.pentaho.core.solution.SolutionEngine)

    Server Version: Pentaho BI Platform 1.6.0.GA.863
    I've attached following files with this post:

    1. demo.xaction
    2. demo.mondrian.xml

    I will be happy to share more details with you. 'Pivoting' is kind of make-or-break functionality for us. This has to work out for us to use this tool to serve our customers.

    Thanks,
    Tapasvi
    Attached Files Attached Files

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.