Unable to select "select query" in Report Designer in Pentaho - pentaho

I used ktr transformation as a data source to a report. When I tried to select query in the prpt, I couldn't do that.normally when we select the "Select query" all columns will be display from the ktr. but it will not display.I have attached the image to understand the Question

Related

Pentaho Report Designer - there is no field appears

I am using Pentaho Report Designer 7. The database connection is OK.
Now, I wonder why on the Data Tab on the right side. There is no fields from the query that I can click and drag it to the report?
It only show me the available Query names but NOT the fields that I can click and drag to the report.
If your query is working fine(if you have checked at database level),in that case two possibility.
Case 1: In old PRD version you have to specify limit clause then only fields will appear which is quit a strange thing but is the solution.
Example : select * from tablename limit 100000;
Case 2 : if issue is not getting resolved by doing case 1 then, you have to right click on the queryname and click on select query.
You can do a right click on the query and select that query. It should show you output fields of that query.

How to create Dynamic SQL in Pentaho Report Designer?

I have a requirement where columns of the SQL will be generated based some selection, these columns are coming from Metric dimension but there is no metric ID present in Fact table.
SQL would be something like below:
SELECT Location_Nbr, Day_Nbr, (Column_List- Coming from some other query)
FROM (Table_Name - Coming from same query which is providing Columns to be selected)
I tried creating the SQL query but I get an error saying there is not a business relation between these tables. Is there any other way to achieve this?
To use Dynamic SQL in Pentaho Report Designer, you need to use
custom jdbc connection in data source
then in master report query name, select message format
type your dynamic query in message Pattern
select
$(dynamic_data) as 'data' from table_name;

vb.net "the schema returned by query is differ from base query" in winforms

I am working on vb.net windows application. When I Tried to add query by "Query Builder" after selecting data adapter and data set from datagrid view I receive this error:
the schema returned by query is differ from base query
MY QUERY IS LIKE THIS:
SELECT
CompanyMaster_tbl.CompanyName,
DepartmentMaster_tbl.dtName,
DepartmentMaster_tbl.dtPhone,
DepartmentMaster_tbl.dtEmail
FROM
CompanyMaster_tbl
INNER JOIN DepartmentMaster_tbl ON CompanyMaster_tbl.Cid = DepartmentMaster_tbl.cId
First I added the company name to datagrid view choosing the data source and particular table name but while clicking Ok button am getting the error.

(VB / ACCESS / CR) Filter VB Crystal Report based on Access Form

Before I get to the question, here is an overview of what is going on.
Access
A form that has a ComboBox that selects a JobId
Crystal Reports
A Report that calls info from several tables, all based on the JobID
VB
A Form (Using the Crystal Reports Plug-In) that shows the Report outside of the Crystal Reports Designer app.
My Problem
I need the report displayed in VB to be filtered to the job chosen in the Access ComboBox.
Update
I have my Database linked to VS2012, and that works fine without any issues. I can pull info from a Table easily. What I need to do is link the ComboBox from an Access Form to VS2012 to filter the Report.
I hope that makes my question clearer.
Update 2
I was able to figure out how to create a SELECT Query based on the value of my ComboBox inside of Access, so I should be able to use that to access the Value I am looking for, however I still need to know how to use that value as a filter for CR...
One possible solution would be to create a saved Select Query in Access that replicates the query in CR, and name that query [JobReport_base]. Then, create another saved Select Query in Access and name it [JobReport_current]. Add some code to your Access form that updates the .SQL property of the [JobReport_current] query to return just the records for the selected [JobId], something like
Dim qdf As DAO.QueryDef
Set qdf = CurrentDb.QueryDefs("JobReport_current")
qdf.SQL = "SELECT * FROM JobReport_base WHERE JobId = " & cbxJobId
Set qdf = Nothing
Then update your Crystal Report to pull the data from the [JobReport_current] query instead of the individual tables.
Multiple solutions. In your case, the simplest ones are the following:
There is this 'sqlQueryString' property of the report that you could update by directly updating the string.
You could also add a parameter (let's call it 'PAR_yourCombobox') to the report. When accessing the report in your VB code, just set the value of your parameter to the value on the screen. as far as I remember, it should look like:
yourReport.parameterFields(i).addCurrentValue yourForm.controls("yourCombobox").value

Pentaho kettle : how to execute "insert into ... select from" with the sql script step?

I am discovering Pentaho DI and i am stuck with this problem :
I want to insert data from a csv file to a custom DB, which does not support the "insert table" step. So i would like to use the sql script step, with one request :
INSERT INTO myTable
SELECT * FROM myInput
And my transformation would like this :
I don't know how to get all my data from the csv to be injected in the "myInput" field.
Could someone help me ?
Thanks a lot :)
When you first edit the SQL Script step, click 'Get fields' button. This is going to load the parameters(fields from your csv) into box on the bottom left corner. Delete the parameters(fields) you don't want to insert.
In your sql script write your query something like this where the question marks are your parameters in order.
insert into my_table (field1,field2,field3...) values ('?','?','?'...);
Mark the checkboxes execute for each row and execute as a single statement. That's really about it. Let me know if you have any more questions and if you provide sample data I'll make you a sample ktr file to look at.
I think you get the wrong way. You should get a cvs file input step and a table output step.
As rwilliams said, In cvs file input step Get fields; the more important, in table output there is a Database Fields tab. Enter field mapping is right choise.The guess function is amazing.
And more, system can generate target table create sql statement when target table not exists in target connection Db server.
Use the following code
with cte as
(
SELECT * FROM myInput
)
select *
into myTable
from cte;