logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
epf  
#1 Posted : Tuesday, March 11, 2014 12:40:16 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
There is no formula engine in Seal Report.
This is because you should rely mainly on your database engine to perform specific calculations.

However, it is easy to change the SQL used to query your column and thus add SQL formula in your model:

Create a model, based on Northwind
Drag and drop the Product Name in the Row Elements of the model.
Then go in Advanced->Custom SQL, you can here customize the SQL with what you want (call of a function, case statements, etc.)
For Northwind, just type
Quote:
'PRODUCT:' & Products.ProductName
to add a prefix to your column value.

You can also use this property for the Data elements.
Drag and drop Quantity in the Data Elements
Rename it to Total Price
Then in Custom SQL, type
Quote:
Sum([Order Details].Quantity*[Order Details].UnitPrice)

this will give the calculation of the price.

You can also customize the CSS style of your cell in the Custom Cell CSS property.
Just type
Quote:
color:red;text-align:right;
¨

So when you run the report, you got the list of product with a total price based (in red !) on a calculation performed by the database server.

Do not hesitate to use the CASE statements in SQL Server or Oracle, they can be very useful.

Edited by user Tuesday, March 11, 2014 12:42:00 PM(UTC)  | Reason: Not specified

Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.