Page 1 of 1
Runtime Style Loading
Posted: Mon Oct 08, 2018 5:29 pm
by BCS
Is it possible to load a *.sts file for styling at run time similar to the external editor? In other words if I create a collection of styles, can I load them at run time via the save file and how would I switch between styles in that collection I just loaded.
Re: Runtime Style Loading
Posted: Wed Oct 10, 2018 10:25 pm
by Lech Kulikowski
Hello,
Yes, you can use the report.Styles.Load() method.
Thank you.
Re: Runtime Style Loading
Posted: Wed Oct 17, 2018 4:37 pm
by BCS
First of all I don't think you understood my question(s)...
1. Can l via Javascript, take a StiReport Object and load a style collection via an exported file into the StiReport, report.styles.load() has no parameters, I am looking for something like report.styles.load('Styles.sts')
2. If this is possible, how do I set the style index for the report, if the sts file has 5 styles and I want index 3, how do I do that.
I may have a few hundred reports and if I add a new style I can't just go open all of them one by one making this modification, its not feasible.
I only see:
loadFromJsonObject(jObject: StiJson) : void
loadFromXml(xmlNode: XmlNode) : void
Re: Runtime Style Loading
Posted: Sat Oct 20, 2018 9:34 am
by Lech Kulikowski
Hello,
Yes, you can use these methods in the JS:
loadFromJsonObject(jObject: StiJson)
loadFromXml(xmlNode: XmlNode)
> 2. If this is possible, how do I set the style index for the report, if the sts file has 5 styles and I want index 3, how do I do that.
You can load your styles in StiStylesCollection and work with it, remove, add etc
Thank you.
Re: Runtime Style Loading
Posted: Wed Oct 24, 2018 1:40 am
by BCS
I will have to post an example of how I'm doing this and why its not working when I can get to it.
Re: Runtime Style Loading
Posted: Wed Oct 24, 2018 10:27 am
by Lech Kulikowski
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Re: Runtime Style Loading
Posted: Wed Jul 27, 2022 11:46 am
by dlms_kz
I have the same question!
I want to programatically change the style right before the report generated.
How can I achieve this instead of writing a lot of rules for each of elements / bands / components?
(It must be somewhere some method as the designer does the same job..?!)
Thank you!
Re: Runtime Style Loading
Posted: Thu Jul 28, 2022 9:46 pm
by Lech Kulikowski