Page 1 of 1

Loading Custom Styles(.sts) in runtime

Posted: Thu Nov 04, 2021 7:20 am
by damithfit
Hi,

I want to know how to load the custom style (.sts) file and apply it to the report designer's ''select style'' section using javascript.

in some post, you mentioned about the we can do it by some methods like,

loadFromJsonObject(jObject: StiJson)
loadFromXml(xmlNode: XmlNode)

but couldn't find any methods in JS documentation section.
https://admin.stimulsoft.com/documentat ... eport.html

Appreciate, if you could give some code examples of how we can achieve this using JavaScript.

thank you.

Regards,
damith

Re: Loading Custom Styles(.sts) in runtime

Posted: Mon Nov 08, 2021 1:24 pm
by Lech Kulikowski
Hello,

You can save the necessary styles in JSON, XML and then use these methods to load it.

Thank you.

Re: Loading Custom Styles(.sts) in runtime

Posted: Tue Nov 09, 2021 12:22 pm
by damithfit
Hi Lech,

Thanks for the Reply.

Seems you didn't get me right.

Yeah, I got the style from JSON but I couldn't find any load methods in StiReport class in Javascript documentation.

something like report.style.loadFromJsonObject(JSON).

i can see mentioned methods(loadFromJsonObject(jObject: StiJson),loadFromXml(xmlNode: XmlNode)) in StiStyleCondition class. Please refer below link.

(https://admin.stimulsoft.com/documentat ... ition.html )

but I couldn't find any class or method for StiStylesCollection in Javascript documentation.

An early reply would be appreciated.

Thank you.

Regards,
damith

Re: Loading Custom Styles(.sts) in runtime

Posted: Fri Nov 12, 2021 11:28 am
by Lech Kulikowski
Hello,

You can use the following methods:
report.styles.loadFile("Styles.sts");
report.styles.loadFromJsonObject(jObject: StiJson)
report.styles.loadFromXml(xmlNode: XmlNode)
etc

Thank you.

Re: Loading Custom Styles(.sts) in runtime

Posted: Thu Nov 25, 2021 4:16 am
by damithfit
Hi Lech,

Thanks for the reply.

Regards,
damith.

Re: Loading Custom Styles(.sts) in runtime

Posted: Thu Nov 25, 2021 8:39 am
by Lech Kulikowski
Hello,

You are welcome.