a number is required in the selection criteria when using a parameter - crystal-reports

I am new to CR, and I think this is a complicated question. When a user runs the report, I want the user to input either nothing - which will get everything, or to input the values for that field - to get those specific values. Let me know if I am approaching this right.
I am trying to use a formula in the record selection formula editor. This formula references a parameter. I am trying to use WrkOrder.Center field - which is a number - in my selection criteria.
I am getting the error "a number is required here" in the record selection formula editor. I need to do a totext or cstr ? It just seems to still be incorrect.
if the center is blank then get all centers, else get the selected center input in the parameters by the users running the report.
if {?Center}="" then true else {?Center}=cstr({WRKORDER.CENTERNBR})
if {?Center} = "" then true else {?Center}={WRKORDER.CENTERNBR}
parameters to get what is either input or get all centers

First thing to check is the data type of your parameter and the data type of database field to ensure they match.
If you edit your parameter the first three controls on the form at the top are Name, Type, and List of Values. The Drop Down Box for Type will identify the data type of your parameter.
To identify the data type of your database field, find the field in the Field Explorer and if you don't already see a data type listed next to the column names for each table, right click on any field name and click "Show Field Type" and this will toggle the display of the field data type on and/or off. Its usually off by default I believe.
In order to use a comparison with the = operator, these two objects must have matching data types. You aren't able to change the data type of a database field, but you can change the data type of your parameter to match it.
Hopefully this will fix your error. The most common cause of the error message you are receiving is when one field is a Number type and the other is a Text type. Functions that convert the data will work in formula fields, but usually will continue to throw errors when used in selection expert formulas.

Related

ag-grid Force "no data" message when setFilter value does not exist

I have a column with multiple possible values. As an example, there might be an "Is Busy" column, with values "No" and "Yes". If there are no rows with "No" as the value, I need to know how to show the "no data" message - this does not seem to work by default. I see suggestions to hard-code the value list, regardless of the values in the dataset. However, I have requirements for those values to be dynamic from the database. For example, we might add "Maybe" to that list later and the grid must reflect it, without needing to modify code.
I'm using the following, where 'No' does not exist in the dataset.
agGridOptions.api.getFilterInstance(col).setModel({ values: ['No'] });
This does not filter the grid, but rather leaves all existing rows.

Filemaker auto enter calculation - update with relationship

According to the Filemaker documentation,
If you select Calculated value, you can edit the field value in Browse mode (if Prohibit modification of value isn't selected). The value is calculated when you create a record, or when one of the referenced fields changes and the destination field is empty. (However, if you select Do not evaluate if all referenced fields are empty in the Specify Calculation dialog box, the value isn't calculated when you create a record and all fields referenced by the calculation are empty. Instead, the value is calculated when one of the referenced fields contains a value.
An auto enter calculation will be calculated if the reference field value used in the calculation is changed. I'm using a field in the relationship and from that same relationship I'm getting the value from a related table.
For example, relationship between table A to B is based on a field F1. In my calculation, I've
B::__text
Here, in this calculation I'm not using the field F1 but it used in the relationship between A->B. Whenever I'm changing the value of F1, Filemaker is updating the value of the auto enter calculation.
Is this normal? I don't find any docs related to this in the documentation.
Yes, it is expected behavior as long as the "Do not replace existing value of field" is not selected.

Tableau parameter filter with multiple values?

In Tableau 9.2, I currently have a parameter set up which contains multiple string values and an additional "All" value. I also have a calculated field which only contains the Str([some_field]) function. I have then dragged this calculated field into the "filters" pane and from there enabled "use all" and put the following formula under the "condition" tab:
// If All is selected, then do not filter
[my_filter_parameter] = 'All' OR
// Otherwise, filter on the current parameter
[my_filter_parameter] = [my_calculated_Field]
After creating the calculated field for multiple sheets in my dashboard (which use different data sources all contain the common some_field), then I can change the parameter's value and it will filter all of the sheets at once.
My issue is that I need this to take on multiple values at once via a check-box. I understand that a parameter can only take on one value at a time, so I am wondering how I can do this without making the same filter for each individual sheet in the dashboard. Perhaps this can be done with a calculated field?
EDIT: I have tried the technique here to make a global filter via a control view. This allows me to use Ctrl+Clicking to select multiple values in some_field at once, however I still do not have a dropdown box. Alternatively, if anyone knows how to use this method with a dropdown box, then that would be another solution.
If I am understanding your situation correctly, I have accomplished this using the following:
Create a calculated field and put the following code:
if [parameters].parametername = 'All' then true
elseif [parameters].parametername = FILTEREDCOLUMN then true
else false
end
Add that calculated field to the filters pane and select "True" - in other words, filter out any records where the calculated field is False. If the parameter you selected is "All" then all records will be True. Otherwise, it will only be True if the parameter matches the FILTEREDCOLUMN. I hope that helps.
Parameter can pass only one value at a time ,i.e. Parameter Control will have Single Drop Down List.

GWT + Editor: Avoid removing violation messages and wrong input

We implement in our GWT/GXT project displays that contain in most cases a filter form and a grid to show the filtered data. Displays are implemented with UiBinder and the "Gwt Editor Framework".
The user wants to have validations on the filter form. To do the validation we use JSR303 bean validation. The validation must apply on each change of a field in a filter form. The user wants also to have a kind of automatic fill a field based on the input in a second field (lets say a number range from and to). That works all perfect - but...
We struggle in a particular situation:
The user starts to type in some data in the filter form.
He puts a wrong value in a field that has to be parsed into a date (for example).
He continues typing into following fields which then cause an automatic prefill of a second field.
The result is currently, that the wrong value he typed into the date field is removed and the violation message as well.
Our current implementation will do a flush() to get the values the user typed in already. After that we fill a attribute in the model (based on the input) and do an edit(model). If there are some violation messages because of a wrong input in a different field in that filter form, the value is removed. That happens on field that need a parse (date, time, number).
The question is now:
Is there a way to keep the wrong value and the violation message as well?
Thank you for any replay!

SSRS Multiple Dataset Errors

I have a simple SSRS report that displays data from one table. What I want to do is have a distinct list from that table displayed in a drop down list for the user to select. If I only use one dataset I can get it to display, but it displays values from the column multiple times.
Example
Bob
Bob
Bob
Cathy
Cathy
If I create a second dataset that will list distinct values I get the following error message:
An Error occurred during local report processing. The definition of the report is invalid. The Variable expression for the report 'body' refers directly to the field without specifying a dataset aggregate. When the report contains multiple datasets, field references outside of a data region must be contained within aggregate functions which specify a dataset scope.
I"m trying to follow the example I found here:
http://msdn.microsoft.com/en-us/library/aa337400.aspx
The second dataset is only for the parameter list. I don't understand why it's causing problems with the actual report.
It's impossible to tell exactly where without the report definition, but there is an item on the report that is referencing a field or Dataset, and was implicitly using the only Dataset present in the report, but now doesn't know which Dataset to use once more than one is added to the report.
For example, when you create a table you can set a Dataset associated with it. If this is not set and there is only one Dataset, it doesn't matter as it will take the only one available. Once you add a new Dataset, the table doesn't know which one to use and you'll get the error you're seeing.
Another way to get the error is specifying a field in an expression, e.g. in a TextBox in the report somewhere without specifying the scope; just set the scope to a particular Dataset e.g. if you have:
=Count(Fields!name.Value)
change this to:
=Count(Fields!name.Value, "DatasetToUse")
If you've only got one Dataset the first expression will run fine by using the only one available, but once you add another it won't know which to use and it will error.
in the query (SQL) you should add DISTINCT clause at the beginning, that way, you will get only one record per value. Check out http://www.w3schools.com/sql/sql_distinct.asp
Double click the Dataset which contains that field.
Go to fields on the left and delete that field.
Add new field by clicking Add -> Query Field.
Just type in the name of the new field under field name and field source.
It happens when you have added a field by selecting "Calculated Field" instead of "Query Field" from Dataset Fields list tab.
Cheers,
Ahmed Latif