Calc : cell format converts empty date to '30/12/1899' - date

In my LibreOffice Calc spreadsheet, I have a block with a line for each data array (with block:tbs-row)
one of the values is a date, which is sometimes empty
With [blk1.DT_FIN_ABONNEMENT;noerr;frm=dd/mm/yyyy;ope=tbs:string], I have a text value when not empty, and an empty cell when the value is empty.
With [blk1.DT_FIN_ABONNEMENT;noerr;frm=dd/mm/yyyy;ope=tbs:date], I have a date value when not empty, and '30/12/1899' when the value is empty.
I would like to have an empty cell when there is no value.
I tried frm='dd/mm/yyyy|||', frm='dd/mm/yyyy||| ', frm='dd/mm/yyyy|||NULL', frm='dd/mm/yyyy|||#N/A'
and the result is the same
and
[blk1.DT_FIN_ABONNEMENT;noerr;ope=tbs:string;mok:magnet=tbs:p]
[blk1.DT_FIN_ABONNEMENT;noerr;frm=dd/mm/yyyy;ope=tbs:date;magnet=tbs:p]
breaks the template
Can anyone give me a clue ?
Thanks

LibreOffice (and OpenOffice) has no NULL value for dates. AS soon as a cell is typed as date, then it tries to convert it to a date. If a date value is empty then it applies the zero date value, which is set for the Workbook at the option window : Tools/Options/LivreOffice Calc/Calculation.
As you should see, the default zero date value is usually set to 1899-12-30.
Unfortunately, OpenTBS cannot deals yet with this LibreOffice behavior. (OpenTBS current version is 1.10.0).
A cannot see any simple way to make a workaround.
Since you use ope=tbs:date, then the cell is typed as date, and thus LibreOffice assumes it is zero date value when the inner value is empty. By the way, when you use ope=tbs:date, then your parameter frm is overwritten by OpenTBS.
Since you don't use ope=tbs:something, then the cell is typed as string and you cannot use the cell as a date...

Related

How to change date range which was entered as a parameter

for my evaluation I have set a date range as an input parameter. This chosen date range should be displayed in a textbox (by using a formula field for example).
What I reached so far is, that I choose a date range and CR goes through the corresponding data.
But I can only see the first and last date on which something happenend.
Example:
Entered Date range: 01.01.2019 - 16.10.2019
First/last date with a created notification: 03.01.2019 - 14.10.2019
Displayed date range: 03.01.2019 - 14.10.2019
This could cause confusion because it looks like we evaluated a shorter date period.
Is there a method to just show the entered parameters?
Thanks in advance!
Instead of placing the parameters in a formula and displaying them as this may be causing your issue. Do the following;
Get a textbox and place it in the report header. On the right in your field explorer, expand the Parameter Fields and drag the DateFrom and DateTo in the textbox. Something like this;
Doing so will display the entered range in the parameter and not the range values actually exist for.

How to replace crosstab cell's value with a string

I have column fact, it can carry some difference values:
- Positive values - real values, need to be outputted as is
- 0 is null, output as is
- -1 - special value. Need to ouput "VAC" string in cell.
- -2 - special value. Need to output "SICK" string in cell.
I tried to do it with editing dimension, i replace it with:
case
when [BaseEmp].[FACT_VALUE] = -1 then 'VAC'
when [BaseEmp].[FACT_VALUE] = -2 then 'SICK'
else to_char([BaseEmp].[FACT_VALUE])
end
But now I see error: ORA-01722 invalid number (i think, because strings cannot be aggregated). In column properties I select "min" as aggregate function.
How to replace my special values with strings?
You don't need to change value to VAC, SICK etc.
You need to change DISPLAYED value.
Unlock the padlock in RS.
Select text in your cell
Set text source to "Report Expression"
Write expression like
CASE
WHEN cellValue() = -1 THEN 'VAC'
WHEN cellValue() = -2 THEN 'SICK'
WHEN cellValue() = 0 THEN ''
ELSE cellValue()
END
I tried thinking of a work around regarding your problem. I'm not really sure what you crosstab looks like but considering your parameters above, try creating a data item which holds your case condition for your fact.
Ex.
case
when [BaseEmp].[FACT_VALUE] = -1 then 'VAC' <--- this will produce Any Error Characters
when [BaseEmp].[FACT_VALUE] = -2 then to_char([BaseEmp].[FACT_VALUE]/0) <--- this will produce Missing Value Characters
else to_char([BaseEmp].[FACT_VALUE]) <---- as is
end
Then set the data item's Data Format to number and set the values for the properties as follows:
Kindly give this a try and hopefully it can somehow resolve you problem. Cheers!
Nikita Kuhta checkout Alexey's Baturin's answer. I think it's the appropriate approach. Just one thing if you unlock and select the text in the cell, all of the cell values will be selected and affected by the report expression. You might have several columns or other fact items in the crosstab. If that's the case, what you can do is
Unlock the Report.
Select the crosstab cell/intersection you want to change.
Set the Define Content to Yes.
Drag a Layout Calculation in the crosstab cell/intersection, then insert your case statement.
Thanks to a friend who told be about the define contents. :D

Updating the selected dropbox item in a GUI

Currently I have a GUI in which once a 'Submit' button is pressed the drop menu which is left blank is then populated by a calculated value determined by the three other values.
I have successfully figured out how to grab all of the values using this logic:
temp=get(handles.FSTOPpopmenu,{'String','Value'});
fstop=temp{1}{temp{2}};
if (strcmp(fstop,'Select'))
fstop = 0;
else
fstop = str2num(fstop);
end
I just have two questions about this that I can not seem to find an answer for.
How would I go about updating the 'empty' drop menu to the calculated variable (the calculated variable will already be one of the possible values in the predetermined list)?
How would I go about presenting an error, say if I have an if statement checking that the amount of zeros in the array? Would a pop up box be sufficient?
Cheers.
As for your first question matlab's set command is what you're looking for. The documentation is here. You would probably need:
MyValueIndex = find(DropDownValues==NewValue);
switch handleToChange
case handles.handle1
set(handles.handle1,'Value',MyValueIndex);
case handles.handle2
set(handles.handle2,'Value',MyValueIndex);
otherwise
error('Uh oh!');
end
Note that MyValueIndex is the index of dropdown box values that you want. Which is found with a find command on the actual value.
Question two is more of an opinion question but I think that a pop-up box describing the problem is sufficient. Maybe add in a system beep for good measure!
Reference:
http://www.mathworks.com/matlabcentral/answers/22734-resetting-a-pop-up-menu-in-a-gui
http://www.mathworks.com/help/matlab/ref/find.html
http://www.mathworks.com/help/matlab/ref/switch.html
For a popupmenu uicontrol the Value property determines which element of the String property is currently being displayed. Get the String; compare its contents to the calculated variable to get the index; then set that index as the Value property. If the calculated variable is not currently in the String then add it to the String and then set the Value. (Note when comparing you need to compare numbers to numbers or string to strings, so you may need to do an appropriate data type conversion first).
Use an errordlg.

How to design textbox visibility expression in SSRS?

I have an RDL with a table/textbox visibility set to:
=iif(Fields!question_caption.Value = "OBJECTIVE 1",false,true)
I am trying to make this textbox display the value named "narrative" only if the question_caption record = "OBJECTIVE 1". How can I do this? Currently this textbox displays nothing with the above logic. I have the narrative field stored in a Placeholder if that makes any difference.
Here is some sample data for you:
create table #dummy_data
(
question_caption varchar(max),
narrative varchar(max)
)
insert #dummy_data values('1st week dates','week 1'),('2nd week dates','week 2'),('3rd week dates','week 3'),('OBJECTIVE 1','obj 1'),
('5th week dates','week 5')
select * from #dummy_data
I don't see anything wrong with your visibility expression. However, in your question, you're discussing two separate things as one (i.e., visibility & displaying a value in a placeholder).
The hidden property will show an object (tablix, textbox, image, chart, container, etc) if the expression returns false and will hide an object when the expression returns true. When I say hide, I mean that it will remove the object from the grid and, if all is setup properly, the surrounding objects will be shifted to fill the now empty space of the hidden object.
To display (or not) a value is an entirely different thing. To show or hide a value, you would put the following expression in the value property of the placeholder:
=IIF(Fields!question_caption.Value = "OBJECTIVE 1",Fields!narrative.Value,"")
Notice that I've set it up such that if the desired value of the question_caption field is present, it will display the value of the narrative field. Otherwise, it will return an empty string. This will maintain the layout of the report but simply display the desired value or an empty string, based on some criteria.
As for the issues you're current experiencing, I'm not sure why that would be happening. I would first check that you don't have a typo in the Objective 1 hardcoded value in your expression.
If this doesn't help, please comment and let me know some more information about your problem and I'll do my best to help.

Crystal Reports show field grey when date is null

Our user wants a date field to display as highlighted or with a grey background when the date is null. How would I do something like this? (At the very least, I suspect I'll first have to convert it to a string.)
Completed Date
12/15/2010
03/07/2011
<-- make that a grey block
05/01/2010
I hope that you don't think this too hacky but you can do what you want by adding a Formula field and calling it something like NullCheck. Then put the code below in the NullCheck formula field so that it places an X whenever the date field is null.
If IsNull({DeleteMe.DateField}) Then
"X"
Next put that field (NullCheck) on your page so that the box covers the date field exactly. Then use the Highlighting Expert to set the background and the font to the same color when the X appears in the field (see image below).
When done it should "highlight" all null dates fields as shown.