Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

How can I debug while scripting on pixelperfect?

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.

7 Replies
Highlighted
Support
Support

Re: How can I debug while scripting on pixelperfect?

Hi @mperezra 

Please provide more clear and specifi detailed information about your requirement. 

  • Step to reproduce your requirement
  • Expected results
  • Actual results
  • And additional information you can provide to clarify your requirement.

Kind regards...

 

We are just 'like' you & like to be liked when we provide a helpful answer and or when you press the 'Solution Accepted' button if an answer provided resolves your question or issue... Cheers!
Highlighted
Employee
Employee

Re: How can I debug while scripting on pixelperfect?

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



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Highlighted
Partner
Partner

Re: How can I debug while scripting on pixelperfect?

I am using pixel perfect report, and I have this table:

1.PNG

With this result:

4.png

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.

2.png

 

This creates a new function in Scripts:

3.png

 

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.

Highlighted
Employee
Employee

Re: How can I debug while scripting on pixelperfect?

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):

Condition Editor.png

When the condition is met you set Visible to No:

Visible.png

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Highlighted
Partner
Partner

Re: How can I debug while scripting on pixelperfect?

I use Formatting Rules in others sections, and works fine, but in this case, it doesn't work

1.png

 

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.

Highlighted
Employee
Employee

Re: How can I debug while scripting on pixelperfect?

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



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Highlighted
Partner
Partner

Re: How can I debug while scripting on pixelperfect?

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