Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts

Thursday, March 29, 2012

Count records manually

Hi everyone, I'm a newbie with this Crystal Reports thing and I was wondering if there is anyone who can help me.

My table has a field named obsolete, depending on the type of "obsolete" I would like to count the number of ocurrencies in my table.

I know I could do this by grouping the field but, I need to group with other 4 fields and I've tried it like that but I guess that the only way that I'll be able to retrieve the data the way I want it is manually. So, is there any if statement or while statement that I could use?

Thanx for any repliesI guess you could try to use if statements in suppressed formulas (look up information on running totals in CR).

I had a similar requirement and found it easier to decode the values in my view (I'm using Oracle PL/SQL).

decode(classId,1,trafficcount,0) class_1,
decode(classId,2,trafficcount,0) class_2,

Ie. If the classId is 1, put the trafficcount in column called class_1, else put 0.|||Thanx for your reply kristyw. Im using informix, I'm not quite sure I can use the decode function, or is it a CR function?

Count of no. of characters

Hi,
Could anyone please let me know how many characters can we display in a single row in Crystal Report XI?
Thanks.It depends on the size of the page. Can you give us more informations on what you are trying to do

Tuesday, March 27, 2012

Count of criteria like Male and Female in One field data

Hi,

Please solve this problem using instead of subreport in Crystal Reports

I think using only running filed.
My Porblem is .......

In One field data has Male and Female in different rows ( in different dates)
I want calculate the count of Male and female
Here we are using database is in Access.

Display Format is

Date count of Male Count of Female

Here i want display the count of male or female depend on data ( so Date is group field)

Please Help me......Hi,

You could create a formula to your report as follows. This should be placed in the details section.

shared numbervar cntfem;
shared numbervar cntmale;

If {table.field} = 'Male' Then
cntmale := cntmale + 1;

If {table.field} = 'Female' Then
cntfem := cntfem + 1;

Create a formula for both male and female in the summary section showing the results

e.g. formula male
shared numbervar cntmale;

and forula female
shared numbervar cntfem;

If you are not interested in the grand total, but a sub total use a function to clear clear the count at a section header. Use the supress property on the function to prevent it from printing on your report.

shared numbervar cntfem := 0;
shared numbervar cntmale := 0;

This works if you are displaying the detailed data in your report, i.e. you dont have a query like
select c, d, sum(a), sum(b)
from table
group by c, d

- Jukkasql