Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
hugocesar
Partner - Contributor II
Partner - Contributor II

Pixel Perfect KPI Color Formatting via Script

Hello Friends!

I'm trying to get a pixel perfect report with some kpi's. I am getting this KPI's througth variables and formulas. I want to give colors to this KPI´s depending some variables evaluations. I want to do that using script features but I am getting errors (see attach file). In other words, I want to get a KPI color depending variable or funtion evaluation via script.

private void PixelPerfect_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {

if(ColorCant < 0)
{
label11.ForeColor = Color.FromArgb(192, 0, 0);
}
else
{
label11.ForeColor = Color.FromArgb(100, 100, 100);
}
}

 Thanks for your help

Labels (2)
1 Reply
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

I will not answer your question regarding how to properly write a script to do color fomratting - sorrymbut...

If you share bit more info on how you want to color format your objects I should be able to give you different method (using formatting rules) to achieve the same.

Is there any reason why you are not using formatting rules and trying use a script?

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.