Hitachi Vantara Pentaho Community Forums
Results 1 to 28 of 28

Thread: TableComponent problem in CDF

  1. #1
    Join Date
    Aug 2009
    Posts
    122

    Default TableComponent problem in CDF

    Code:
    var MetaLayerHome2 = {
    topTenCustomerDefinition: {
    	colHeaders: ["Customers","Sales"],
    	colTypes: ['string','numeric'],
    	colFormats: [null,'%.0f'],
    	queryType: 'mdx',
    	displayLength: 5,
    	
    	catalog: 'solution:steel-wheels/analysis/steelwheels.mondrian.xml',
    	jndi: "SampleData",
    	query: function(){
    
    		var query = "select NON EMPTY {[Measures].[Sales]} ON COLUMNS,"+
    		" NON EMPTY TopCount([Customers].[All Customers].Children, 10.0, [Measures].[Sales]) " +
    		" ON ROWS from [SteelWheelsSales]"
    		return query;
    	}
    }
    };
    
    var topTenCustomers = 
    {
    	name: "topTenCustomers",
    	type: "tableComponent",
    	chartDefinition: MetaLayerHome2.topTenCustomerDefinition,
    	htmlObject: "sampleObject",
    	executeAtStart: true
    };
    Dashboards.init([topTenCustomers]);
    above is the sample code in pentaho-solutions\bi-developers\cdf-samples\30-documentation\30-component_reference\10-core\64-TableComponent, but it doesn't work because i got nothing.

    i am using pentaho 3.5 stable and cdf is 3.2

    server info : 17:54:28,390 ERROR [SolutionEngine] dd4ae4a8-d1cc-11de-994b-ad26cfef6169:SOLUTION-ENGINE:jtable.xaction: SolutionEngine.ERROR_0007 - Action sequence failed

    can anyone tell me why ? it is essential to me because i want to show a table when user input some condition
    Last edited by mathhew; 11-15-2009 at 06:07 AM.

  2. #2
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    You're telling me that the component reference doesn't work for you? Can you see the rest of the samples? That queries the sampledata, and should just work out of the box if you have it running
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    Aug 2009
    Posts
    122

    Default

    Quote Originally Posted by pmalves View Post
    You're telling me that the component reference doesn't work for you? Can you see the rest of the samples? That queries the sampledata, and should just work out of the box if you have it running
    thanks for reply.
    i mean the sample doesn't work itself. i open component reference and see nothing. can you give me the picture of result in "30-component_reference\10-core\64-TableComponent"?

    PS: i made a xaction which create a table , i run it and successed . but i add it in to cdf file . it failed .So i guess something is wrong about tableComponent . When i open cdf page, the server info is also "action sequence failed" . Can i get the detail error info ? i found server info is just "Action sequence failed".

    Code:
    var RYDetail = 
    {
      name: "RYDetail",
      type: "xaction",
      solution: "oracle",
      path: "B\BD\new\QYTJ",
      action: "SQL.xaction",
      htmlObject: "RYTableObject",
      executeAtStart: true,
    }

  4. #4
    Join Date
    Aug 2009
    Posts
    122

    Default

    i made a simple test , a page contain two cdf component ,which are xaction and tableComponent. i run the cdf file and get nothing instead of two table on page .but i run "SQL,XACTION" individually and it successed. . i list the code below , did i made mistakes?
    SQL.XACTION
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <action-sequence> 
      <title>SQL</title>
      <version>1</version>
      <logging-level>DEBUG</logging-level>
      <documentation> 
        <author/>  
        <description>Empty blank action sequence document</description>  
        <help/>  
        <result-type/>  
        <icon/> 
      </documentation>
    
      <inputs/>
    
      <outputs> 
        <query_result type="result-set"/> 
      </outputs>
    
      <resources/>
      
      <actions> 
        <action-definition> 
          <component-name>SQLLookupRule</component-name>
          <action-type>Relational</action-type>
          <action-inputs/>
          <action-outputs> 
            <query-result type="result-set" mapping="query_result"/> 
          </action-outputs>
          <component-definition> 
            <jndi><![CDATA[OracleData]]></jndi>  
            <query><![CDATA[SELECT BDNM ,RYLBNM, SYS
    FROM V_TS_BD_RYSL
    where ZXBZ = '1']]></query>  
            <live><![CDATA[false]]></live> 
          </component-definition> 
        </action-definition>
     
      </actions> 
    </action-sequence>
    template.html
    Code:
    <table align="center" style="border: 0px solid #000;">	
    <tr>
    	<td>
    		<tr>
    			<td align = "center" ><span id = "sampleObject"> </span> </td>
    		</tr>
    		<tr>
    			<td align = "center" ><span id = "sampleObject2"> </span> </td>
    		</tr>
    	</td>
    </tr>
    </table>
    <script language="javascript" type="text/javascript">
    
    
    var table1 = 
    {
      name: "table1",
      type: "xaction",
      solution: "oracle",
      path: "B\test\aa",
      action: "SQL.xaction",
      htmlObject: "sampleObject",
      executeAtStart: true
    }
    
    var MetaLayerHome2 = {
    topTenCustomerDefinition: {
    	queryType: 'sql',
    	displayLength: 5,
    	jndi: "OracleData",
    	query: function(){
    		var query = "SELECT BDNM ,RYLBNM, SYS FROM V_TS_BD_RYSL where ZXBZ = '1' ";
    		return query;
    	}
    }
    };
    
    var table2 = 
    {
    	name: "table2",
    	type: "tableComponent",
    	chartDefinition: MetaLayerHome2.topTenCustomerDefinition,
    	htmlObject: "sampleObject2",
    	executeAtStart: true
    };
    
    var components = [table1,table2];
    
    </script>
    
    <script language="javascript" type="text/javascript">
    
    function load(){
    	Dashboards.init(components);
    }
    
    load();
    
    </script>
    Attached Files Attached Files

  5. #5
    pstoellberger Guest

    Default

    when you're using SQL for you table component you need to rename the file jtable.xaction.sql to jtable.xaction in folder pentaho-solutions/cdf/components/ and delete the old one

  6. #6
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    There are quite a few *.xaction.sql files... If it's safe to use (replace with) the .sql files, then why do we have the "non-sql" ones?

  7. #7
    pstoellberger Guest

    Default

    because non-sql (=mdx + kettle input) is more secure than sql(nothing to do with pentaho), so you can opt sql in if you want.. but by default its "secure"

  8. #8
    Join Date
    Aug 2009
    Posts
    122

    Default

    Quote Originally Posted by pstoellberger View Post
    when you're using SQL for you table component you need to rename the file jtable.xaction.sql to jtable.xaction in folder pentaho-solutions/cdf/components/ and delete the old one
    thanks in advance...

    after i rename the file jtable.xaction.sql to jtable.xaction in folde , can i use mdx query in my table component ?

    what should i do if i want to use both sql and mdx query for table component?

  9. #9
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Yes, the .sql files have both
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  10. #10
    Join Date
    Aug 2009
    Posts
    122

    Default

    unfortunately , i still have problem about table component.
    1. i rename jtable.xcation.sql to jtable.xcation (means table component both receive sql and mdx)
    2. i run the sample code in table component page and still get nothing.

    (1) mdx code (the original code ,it can't work)
    Code:
    colHeaders: ["Customers","Sales"],
    	colTypes: ['string','numeric'],
    	colFormats: [null,'%.0f'],
    	queryType: 'mdx',
    	displayLength: 5,
    	
    	catalog: 'solution:steel-wheels/analysis/steelwheels.mondrian.xml',
    	jndi: "SampleData",
    	query: function(){
    
    		var query = "select NON EMPTY {[Measures].[Sales]} ON COLUMNS,"+
    		" NON EMPTY TopCount([Customers].[All Customers].Children, 10.0, [Measures].[Sales]) " +
    		" ON ROWS from [SteelWheelsSales]"
    		return query;
    (2) sql code (sql code, can't work either)
    Code:
    var MetaLayerHome2 = {
    topTenCustomerDefinition: {
    	colHeaders: ['BDNM'],
    	colTypes: ['string'],
    	colFormats: [null],
    	queryType: 'sql',
    	displayLength: 5,
    	jndi: "OracleData",
    	query: function(){
    		var query = "select BDNM from TS_BD";
    		return query;
    	}
    }
    };
    (3) jtable code (in biserver-ce-3.5.0.stable\biserver-ce\pentaho-solutions\cdf\components , version is 3.2 and pentaho-cdf-3.2.2.jar is in system\pentaho-cdf\lib)
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <action-sequence> 
      <title>Jtable</title>
      <version>1</version>
      <logging-level>ERROR</logging-level>
      <documentation> 
        <author/>  
        <description>Empty blank action sequence document</description>  
        <help/>  
        <result-type/>  
        <icon/> 
      </documentation>
    
      <inputs> 
    	<QUERY type="string"> 
    		<sources> 
    			<request>query</request> 
    		</sources>  
    		<default-value/>
    	</QUERY>  
    	<CATALOG type="string">
    		<sources>
    			<request>catalog</request>
    		</sources>
    		<default-value/>
    	</CATALOG>
    	<JNDI type="string"> 
    		<sources> 
    			<request>jndi</request> 
    		</sources>  
    		<default-value/> 
    	</JNDI>  
    	<CUBE type="string"> 
    		<sources> 
    			<request>cube</request> 
    		</sources>  
    		<default-value/> 
    	</CUBE>  
    	<ROLE type="string"> 
    		<sources> 
    			<session>role</session> 
    		</sources>  
    		<default-value/> 
    	</ROLE>  
    	<QUERY_TYPE type="string">
    		<sources>
    			<request>queryType</request>
    		</sources>
    		<default-value>mdx</default-value>
    	</QUERY_TYPE> 
      </inputs>
    
      <outputs> 
    	<results type="string"> 
          <destinations>
            <response>content</response>
          </destinations>
        </results>
        
      </outputs>
      
      <actions>
      
      	<actions>
    		<condition><![CDATA[QUERY_TYPE == "mdx"]]></condition>
    		    <action-definition> 
    		      <component-name>MDXLookupRule</component-name>
    		      <action-type>Query MDX</action-type>
    		      <action-inputs> 
    				<CATALOG type="string"/>
    				<JNDI type="string"/>
    				<QUERY type="string"/> 
    				<CUBE type="string"/>
    				<ROLE type="string"/>
    		      </action-inputs>
    		      <action-resources/>
    		      <action-outputs> 
    		        <query-results type="result-set" mapping="query_result"/> 
    		      </action-outputs>
    		      <component-definition> 
    		        <location><![CDATA[mondrian]]></location>  
    		        <query>{QUERY}</query>  
    		        <jndi>{JNDI}</jndi> 
    				<cube>{CUBE}</cube>
    				<role>{ROLE}</role>
    				<catalog>{CATALOG}</catalog>
    		      </component-definition> 
    		    </action-definition>
    	</actions> 
    	
    	<actions> 
    		<condition><![CDATA[QUERY_TYPE == "sql"]]></condition>
    			<action-definition> 
    			  <component-name>SQLLookupRule</component-name>
    			  <action-type>Relational</action-type>
    			  <action-inputs>
    				<QUERY type ="string"/>
    				<JNDI type="string"/>  
    			  </action-inputs>
    			  <action-outputs> 
    				<query-results type="result-set" mapping="query_result"/>  
    			  </action-outputs>
    			  <component-definition> 
    				 <jndi>{JNDI}</jndi>  
    				 <live><![CDATA[false]]></live>  
    				 <query>{QUERY}</query> 
    			  </component-definition> 
    			</action-definition>
    	</actions> 
    	
    	<action-definition> 
          <component-name>JavascriptRule</component-name>
          <action-type>JavaScript</action-type>
          <action-inputs> 
            <query_result type="result-set"/> 
    		<QUERY_TYPE type="string"/>
          </action-inputs>
          <action-outputs> 
            <results type="string"/> 
          </action-outputs>
          <component-definition> 
            <script><![CDATA[// MDX to Relation result set, needed for the 
    
    		var obj = new Packages.org.json.JSONStringer();	
    		var metadata = new Packages.org.json.JSONArray();
    		var values = new Packages.org.json.JSONArray();
    		
    		if (query_result != null)
    		{
    		
    			var rsmd = query_result.getMetaData() ;
    			var colHeaders = rsmd.getColumnHeaders() ;
    			var rowHeaders = rsmd.getRowHeaders() ;
    			var colCount = rsmd.getColumnCount() ;
    			var rowCount = query_result.getRowCount() ;
    			
    			for(j = 0; j < colCount; j++){
    				metadata.put(colHeaders[0][j].toString() + '');
    			}
    			
    			if(rowCount> 0)
    			{		
    				for (i=0; i<rowCount; i++)
    				{
    					var value = new Packages.org.json.JSONArray();
    					if(QUERY_TYPE == "mdx")
    						value.put(rowHeaders[i][0]);
    					
    					for(j=0; j< colCount; j++)
    					{
    					    var v = query_result.getValueAt(i,j)+"";
    						value.put(v.replace(/Infinity/g,'0'));
    					}
    					
    					values.put(value);
    				}
    				
    			}
    		}
    		
    		
    		
    		obj.object();
    		obj.key("metadata").value(metadata);
    		obj.key("values").value(values);
    		obj.endObject();
    		
    		var results = new java.lang.String(obj.toString().getBytes("utf8"));
    		results;
    		]]></script> 
          </component-definition> 
        </action-definition>
      
       
     
      </actions> 
    </action-sequence>
    Is there something wrong about jtable.xcation ? otherwise, why the sample code (mdx) can't work ? or something setting i miss ?

    PS: can i get detail error about cdf action failed ? There is only failed info in tomcat. Can i get error trace tree ?

    sorry for my long question

  11. #11
    Join Date
    Aug 2009
    Posts
    122

    Default

    Can anyone give me the pic of result of CDF sample in tablecomponent(cdf-samples\30-documentation\30-component_reference\10-core\64-TableComponent) ?

    i want to see what it is

  12. #12
    pstoellberger Guest

    Default

    i just extracted a fresh 3.5 biserver and the table component works just fine

    i attached a screenshot
    Attached Images Attached Images  

  13. #13
    Join Date
    Aug 2009
    Posts
    122

    Default

    i will download pentaho biserver3.5 stable and try table component again.

    what i want to get is the detail error information of table component action in Tomcat.what i get now is just " 17:54:28,390 ERROR [SolutionEngine] dd4ae4a8-d1cc-11de-994b-ad26cfef6169:SOLUTION-ENGINE:jtable.xaction: SolutionEngine.ERROR_0007 - Action sequence failed "

  14. #14
    Join Date
    Dec 2005
    Posts
    531

    Default

    Nice of you to want it. ;-) Well, Pentaho does not provide it at the moment.

    You'll have to wait for 3.6 for more detailed and controlled error information: http://wiki.pentaho.com/display/Serv...rror+Reporting

  15. #15
    Join Date
    Aug 2009
    Posts
    122

    Default

    Quote Originally Posted by pstoellberger View Post
    i just extracted a fresh 3.5 biserver and the table component works just fine

    i attached a screenshot
    Unfortunately, i download 3.5 stable and have a try , but failed.

    can pstoellberger give me some info?
    1. after you extracted 3.5 stable , do you modify any files or setting ?
    2. what version of JDK you have ?
    3. what OS you have ?
    4. what browser do you use when you open table component sample ?

    thanks.

  16. #16
    Join Date
    Nov 2009
    Posts
    28

    Default

    can pstoellberger give me some info?
    1. after you extracted 3.5 stable , do you modify any files or setting ?
    2. what version of JDK you have ?
    3. what OS you have ?
    4. what browser do you use when you open table component sample ?
    works fine for me with both mdx and sql
    1. Nothing else than setting up mysql as repository
    2. java version "1.6.0_17"
    3. Vista
    5. FF and IE

    Might be a long shot but I noticed that there are some strange symbols at the begining of both the jtable-files. It worked for me anyway but PDS complained.

    /Andreas

  17. #17
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    That sample uses this query:

    query: function(){

    var query = "select NON EMPTY {[Measures].[Sales]} ON COLUMNS,"+
    " NON EMPTY TopCount([Customers].[All Customers].Children, 10.0, [Measures].[Sales]) " +
    " ON ROWS from [SteelWheelsSales]"
    return query;
    }


    Are you use that steelwheelssales cube works for you?
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  18. #18
    Join Date
    Aug 2009
    Posts
    122

    Default

    Quote Originally Posted by pmalves View Post
    That sample uses this query:

    query: function(){

    var query = "select NON EMPTY {[Measures].[Sales]} ON COLUMNS,"+
    " NON EMPTY TopCount([Customers].[All Customers].Children, 10.0, [Measures].[Sales]) " +
    " ON ROWS from [SteelWheelsSales]"
    return query;
    }


    Are you use that steelwheelssales cube works for you?
    i just open table component page in cdf and there is no table , i click "code" button and get there below
    Code:
    var MetaLayerHome2 = {
    topTenCustomerDefinition: {
    	colHeaders: ["Customers","Sales"],
    	colTypes: ['string','numeric'],
    	colFormats: [null,'%.0f'],
    	queryType: 'mdx',
    	displayLength: 5,
    	
    	catalog: 'solution:steel-wheels/analysis/steelwheels.mondrian.xml',
    	jndi: "SampleData",
    	query: function(){
    
    		var query = "select NON EMPTY {[Measures].[Sales]} ON COLUMNS,"+
    		" NON EMPTY TopCount([Customers].[All Customers].Children, 10.0, [Measures].[Sales]) " +
    		" ON ROWS from [SteelWheelsSales]"
    		return query;
    	}
    }
    };
    
    var topTenCustomers = 
    {
    	name: "topTenCustomers",
    	type: "tableComponent",
    	chartDefinition: MetaLayerHome2.topTenCustomerDefinition,
    	htmlObject: "sampleObject",
    	executeAtStart: true
    };
    Dashboards.init([topTenCustomers]);
    i didn't change code or data source . It should be good.

  19. #19
    Join Date
    Aug 2009
    Posts
    122

    Default

    Quote Originally Posted by AndreasT View Post
    works fine for me with both mdx and sql
    1. Nothing else than setting up mysql as repository
    2. java version "1.6.0_17"
    3. Vista
    5. FF and IE

    Might be a long shot but I noticed that there are some strange symbols at the begining of both the jtable-files. It worked for me anyway but PDS complained.

    /Andreas
    thanks for the information.

  20. #20
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    I'm talking about puting that query in a new analysis pivot table for the steel wheels cube
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  21. #21
    Join Date
    Aug 2009
    Posts
    122

    Default

    Quote Originally Posted by pmalves View Post
    I'm talking about puting that query in a new analysis pivot table for the steel wheels cube
    i have tested the query on jpivot table and it ran successfully. i notice that the query in Jfreechart component is as the same as table component. JFreechart is good but table component is bad.

    ps: i tried every component in cdf document and found only table component and query component couldn't work. Did anybody have this experience?

  22. #22

    Default

    Hi,

    i'm, having the same problem. Seems like the jtable.xaction is invalid. When i try to open the jtable.xaction with eclipse it says:

    "The following XML nodes were not specified
    You must fix the XML before continuing"

    But i'm new to the dashboard thats why i have no clue where to start

    Philippe

  23. #23

    Default

    Ok, i found the problem. The jtable.xaction file didn't start with the <?xml... Tag. There were two chars infront of the xml-Tag (Those two chars weren't visable with notepad++, just eclipse). I deleted them and everything woks fine.

    I attached the jtable.xaction and a picture of those two chars
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by Jepse; 01-15-2010 at 09:28 AM.

  24. #24
    Join Date
    Mar 2009
    Posts
    3

    Default

    I'm having similar problems and no luck. I too have renamed jtable.xaction.sql to jtable.xaction and tried to run the code below.

    It produces ... nothing.

    Does anybody see anything obvious? This is killing me!

    Code:
    <h1>Test Dashboard Page</h1>
    <div id="sample">
        <div id="sampleObject"></div>
        <div id="sampleObjectResult"></div>
       </div>
    <script language="javascript" type="text/javascript">
        // Get the solution and path of this current location
        var solution = Dashboards.getQueryParameter("solution");
        var path = Dashboards.getQueryParameter("path");
        // Dashboard parameters
        Dashboards.globalcontext = false;
        //Parameter definitions go here
        //Component definitions
        var components = [];
    var MetaLayerHome2 = {
    topTenCustomerDefinition: {
     colHeaders: ["Date"],
     colTypes: ['numeric'],
     colFormats: ['%.0f'],
     queryType: 'sql',
     displayLength: 5,
     
     jndi: "SampleData",
     query: function(){
      var query = "select 1;"
      return query;
     }
    }
    };
    components[components.length] = 
    {
     name: "topTenCustomers",
     type: "tableComponent",
     chartDefinition: MetaLayerHome2.topTenCustomerDefinition,
     htmlObject: "sampleObject",
     executeAtStart: true
    };
    Dashboards.init(components);
    </script>

  25. #25

    Default

    Did you check the jtable.xaction for the weired chars at the beginning?

    You can't see them in all editors (i.e. i didn't even see them in notepad++).

  26. #26
    Join Date
    Mar 2009
    Posts
    3

    Default It is the weird characters

    Quote Originally Posted by Jepse View Post
    Did you check the jtable.xaction for the weired chars at the beginning?

    You can't see them in all editors (i.e. i didn't even see them in notepad++).
    Yep - you're right. I'm using UNIX and was looking at the file via FTP and opening it on NoteTab on my PC. They don't show up. When I logged in and used vi, their they were. I removed them and now it works like it a champ.

    Now my next challenge is I really want to use queryComponent and I haven't found anything that really describes the format of "result." But I can mess around with that over the weekend.

    Thanks for the tip.

  27. #27
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    The result is only an array of arrays. You access values through query.result[3][2], for example
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  28. #28
    Join Date
    Jul 2007
    Posts
    1,013

    Default

    Quote Originally Posted by Jepse View Post
    Ok, i found the problem. The jtable.xaction file didn't start with the <?xml... Tag. There were two chars infront of the xml-Tag (Those two chars weren't visable with notepad++, just eclipse). I deleted them and everything woks fine.

    I attached the jtable.xaction and a picture of those two chars
    Just for the record, problem solved for me by using Jepse's jtable.xaction on BI Server 3.5.2.

    Cheers, mate!
    (en) Path to Pentaho knowledge: (1:Search the Wiki > 2:Search the Forums > 3:Ask) or (1:Get a Subscription)
    (es) El camino al conocimiento en Pentaho: (1:Buscar en la Wiki > 2:Buscar en los Foros > 3:Preguntar) o (1:Comprar una Subscripción)

Tags for this Thread

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.