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: 
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Applying RGB codes in Pixel Perfect

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?

clipboard_image_0.png

 

Thanks and regards,

Arthur Fong

Labels (1)
2 Solutions

Accepted Solutions
Daniel_Jenkins
Specialist III
Specialist III

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

clipboard_image_1.png

You can add C# code in the BeforePrint event

clipboard_image_2.png

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:

clipboard_image_4.png

HTH - Daniel.

View solution in original post

Arthur_Fong
Partner - Specialist III
Partner - Specialist III
Author

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.

RGBColor.PNG

View solution in original post

5 Replies
Daniel_Jenkins
Specialist III
Specialist III

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.

 

 

Arthur_Fong
Partner - Specialist III
Partner - Specialist III
Author

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?

Daniel_Jenkins
Specialist III
Specialist III

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

clipboard_image_1.png

You can add C# code in the BeforePrint event

clipboard_image_2.png

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:

clipboard_image_4.png

HTH - Daniel.

Arthur_Fong
Partner - Specialist III
Partner - Specialist III
Author

Do we have a complete documentation on using scripts in pixel perfect report?

 

Arthur_Fong
Partner - Specialist III
Partner - Specialist III
Author

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.

RGBColor.PNG