Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print summary in report
Message
De
08/10/2003 09:09:40
 
 
À
08/10/2003 08:31:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00836084
Message ID:
00836168
Vues:
8
>hi gregory,
>
>my question is this: how am i supposed to put all the fields in my report if in fact i don't know the fields (the fields will depend on the leaves of each employee)
>
>how do i do that?

Evelyn,

What do you mean ?

I've made two possible solutions as a starting point. Have a look at them and see whether the output from the cursor can be used for a report.

You may like the second solution better (grp 0 is detail per month, grp 1 is summary per month)
function do_it()

	create cursor test ;
	(	tt_date	D	default {}, ;
		tt_emp	I	default 0, ;
		tt_leave	c(1)	default '' ;
	)
	
	insert into test values({^2003/05/01}, 1, 'V')
	insert into test values({^2003/05/07}, 1, '')
	insert into test values({^2003/05/08}, 1, 'T')
	insert into test values({^2003/05/09}, 1, 'T')
	insert into test values({^2003/05/11}, 1, 'V')
	insert into test values({^2003/05/12}, 1, 'V')
	insert into test values({^2003/05/13}, 1, 'S')
	
	select	tt_emp		as	emp_, ;
		year(tt_date)	as	year_, ;
		month(tt_date)	as	month_, ;
		day(tt_date)	as	day_, ;
		tt_leave	as	leave_, ;
		$1		as	count_ ;
	    from test ;
	    into cursor ReportCursor1 ;
	union all ;
	select	tt_emp		as	emp_, ;
		year(tt_date)	as	year_, ;
		month(tt_date)	as	month_, ;
		99		as	day_, ;
		tt_leave	as	leave_, ;
		ntom(count(*))	as	count_ ;
	    from test ;
	    group by 1,2,3,4,5 ;
        order by 1,2,3,4 && ,5
	
	browse
	
	&&report ...
	
	&& or
	select	tt_emp		as	emp_, ;
		year(tt_date)	as	year_, ;
		month(tt_date)	as	month_, ;
		0		as	grp, ;
		day(tt_date)	as	day_, ;
		tt_leave	as	leave_, ;
		$1		as	count_ ;
	    from test ;
	    into cursor ReportCursor2 ;
	union all ;
	select	tt_emp		as	emp_, ;
		year(tt_date)	as	year_, ;
		month(tt_date)	as	month_, ;
		1		as	grp, ;
		0		as	day_, ;
		tt_leave	as	leave_, ;
		ntom(count(*))	as	count_ ;
	    from test ;
	    group by 1,2,3,4,5,6 ;
        order by 1,2,3,4,5 && ,6
	
	browse
endfunc
*---------------------------------------------------------------------------
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform