Issue using Datetime column with null values

Stimulsoft Reports.WEB discussion
Post Reply
User avatar
zalak
Posts: 18
Joined: Wed Jun 20, 2018 1:41 pm

Issue using Datetime column with null values

Post by zalak »

Hello,

I have 2 datetime columns in my table, e.g. MyDataTable.tempDateOne & MyDataTable.tempDateTwo.

I want to add a new calculated column to the table using expression "IIF(MyDataTable.tempDateTwo == null, MyDataTable.tempOldValue, MyDataTable.tempNewValue)". But, I guess the condition 'MyDataTable.tempDataTwo == null' does not work correctly.

For testing, I used a databand and added textbox with a condition "IIF(MyDataTable.tempDateTwo == null, "no value", "has value")" and databand never shows "no value" instead shows a blank. But if the 'MyDataTable.tempDateTwo' has value it displays 'has value'. I have attach a screenshot of the databand output.

Is there any way if I can check whether the 'MyDataTable.tempDateTwo' column has value or is null or is empty?

How can I fix this problem?

Thanks & Regards,
Zalak Dobaria
Attachments
Stimulsoft_DateColumn.png
Stimulsoft_DateColumn.png (8.98 KiB) Viewed 7354 times
User avatar
zalak
Posts: 18
Joined: Wed Jun 20, 2018 1:41 pm

Re: Issue using Datetime column with null values

Post by zalak »

Just to add, if I had highlight condition on the text box where in I check IsNull for column 'MyDataTable.tempDateTwo' it works correctly.
See the screen shot
Attachments
Hightlight condition
Hightlight condition
Stimulsoft_DateColumn_InBuiltCondition.png (8.63 KiB) Viewed 7352 times
Lech Kulikowski
Posts: 7339
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue using Datetime column with null values

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data which reproduces the issue for analysis.

Thank you.
User avatar
zalak
Posts: 18
Joined: Wed Jun 20, 2018 1:41 pm

Re: Issue using Datetime column with null values

Post by zalak »

Hello,

Please find attached the sample for the issue.

Regards,
Zalak
Attachments
Sample.mrt
(121.61 KiB) Downloaded 634 times
User avatar
zalak
Posts: 18
Joined: Wed Jun 20, 2018 1:41 pm

Re: Issue using Datetime column with null values

Post by zalak »

Hello,

Any update? I hope the sample report is working.

Regards,
Zalak
Lech Kulikowski
Posts: 7339
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue using Datetime column with null values

Post by Lech Kulikowski »

Hello,

Please clarify what is wrong with sample report?

Also, please clarify which version are you use?

Thank you.
User avatar
zalak
Posts: 18
Joined: Wed Jun 20, 2018 1:41 pm

Re: Issue using Datetime column with null values

Post by zalak »

Hello,

As you asked for a sample I had attached the sample.mrt report to clarify my issue. In the sample.rpt report, there is a table 'Statement' which has column 'Date' and to illustrate the problem of nullable datetime columns I added a new calculated column 'DateTwo' with this expression 'DateTime.Parse(IIF(Statement.InvoiceNumber == 974212 || Statement.InvoiceNumber == 147212, null, Statement.Date).ToString())' just to get a 2 rows with null values for this newly added column i.e. 'DateTwo'.

Now, the issue is as I described earlier, when I want a new calculated column using expression "IIF(Statement.DateTwo == null, "dateTwoNull","notNUll").ToString()" the databand never displays 'dateTwoNull', i.e. the value true for 'Statement.DateTwo == null' is never displayed. See the screen shot.

In my project what I need is, if the datetime column has null values then take data from one column, if it is not null then take data from another column.

Is there any way if I can check whether the 'Statement.DateTwo' column is null or is empty or has a value?

We are using version 2019.1.1.0.
Lech Kulikowski wrote: Sun Sep 29, 2019 1:32 pm Hello,

Please clarify what is wrong with sample report?

Also, please clarify which version are you use?

Thank you.
Attachments
Stimulsoft_SampleReport.png
Stimulsoft_SampleReport.png (14.24 KiB) Viewed 7301 times
Lech Kulikowski
Posts: 7339
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue using Datetime column with null values

Post by Lech Kulikowski »

Hello,

Please check the modified report.

Thank you.
Attachments
Sample modified.mrt
(121.59 KiB) Downloaded 921 times
David334
Posts: 30
Joined: Tue Jul 16, 2019 6:45 pm

Re: Issue using Datetime column with null values

Post by David334 »

I am running into a similar issue. My problem though it I am not able to load this sample.mrt because I dont have a full copy of this software it seems. I only have some limited version provided to me by some other software that uses stimulsoft for its reporting.

Would you be able to explain the answer to this in this post without needing provide a report file?
Lech Kulikowski
Posts: 7339
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue using Datetime column with null values

Post by Lech Kulikowski »

Hello,

In the Interpretation mode, it is not possible to use IIF() function for that task, need to use the conditional operator ?:

Thank you.
Post Reply