Custom function support
Hello,
I'm planning to add reporting to my current project. Previously, it was using FR 3.0 and was wriiten in Delphi. Currently the app is being rewritten to C#. I consider using one of the three reporting engines : DevExpress XtraReports Suite, Crystal Reports and FR C# which is due to have official release (and I'm considering these options in the mentioned order)
Still however, cannot find the engine that enables me to EASILY define custom functions in source code so that the end-user can use them in the report he/she is modyfing, of course in design mode.
Such a feature is provided in FR version I use in Delphi. The ability to define several custom functions so that they can be made available to the end-user is of the greatest importance to me.
Is such a feature currently (or will be - when) if FR.NET ? I could use FR NET if only the set of features it offers is EQUAL or BIGGER the the set of features offered in older FS....
Moreover is there any manual on the site that provides some step by step instructions on how to create reports ? Currently found the demo and class documentation only.
Thank you for any response
I'm planning to add reporting to my current project. Previously, it was using FR 3.0 and was wriiten in Delphi. Currently the app is being rewritten to C#. I consider using one of the three reporting engines : DevExpress XtraReports Suite, Crystal Reports and FR C# which is due to have official release (and I'm considering these options in the mentioned order)
Still however, cannot find the engine that enables me to EASILY define custom functions in source code so that the end-user can use them in the report he/she is modyfing, of course in design mode.
Such a feature is provided in FR version I use in Delphi. The ability to define several custom functions so that they can be made available to the end-user is of the greatest importance to me.
Is such a feature currently (or will be - when) if FR.NET ? I could use FR NET if only the set of features it offers is EQUAL or BIGGER the the set of features offered in older FS....
Moreover is there any manual on the site that provides some step by step instructions on how to create reports ? Currently found the demo and class documentation only.
Thank you for any response
Comments
You can use custom functions declared in your main app. To do this:
- declare a function in your app; it must be "public static";
- go report designer, "Report|Options..." menu, select "Script" and add the main app's name to the "Referenced assemblies" list;
- now you can use the function in the report's script or in any expression (if the function returns a value).
For example, the FR.Net Demo has the following function:
To call it from report, add "Demo.exe" to the "Referenced assemblies" and call the function from a script the following way:
since this function returns nothing, you can't use it in expressions.
Of course, you can use everything that is declared in your app, not only functions.
Hello and thank you for your response.
Does the provided solution enables me to access the data in the data layer of the report ?
Let's say I have a dataset that is used in the reports. Then I wanna call a method that will use that data a perfor some additional calculations so that I will be able to add another textfield or label to the report presentig the results.
yes, for example you may declare a method in your application that will concatenate two string values:
and use it in a TextObject:
[Demo.Form1.Concat([Employees.FirstName], [Employees.LastName])]