Date converts to string and List in "Variables"

Stimulsoft Reports.JS discussion
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Date converts to string and List in "Variables"

Post by bobsov »

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.
Screenshot 2022-11-22 at 11.52.06 PM.png
Screenshot 2022-11-22 at 11.52.06 PM.png (89.11 KiB) Viewed 1370 times
Attachments
mrt.json
(33.05 KiB) Downloaded 89 times
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Date converts to string and List in "Variables"

Post by bobsov »

This report does not load in report viewer and here is what is seen in console log when I change back to datetime
Screenshot 2022-11-23 at 12.02.52 AM.png
Screenshot 2022-11-23 at 12.02.52 AM.png (278.12 KiB) Viewed 1369 times
If I don't change and go with list string, this is what I see
Screenshot 2022-11-23 at 12.01.55 AM.png
Screenshot 2022-11-23 at 12.01.55 AM.png (66.92 KiB) Viewed 1369 times
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Date converts to string and List in "Variables"

Post by Lech Kulikowski »

Hello,

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
Screenshot 2022-11-23 104032.png (107.55 KiB) Viewed 1364 times
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Date converts to string and List in "Variables"

Post by bobsov »

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.
Attachments
mrt (1).json
(33.49 KiB) Downloaded 80 times
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Date converts to string and List in "Variables"

Post by Lech Kulikowski »

Hello,

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
Screenshot 2022-11-24 101657.png (126.66 KiB) Viewed 1318 times
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Date converts to string and List in "Variables"

Post by bobsov »

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.
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Date converts to string and List in "Variables"

Post by Lech Kulikowski »

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.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Date converts to string and List in "Variables"

Post by bobsov »

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

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"
            },
I believe this could be causing issue.
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Date converts to string and List in "Variables"

Post by Lech Kulikowski »

Hello,

Unfortunately, it is difficult to say why it happens without a sample.

Thank you.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Date converts to string and List in "Variables"

Post by bobsov »

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.

Code: Select all

const dateObj = new Stimulsoft.System.DateTime(YYYY, MM, dd, hh, mm, ss);
report.dictionary.variables.getByName(element.id).valueObject = dateObj;
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.
Post Reply