Date converts to string and List in "Variables"
Date converts to string and List in "Variables"
This issue that I am reporting has happened before. The only reason I have not reported is - I had only couple of reports with variables and I used to just change and save it again and it used to work fine. Now with newer release, the whole report breaks.
I have attached report here too but here is the screenshot as you can see the value type is string (list) but I had it as datetime.
I have attached report here too but here is the screenshot as you can see the value type is string (list) but I had it as datetime.
- Attachments
-
- mrt.json
- (33.05 KiB) Downloaded 90 times
Re: Date converts to string and List in "Variables"
This report does not load in report viewer and here is what is seen in console log when I change back to datetime
If I don't change and go with list string, this is what I see
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Date converts to string and List in "Variables"
Hello,
The sent file already contains string List variables. Please send us your original file with datetimes.
Thank you.
The sent file already contains string List variables. Please send us your original file with datetimes.
Thank you.
- Attachments
-
- Screenshot 2022-11-23 104032.png (107.55 KiB) Viewed 1392 times
Re: Date converts to string and List in "Variables"
I am attaching the original file here.
It opens fine in 2022.1.6 version but gives that console error in 2022.4.5.
The reason I used 2022.1.6 is - thats the version I am upgrading from.
It opens fine in 2022.1.6 version but gives that console error in 2022.4.5.
The reason I used 2022.1.6 is - thats the version I am upgrading from.
- Attachments
-
- mrt (1).json
- (33.49 KiB) Downloaded 81 times
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Date converts to string and List in "Variables"
Hello,
We couldn't reproduce the issue.
Please send us a sample project that reproduces the issue for analysis.
Thank you.
We couldn't reproduce the issue.
Please send us a sample project that reproduces the issue for analysis.
Thank you.
- Attachments
-
- Screenshot 2022-11-24 101657.png (126.66 KiB) Viewed 1346 times
Re: Date converts to string and List in "Variables"
I will create a sample project and send it to you.
Also, one thing to note on your screenshot you posted, it is clearly showing as a dropdown instead of date picker. That itself is an issue too.
Also, one thing to note on your screenshot you posted, it is clearly showing as a dropdown instead of date picker. That itself is an issue too.
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Date converts to string and List in "Variables"
Hello,
> I will create a sample project and send it to you.
Ok, we will wait.
> Also, one thing to note on your screenshot you posted, it is clearly showing as a dropdown instead of date picker. That itself is an issue too.
In that case, variables should be datetime.
Thank you.
> I will create a sample project and send it to you.
Ok, we will wait.
> Also, one thing to note on your screenshot you posted, it is clearly showing as a dropdown instead of date picker. That itself is an issue too.
In that case, variables should be datetime.
Thank you.
Re: Date converts to string and List in "Variables"
I m unable to create sample project. While working on that, I did come across something that may offer a clue.
We are using stimulsoft-webpack.config.js to load stimulsoft files in angular.json.
Could that be an issue?
Here is the stimulsoft-webpack.config.js content
And here is how we are calling it in angular.json
I believe this could be causing issue.
We are using stimulsoft-webpack.config.js to load stimulsoft files in angular.json.
Could that be an issue?
Here is the stimulsoft-webpack.config.js content
Code: Select all
module.exports = (config, options, targetOptions) => {
for (const rule of config.module.rules) {
if (rule.test.test('.js')) {
rule.exclude = [/node_modules[\\/]stimulsoft/];
break;
}
}
config.module.rules.push({
test: /stimulsoft\.[a-z\.]+\.js$/,
use: {
loader: 'babel-loader',
options: {
ignore: [/.*/]
}
}
});
return config;
};
And here is how we are calling it in angular.json
Code: Select all
"customWebpackConfig": {
"path": "./stimulsoft-webpack.config.js"
},
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Date converts to string and List in "Variables"
Hello,
Unfortunately, it is difficult to say why it happens without a sample.
Thank you.
Unfortunately, it is difficult to say why it happens without a sample.
Thank you.
Re: Date converts to string and List in "Variables"
I was able to fix this issue. The real issue was with how I was initializing the variables. I had to explicitly say it is DateTime.
Prior to this upgrade, I didn't have to say that. That fixed my issue. What threw me off was the issue was seen in compiled version of deployment and not locally, so it was hard to replicate and send u the sample project. But all good now.
Code: Select all
const dateObj = new Stimulsoft.System.DateTime(YYYY, MM, dd, hh, mm, ss);
report.dictionary.variables.getByName(element.id).valueObject = dateObj;