Formatting a datetime field
Formatting a datetime field
I'm trying to display a field of datetime and I'm having some trouble formatting this.
I want something like that:
dd/MM/yyyy HH:mm
And I'm getting this when my field is not null:
Mon Jul 23...
And when my field is null:
NaN/NaN/NaN...
I've already tried the "Text Format" property, but it just don't work properly as well, maybe because it isn't a text property, I don't know.
How can I set the Date Format properly and how can I avoid the "NaN/NaN/NaN" stuff
I want something like that:
dd/MM/yyyy HH:mm
And I'm getting this when my field is not null:
Mon Jul 23...
And when my field is null:
NaN/NaN/NaN...
I've already tried the "Text Format" property, but it just don't work properly as well, maybe because it isn't a text property, I don't know.
How can I set the Date Format properly and how can I avoid the "NaN/NaN/NaN" stuff
Re: Formatting a datetime field
Hello.
You could format with TextFormat property DateTime type fields only. Also you could set format with next expression:If it will not help you, please, send us a report template with data for analysis.
Thank you.
You could format with TextFormat property DateTime type fields only. Also you could set format with next expression:
Code: Select all
{DataSource1.DateTimeColumn.ToString("dd/MM/yyyy HH:mm")}
Thank you.
Re: Formatting a datetime field
Hello mate, thanks for your reply.
I tried what you've suggested and it didn't work, I'll upload my layout.
cheers
I tried what you've suggested and it didn't work, I'll upload my layout.
cheers
- Attachments
-
- Relatório.mrt
- (21.84 KiB) Downloaded 631 times
Re: Formatting a datetime field
Hello.
You didn't send us any data for report.
Where do you have problems? Please, describe your problem. How to reproduce it?
Thank you.
You didn't send us any data for report.
Where do you have problems? Please, describe your problem. How to reproduce it?
Thank you.
Re: Formatting a datetime field
Thank you for your reply.
My problem is regarding the date field (ultimoLogon), when I change the text format this field is printed with "0" and when I change only the field type to "datetime" it's printed as I've mentioned on my original post.
About the data, I don't know how I can put my data here, because it's just some string fields and one problematic date field.
I just want something to format it with this pattern: dd/MM/yyyy HH:mm. Is there another way to do that, besides using this one that you already mentioned?
My problem is regarding the date field (ultimoLogon), when I change the text format this field is printed with "0" and when I change only the field type to "datetime" it's printed as I've mentioned on my original post.
About the data, I don't know how I can put my data here, because it's just some string fields and one problematic date field.
I just want something to format it with this pattern: dd/MM/yyyy HH:mm. Is there another way to do that, besides using this one that you already mentioned?
Re: Formatting a datetime field
Hello.
Please, try to set Hide Zeros property of the Text9 component to True.
By the way, the ultimoLogon column type is string in the report template that you send us.
Thank you.
Please, try to set Hide Zeros property of the Text9 component to True.
By the way, the ultimoLogon column type is string in the report template that you send us.
Thank you.
Re: Formatting a datetime field
Yeap, I did change to send to you guys.
If I set the "Hide Zeros" to true, it won't solve the problem, because even the fields with a date to be printed are printing zeros.
Any idea?
If I set the "Hide Zeros" to true, it won't solve the problem, because even the fields with a date to be printed are printing zeros.
Any idea?
Re: Formatting a datetime field
Hello.
To avoid displaying zeros you should change expression like next:
Thank you.
To avoid displaying zeros you should change expression like next:
Code: Select all
{IIF(dados.ultimoLogon == null , "", dados.ultimoLogon.ToString("dd/MM/yyyy HH:mm"))}
Re: Formatting a datetime field
Doesn't work at all
Re: Formatting a datetime field
Hello.
Please, send us the right report template with data for analysis.
And describe issue that you have now more detailed.
Thank you.
Please, send us the right report template with data for analysis.
And describe issue that you have now more detailed.
Thank you.