Page 1 of 1

SetStyleToComponent()-Method not enforced / overwritten by (default) colors

Posted: Tue Dec 05, 2023 1:22 pm
by edstyles
I am looking for a way to set the style colors of a chart component in a report dynamically via code.

My minimal working example (see 'Variant 1 (preferred variant) 'StiChartStyle' of chart set via event/code) on Page 1 in the attached mrt-file) works in the editor Stimulsoft Reports (2021.4.4 from 19.11.2021, WPF v1, .NET 4.8, 2003-2023 ©Stimulsoft).
However, when the report based on this mrt-file is generated in the source application, some default colors are shown (not the default colors of the report file). All dll-files in the source application have the same version 2021.4.4.0, except 'Stimulsoft.Svg.dll' (2021.4.3.0).
Could you help me by telling me how to enforce ".SetStyleToComponent(Chart0)" in line 875 of the mrt-file in a generated report?

If this is not possible, could you give me a hint on how to set the style colors via 'Variant 3 / Code-generated data and assign 'AutoSeriesColorDataColumn' via event/code) on Page 1 or any other simple way to do this code-only?

Regards,
Ed

Re: SetStyleToComponent()-Method not enforced / overwritten by (default) colors

Posted: Wed Dec 06, 2023 8:59 am
by Lech Kulikowski
Hello,

Please send your mrt file.

Also, please try to use the newChart.Core.ApplyStyle(customStyle); method.

Thank you.

Re: SetStyleToComponent()-Method not enforced / overwritten by (default) colors

Posted: Thu Dec 07, 2023 6:17 am
by edstyles
The mrt file is now attached to the original post. Could you be so kind and show how the newChart.Core.ApplyStyle(customStyle); method is used?

Re: SetStyleToComponent()-Method not enforced / overwritten by (default) colors

Posted: Thu Dec 07, 2023 11:11 am
by Lech Kulikowski
Hello,

We couldn't reproduce the issue. How do you run your report?

Thank you.

Re: SetStyleToComponent()-Method not enforced / overwritten by (default) colors

Posted: Thu Dec 07, 2023 12:35 pm
by edstyles
Run locally on a W10 notebook in Stimulsoft Reports editor (2021.4.4 from 19.11.2021, WPF v1, .NET 4.8, 2003-2023 ©Stimulsoft), I also do not get an issue.

When the mrt file is uploaded to the web application HiScout 3.11.1.0 and run within the product, the SetStyleToComponent()-Method is not enforced and only default colors are shown. The integration of Stimulsoft Reports is done via dll files (https://www.hiscout.com/erweiterungen/docgen/, german only).

Is Variant 3 outlined on page 1 of the report another way to achieve this?
- Code-generated data and assign 'AutoSeriesColorDataColumn' via event/code
- Can this be done using business objects(?) (https://www.stimulsoft.com/en/samples/r ... the-report)?

Or is there yet another variant to get the result of Variant 1 that is code-only?

Re: SetStyleToComponent()-Method not enforced / overwritten by (default) colors

Posted: Thu Dec 07, 2023 11:06 pm
by Lech Kulikowski
Hello,

Please send your request to HiScout developers, we do not know how they use our components in this application.

Thank you.