简体   繁体   English

Pentaho Report Designer mySQl查询选择

[英]Pentaho Report Designer mySQl query select

Using Pentaho Report Designer, I can set up a data source to connect to my MySQL database which is hosted locally using phpmyadmin. 使用Pentaho Report Designer,我可以设置数据源以连接到使用phpmyadmin在本地托管的MySQL数据库。

Testing the connection works, pulling in variables for setting up queries works, running previews of said queries displays the correct output, but I can not add any db fields into the report. 测试连接工作,引入变量以设置查询工作,运行所述查询的预览显示正确的输出,但是我无法在报告中添加任何数据库字段。 Dragging/Dropping from the data pane simply won't work. 从数据窗格中进行拖放操作根本行不通。

Anyone any idea what the problem is? 任何人都知道问题是什么吗?

Just an update for anyone in the future who may have the same problem. 只是对将来可能遇到相同问题的任何人的更新。 I solved it by adding a "Limit" in the query editor. 我通过在查询编辑器中添加“限制”来解决该问题。

Example: 例:

SELECT batchjobs . 选择batchjobs name , batchjob_params . namebatchjob_params format , batchjob_params . formatbatchjob_params notes FROM batchjobs , batchjob_params LIMIT 1 来自batchjobs notesbatchjob_params LIMIT 1

Without the "LIMIT 1", the query contents would not appear for selection in the report designer! 没有“ LIMIT 1”,查询内容将不会出现在报表设计器中供选择!

ideally there are two possible ways of selecting/Dragging the field in the report designer. 理想情况下,有两种可能的方式可以选择/拖动报表设计器中的字段。

Step 1 : Select the Database Query and right click on it to select "SELECT QUERY" option. 步骤1:选择数据库查询,然后右键单击它以选择“选择查询”选项。 This brings down a list of columns. 这将列出列的列表。 This makes the query fields draggable on the report. 这使得查询字段在报表上可拖动。

Step 2 : Try to use the left panel. 步骤2:尝试使用左侧面板。 There you will find "text-field" or "number-field". 在这里,您会找到“文本字段”或“数字字段”。 Drag these labels on the report. 将这些标签拖到报表上。 Once you have done it, click on the field and you will be given an option to select the fields. 完成后,单击字段,您将获得一个选择字段的选项。 You can select any of the fields as per the requirement. 您可以根据需要选择任何字段。 If it is not available, then you might have to enable the STEP I and then try STEP II. 如果不可用,则可能必须启用STEP I,然后尝试STEP II。

Try any of the steps above. 请尝试上述任何步骤。 Hoping this will solve your problem :) 希望这可以解决您的问题:)

I had faced the similar issue, what i did was, put quotes around the parameters that were passed in the query in the kettle transformation from your report. 我曾经遇到过类似的问题,我所做的就是在报表的水壶转换中的查询中传递的参数周围加上引号。 Strange but i does solved the issue. 奇怪,但我确实解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM