Hi:
I'm sure this is an easy question for the gurus out there...
How can I use static function to calculate a total within a report?
What I'm trying to do is use a static function I have in C# to do some pretty sofisticated calculations and then return the result to be printed in the report, in a detail band.
Also, the static function requires a few parameters to identify the record it should do the calculations for, which should be provided by the current record withint the report. How do I access this data to pass to my code?
Finally, where should I be doing this (maybe an event handler)?
TIA,
MartinH.
Using static methods in a report
-
- Posts: 66
- Joined: Wed Apr 04, 2007 3:32 am
- Location: Spain
Using static methods in a report
You should do the following steps:MartinH wrote:How can I use static function to calculate a total within a report?
What I'm trying to do is use a static function I have in C# to do some pretty sofisticated calculations and then return the result to be printed in the report, in a detail band.
1. Define your static function in the program code. The result of the calculating please store in the variable which should be defined in the Dictionary of the report. After the calculations the result can be rendered in the detail band from the variable.
2. In the report please add the reference to your program (Properties - Referenced Assemblies) and a namespace.MartinH wrote:Also, the static function requires a few parameters to identify the record it should do the calculations for, which should be provided by the current record withint the report. How do I access this data to pass to my code?
Please, see the flash demo "How to add My Function" on our site.
http://www.stimulsoft.com/livedemos/Rep ... ction.html
3. You can call your function in the Rendering event of the report using DataSource.Position or Line function, which specify position of the record in a datasource.MartinH wrote:Finally, where should I be doing this (maybe an event handler)?
Thank you.
-
- Posts: 66
- Joined: Wed Apr 04, 2007 3:32 am
- Location: Spain
Using static methods in a report
Pavel:
That was spot on, problem resolved.
It takes a little time to understand the philosophy of a new product, but I'm getting there.
Thanks again,
Martin.
That was spot on, problem resolved.
It takes a little time to understand the philosophy of a new product, but I'm getting there.
Thanks again,
Martin.