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
dsydsy  
#1 Posted : Thursday, May 6, 2021 9:57:28 PM(UTC)
dsydsy

Rank: Member

Groups: Registered
Joined: 2/15/2019(UTC)
Posts: 10
United States
Location: AZ

Was thanked: 1 time(s) in 1 post(s)
Hello!

I am not well versed with Razor, c#, etc., so please forgive my ignorance, but I am having a hard time determining a way to compare a cell value to another value that I do not want in the model. Example cell script below:

@{
//Display negative values in red and bold
ResultCell cell=Model;
ReportElement element = cell.Element;
ReportModel reportModel = element.Model;
Report report = reportModel.Report;
//For performances reason, consider to process your result table in a dedicated Task with an execution step 'Models generated, before rendering'
if (cell.DoubleValue > [COLUMN IN MY QUERY, BUT NOT ONE I WANT DISPLAYED IN THE FINAL REPORT OUTPUT]
{
cell.FinalCssStyle = "font-weight:bold;color:red;";
cell.FinalCssClass = "danger lead text-right"; //These are Bootstrap classes
}


}


Is there a way to reference a value in my table that is not in my model (set it as a var or such)? Or is a way to hide a column from the final output while sill having it in the model, where the cell reference in bold is hidden from the final results?

(cell.DoubleValue > cell.ContextTable[cell.ContextRow,cell.ContextCol+1].DoubleValue)

Really appreciate any help!
epf  
#2 Posted : Friday, May 7, 2021 12:38:22 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)
yes you may hide a column in the DataTable:
Click on your DataTable view, then use the 'Options: Column to hide' property to hide the column used in the model for you calculation.


you may also consider to process you result tables in a Task executed before the rendering, according to you needs and skills.
dsydsy  
#3 Posted : Sunday, May 9, 2021 9:21:01 PM(UTC)
dsydsy

Rank: Member

Groups: Registered
Joined: 2/15/2019(UTC)
Posts: 10
United States
Location: AZ

Was thanked: 1 time(s) in 1 post(s)
Thanks so much, that worked as you described!

For anyone else who was having a hard time finding these settings (as I was), DataTable is down under Views-->Model Container-->Data Table along the right hand side. :)

Users browsing this topic
Guest
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.