Page 1 of 1

MyObject in StiReport

Posted: Mon May 03, 2010 3:05 am
by LukasT
Hello,
your product is wonderfull. But we have one problem which we need to solve to have successful implementation.
We need to pass in some reference to our instance of object and than call its functions directly in report. I have found solution only for calling static functions. Is here any solution for our needs, please?
Thanks a lot.

MyObject in StiReport

Posted: Mon May 03, 2010 8:54 am
by Jan
Hello,

Yes you can do this. Please make following steps:

1. Add reference to your assembly (which contain required types);
2. Create new variable with type - object;
3. Before report rendering assign to this variable required object:

Code: Select all

report.Compile();
report.CompiledReport["MyVariable"] = myObject;
4. Call content of your object from expression:

Code: Select all

{((MyNameSpace.MyType)MyVariable).SomeProperty}
Thank you.