Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
How can we apply RGB codes into a formula object?
I have 3 formulas created via pixel perfect and the colors have to be assigned according to the RGB codes given by our client.
Any idea?
Thanks and regards,
Arthur Fong
Hi Arthur,
That clears up the requirement for me.
You can use script to format the control.
Example:
Lets say your Formula control has name label1
You can add C# code in the BeforePrint event
I used RGB(0,100,45) like this:
private void PixelPerfect_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
label1.ForeColor = Color.FromArgb(0, 100, 45);
}
Which results in:
HTH - Daniel.
I found a better way to apply RGB codes in pixel perfect without using scripts.
In the desired label properties, select foreground dropdown and click on any colors on custom tab.
Then, change the RGB code displayed to the designated RGB colors.
Hi Arthur,
We will need more information than that if we are to understand your requirement. Not sure what the screenshot is trying to convey either. If you provide a simple QVW/QVF and a mockup report of your expected output explaining what you want colours to be based on you may get a more helpful response. PixelPerfect is really quite powerful and there is a chance similar solutions have been provided in the past. For example here's one that sets the background colour based on the value of a field: https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Npriting-Conditional-Format-Rules-Pixel-Per...
HTH - Daniel.
I think my question is pretty straightforward.
Instead of changing the foreground color with the fixed colors in the settings on the left panel, is there any way we can assign RGB colors into the selected pixel perfect text object or formulas?
Hi Arthur,
That clears up the requirement for me.
You can use script to format the control.
Example:
Lets say your Formula control has name label1
You can add C# code in the BeforePrint event
I used RGB(0,100,45) like this:
private void PixelPerfect_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
label1.ForeColor = Color.FromArgb(0, 100, 45);
}
Which results in:
HTH - Daniel.
Do we have a complete documentation on using scripts in pixel perfect report?
I found a better way to apply RGB codes in pixel perfect without using scripts.
In the desired label properties, select foreground dropdown and click on any colors on custom tab.
Then, change the RGB code displayed to the designated RGB colors.