Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys, I am trying to write some scripts in Nprinting pixel perfect, and I have the beforePrint function:
private void Tabla_Detalle_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
}
I need to know the content of "sender" and "e", is there any way to get it?
Thanks.
Hi @mperezra
Please provide more clear and specifi detailed information about your requirement.
Kind regards...
Hi,
Your request is completely clear to me and, unfortunately, not there is not a way to debug PixelPerfect scripts in the Qlik NPrinting Designer.
In case of errors during a PixelPerfect report preview you will see error messages on the screen.
Best Regards,
Ruggero
I am using pixel perfect report, and I have this table:
With this result:
In some cases, [Imp_menor_a_003] (the red square, that label is a cell with data that I have in Qlik Sense) is zero, so I want to hide all the ReportFooter band in this cases, cause I generate the report evey 15 days with different data.
For this, I want to use Scripts, so I click on "new" in Before print section.
This creates a new function in Scripts:
At this point, I want to know the content of Object "sender" and "e", is there any way to do that?
Thanks so much for your reply.
Hi,
So, I think you don't need a script to conditionally hide that ReportFooter.
First, the ReportFooter is the footer of the whole report, instead in your template it is used as a GroupFooter. So first of all I suggest to remove the ReportFooter and replace with the related GroupFooter.
Then the field [Imp_menor_a_003] is a percentage so it is calculated as [Num]/[Den] to be correct in the footer. [Imp_menor_a_003] will be 0 only if Num is zero. You could add a formatting rule to the GroupFooter band with a condition that checks if the Num is zero (all fields used in the Condition must be part of the Level where the formatting rule is applied):
When the condition is met you set Visible to No:
Best Regards,
Ruggero
I use Formatting Rules in others sections, and works fine, but in this case, it doesn't work
And I want to learn how scripts works, for use it in another reports.
There are any function to pop up a text, msgBox or something similar?
Thanks and regards.
Hi,
You are still using a ReportFooter in a place where a GroupFooter is required. I don't know if this generates a different value of the percentage.
Be sure that the comparison is done with two equals symbols ==. I cannot see if they are two or one in the screenshot.
I saw the 0 in previous screenshot but be sure it is 0 and not 0.something.
A message box or similar is a nonsense in a template. Qlik NPrinting will create reports by using server process, without a graphical user interface. If you need to see the results to check them I suggest to place a cell in the template and remove it when you are ok.
In general developing scripts is a long and complex process, so I suggest to use built in features when they are available.
Best Regards,
Ruggero
In last screenshot I changed from a ReportFooter to GroupFooter , the formating rule should use only one "=", its working in other sections of my report. I will try to verify that my cell is 0 exactly.
Thanks for your replies.
Regards