Page 1 of 2

Date converts to string and List in "Variables"

Posted: Wed Nov 23, 2022 4:55 am
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 1430 times

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

Posted: Wed Nov 23, 2022 5:04 am
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 1429 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 1429 times

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

Posted: Wed Nov 23, 2022 9:41 am
by Lech Kulikowski
Hello,

The sent file already contains string List variables. Please send us your original file with datetimes.

Thank you.

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

Posted: Wed Nov 23, 2022 2:23 pm
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.

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

Posted: Thu Nov 24, 2022 9:17 am
by Lech Kulikowski
Hello,

We couldn't reproduce the issue.
Please send us a sample project that reproduces the issue for analysis.

Thank you.

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

Posted: Thu Nov 24, 2022 2:59 pm
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.

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

Posted: Thu Nov 24, 2022 6:07 pm
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.

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

Posted: Fri Nov 25, 2022 6:23 am
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.

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

Posted: Fri Nov 25, 2022 9:36 am
by Lech Kulikowski
Hello,

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

Thank you.

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

Posted: Mon Nov 28, 2022 2:58 pm
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.