How count not numeric value?

Whether you're using the Standard or Professional Edition of Quartam Reports, this is the place to ask general questions about using this industry-level reporting tool for LiveCode.
Post Reply
Eric Debrosse
Posts: 1
Joined: Sat Aug 14, 2010 11:35 am

How count not numeric value?

Post by Eric Debrosse » Mon Oct 11, 2010 7:28 am

Hi,

I have two problems in my report projet
First
Is it possible to count not data numéric.
In my report i have string data and numéric like that

Name Contact Type of contact
xxxx Visite Vente
AAAA Visite RAF

Total Vente :
Total RAF :

I would like :
i would like the number of "visite" = "vente" or RAF ………

I don't know to do that. Jan, have you exemples with conditions?

Second
when i print my report the margins is not good. Text is troncate.

Best regards

JanSchenkel
Site Admin
Posts: 110
Joined: Sun Jul 18, 2010 5:21 pm
Location: Aalst, Belgium
Contact:

Re: How count not numeric value?

Post by JanSchenkel » Mon Oct 11, 2010 9:04 pm

Hi Eric,

Let's start with your 'count' question. The first solution I can think of, is to define a helper function in another library stack or backscript:

Code: Select all

function OneIfEquals pCompareWhat, pCompareTo
  if pCompareWhat is pCompareTo
  then return 1
  else return 0
end OneIfEquals

Then you can use this helper function to track the total for each distinct group. Assuming that the 'Type of contact' is a column 'TypeOfContact' in a database cursor, you would then place two fields in the report summary band:

Code: Select all

OneIfEquals(TypeOfContact, "Vente")
and

Code: Select all

OneIfEquals(TypeOfContact, "RAF")
And set the Aggregate function to 'Sum' - leaving the reset at 'End of report'

As for your second question, on which operating system does this happen (Windows, MacOSX, Linux) and which version of Revolution/LiveCode ?
Does the truncate also happen in the on-screen preview, or only when printing?

Jan Schenkel.
Quartam Developer Tools for LiveCode
http://www.quartam.com

JosepM
Posts: 28
Joined: Fri Aug 13, 2010 12:26 am

Re: How count not numeric value?

Post by JosepM » Thu Feb 24, 2011 8:32 pm

Hi Jan,

Can I expand with my own functions? :shock: Where I must save these functions? a stack library like other function and be called inside the field report?

Salut,
Josep

JanSchenkel
Site Admin
Posts: 110
Joined: Sun Jul 18, 2010 5:21 pm
Location: Aalst, Belgium
Contact:

Re: How count not numeric value?

Post by JanSchenkel » Fri Feb 25, 2011 6:08 am

Hi Josep,

You can use just about any custom function, as long as it is 'behind' the qrtReportsLib stack in the message path - and as qrtReportsLib is a library stack, this means your custom function should be part of the stack script of another stack that you load as a library by means of the start using command, or part of the script of an object that you add to the backscripts by means of the insert script command.
The message path can be a truly wonderful thing :-)

HTH,

Jan Schenkel.
Quartam Developer Tools for LiveCode
http://www.quartam.com

Post Reply