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
How count not numeric value?
-
- Posts:1
- Joined:Sat Aug 14, 2010 11:35 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
-
- Site Admin
- Posts:110
- Joined:Sun Jul 18, 2010 5:21 pm
- Location:Aalst, Belgium
- Contact:
Re: How count not numeric value?
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:
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:
and 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.
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
Code: Select all
OneIfEquals(TypeOfContact, "Vente")
Code: Select all
OneIfEquals(TypeOfContact, "RAF")
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
http://www.quartam.com
-
- Posts:28
- Joined:Fri Aug 13, 2010 12:26 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: How count not numeric value?
Hi Jan,
Can I expand with my own functions? Where I must save these functions? a stack library like other function and be called inside the field report?
Salut,
Josep
Can I expand with my own functions? Where I must save these functions? a stack library like other function and be called inside the field report?
Salut,
Josep
-
- Site Admin
- Posts:110
- Joined:Sun Jul 18, 2010 5:21 pm
- Location:Aalst, Belgium
- Contact:
Re: How count not numeric value?
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.
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
http://www.quartam.com