I've got a chart that uses a secondary dataset. It allows for the use of the fields and parameters of the second dataset, however I'm not able to use the parameters set in the main report dataset. Does anyone have any clue how to access the values of the parameters?
For example
I have the following parameters in the main dataset:
valueOne
valueTwo
And a secondary data set:
fieldOne, fieldTwo
From the chart that is set to use the second dataset, how would I request parameter: "valueOne"?
Add a parameter to your subDataset that has the exact same name as the parameter in the main dataset. Leave the default value expression blank and do not prompt for a value. When you reference the parameter in the subdataset, the value from the main dataset will be returned.
So in your case monksy, you should add an empty parameter named "valueOne" to your second dataset.
I've never seen this behaviour documented anywhere; I found it out by accident when working on a report.
Related
I have a dataset defined in ADF V2 of type Azure Storage. In the Connection we need to specify container and in my case the container is going to be the same as the name of the dataset itself. Is there any way I can access name of the dataset dynamically? Because I would then like to clone this dataset and create many datasets with different names and in all the cases container name is going to be the same as their dataset names. I have tried accessing dataset name using #dataset().name and #dataset() also but it doesn't work.
Dhiraj, based on the System variables in ADF and Expressions and functions , there is no such expression like #dataset.name() or #dataset().
However,you could try to use parameters with dataset to implement your needs.When you create your datasets,you know the name definitely. Please add that name as a default value parameter of dataset like this:
Then you could refer to the value by using #dataset().selfName.(You could view this link:https://learn.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions#a-dataset-with-a-parameter)
My solution is also a hardcoding way because dataset name can't be referred in dataset inside so far as i found.
First off this is my first attempt at a multi select. I've done a lot of searching but I can't find the answer that works for me.
I have a postgresql query which has bg.revision_key in (_revision_key) which holds the parameter. A side note, we've named all our parameters in the queries with the underscore and they all work, they are single select in SSRS.
In my SSRS report I have a parameter called Revision Key Segment which is the multi select parameter. I've ticked Allow multi value and in Available Values I have value field pointing to revision_key in the dataset.
In my dataset parameter options I have Parameter Value [#revision_key]
In my shared dataset I also have my parameter set to Allow multi value.
For some reason I can't seem to get the multi select to work so I must be missing something somewhere but I've ran out of ideas.
Unlike with SQL Server, when you connect to a database using an ODBC connection, the parameter support is different. You cannot use named parameters and instead have to use the ? syntax.
In order to accommodate multiple values you can concatenate them into a single string and use a like statement to search them. However, this is inefficient. Another approach is to use a function to split the values into an in-line table.
In PostgreSQL you can use an expression like this:
inner join (select CAST(regexp_split_to_table(?, ',') AS int) as filter) as my on my.filter = key_column
Then in the dataset properties, under the parameters tab, use an expression like this to concatenate the values:
=Join(Parameters!Keys.Value, ",")
In other words, the report is concatenating the values into a comma-separated list. The database is splitting them into a table of integers then inner joining on the values.
I am unable to dynamically change the column header values during run time while creating a jasper report. Why do I keep getting string to boolean cast exception everytime I assign the value to table element's column header??
I have a column header that is a part of the table element. And this table and its dataset are not a part of the main data set. I want to the column header to change dynamically based on values in the main dataset. The main dataset and sub data set return different resultsets
The steps I followed were:
create a variable called v1_enabed (string) and v1_display(string) in the main dataset. I also assigned the required fields(from the main data set) to these variables
I created a parameter p1(string) in subdataset
I use the subdataset fields for table creation. I used the table element.
I go the table and map the parameter p1(string) to the table. And I assign the expression ($V{v1_enabled} == Character.toString('1')) ? $V{v1_display} : $V{v1_display} to it
Until here whenever I run the report, I do not get any error.
Now, I go the table. Pick up the 5th column and assign this in the print when expression section -- $P(p1)
Now, comes the error: java.lang.String cannot be cast to java.lang.Boolean
How do I solve this?
I need to pass value from Tpostgressql to context variable,so that context variable value can be used in other components
The query used in tpostgres is :
select max(started_on) started_on from etl_log
I have created a context variable started_on_date (date datatype)
In the Tjavarow :-
context.started_on_date =row1.started_on
But it throws
error created_on variable cannot be resolved or is not a field
Have you defined the schema in the tPostrgesqlInput component ? If not, that needs to be done first. Afterward, synchronize the schema of the tJavaRow. You can use the Java row's code generation feature, if appropriate .
Question / if you want to do row-based processing in the same job, there is likely no need to put the started date in the context.
If you want to do non-row based processing, you can used the tJavaRow component to put the value in the globalMap. This assumes there is only one row of data or that you only care about the last row. Then, you can use that value in other components which are not processing a flow (rows). tJava is an example of that.
I have a dataset referencing a proc. That proc takes in a #UserName
In my parameters of my dataset, I have specified a new param called #UserName and for its default value the expression =User!UserID but I still get this error when the report tires to render:
The default value expression for the query parameter #UserName contains an error [BC30654] 'Return' statement in a function, Get, or Operator must return a value
The only thing I can think of is that instead of modifying the existing datasource I had defined in the report, I removed and added a new datasource. I hope that doesn't matter as long as there is a valid data source for the report to go on that has those fields...I just switched this report to reference a copy of our current database for testing purposes.
Sounds like the report parameter is not being passed to the stored procedure.
In the Dataset Properties, click on the Parameters tab and check that the stored proc parameter #Username is correctly mapped to the Report parameter #Username.