Seal Report Forum
»
Report Edition
»
Reports
»
Adjusting formulas based on a pulldown
Rank: Advanced Member
Groups: Registered
Joined: 5/18/2018(UTC) Posts: 40
Thanks: 2 times
|
I would like to have a chart where I can have a variable (call it @choice) selection at the top of the page with an enumerated list Gross = 0 or Net = 1
Then in the advanced sql, it would have (data.gross - (@choice) * data.fees) as the query.
Is there an easy way to pull this off? I suppose I could use the column picker in example 52, but I'm not sure if that works for charts or not.
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
Yes we can, Just add your input restriction, then set an new SQL statement for the element, I just made a try with the 52 sample: I added the "Quantity Factor" input restriction, then I modify the 'Pre Load Script' of the model to patch the SQL property of the Quantity element (which is normally "SUM([Order Details].Quantity)") Code: ReportRestriction restriction = model.Report.GetInputValueByName("Quantity Factor");
if (restriction != null)
{
var quantity = model.Elements.FirstOrDefault(i => i.DisplayNameEl == "Quantity");
if (quantity != null) {
quantity.SQL = string.Format("SUM({0}*[Order Details].Quantity)", restriction.Value1);
}
}
Edited by user Friday, October 16, 2020 6:36:25 AM(UTC)
| Reason: Not specified
|
|
|
|
Seal Report Forum
»
Report Edition
»
Reports
»
Adjusting formulas based on a pulldown
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.