Sunday, February 19, 2012
display records row wise
I am facing a problem in the crystal reports 8.5
In the database table one column is date ,
so here in my report i want to display the records in such a way that
the for every date there should be one colum like for 31 days there should the date in all 31 day
for example please refer the attachment
or see below the requirement is
in my example the records with the days like 21,22
which is diplaying in next to row of the 21 day but i want to show in the same row i.e side by side not in the next row
please any query please pass it so that i can explain you in more detail
urgentplz any one help me|||Maybe you can do this with a crosstab - no idea as I've never used them.
So, although there may be better ways the one I instantly thought of is:
Assuming you are grouping by month:
Create/initialise an array of 31 elements in the group header.
For each detail, add the value into the appropriate array element.
Display each element in its appropriate position in the footer, under its day number.
For completeness you could also suppress any day number heading if > number of days in the month.|||thanks for reply
But i had created with standard report.
but one more issue in this if i take in footer it will display only one record
how can i resolve this|||Don't know what you mean by "But i had created with standard report."
Anyway, if I understand correctly what you really want is for each detail line to be printed but for the 'RT' etc. values to be under the correct day number heading.
Maybe you could left-pad the 'RT' string with a number of spaces dependent on the day number, e.g.
ReplicateString (' ', ({day}-1) * n ) + {table.column}
where n makes the 'RT' text line up underneath the day number heading for any given day number assuming you have n characters between the start of each day number.
(Best to use Courier font or similar, rather than Ariel...)|||Dont use standard report. Use Cross tab option. See help file for more information
Friday, February 17, 2012
Display null values
Hello,
I'm facing a problem in my reporting.
I have a Customer table where is record various events like CustomerEventId, DateTime, StatusId, StatusTime, GroupId, ...
I also have a status table (Id, Description) and a group table (Id, Description).
I want to create a report where for a selected date range (From ... To ...) i can see (grouped by date) all status's the customer
went in. The possible status are :
Id Description
-
1 status 1
2 status 2
3 status 3
4 status 4
My query looks something like this :
SELECT CustomerEventId, DateTime, CONVERT(varchar, DateTime), 103) AS DATEVAL, StatusId,
status.description as StatusDescription, StatusTime, GroupId, group.Description as GroupDescription
From Customers inner join status on customers.StatusId = status.id
inner join group on customers.GroupId = group.id
Group By CustomerEventId, DateTime, StatusId, status.description, StatusTime, GroupId, group.Description
My reports has 3 parameters (From date, To date, Group)
In my report i have a table with two groups : GroupByDate (grouped on DATEVAL) and GroupByStatus
now my problem : let's say i have values for statusid 1,2 and 4
then my report will only display those 3 status.
How can i display the status where there is no data for :
now it shows :
DATEVAL Occurrences Time
01/07/2007
Status 1 15 125
Status 2 25 366
Status 4 8 66
I would like it to show:
DATEVAL Occurrences Time
01/07/2007
Status 1 15 125
Status 2 25 366
Status 3 0 0
Status 4 8 66
Anybody (i hope i have provide enough details ...)
Vinnie
Hello Vinnie,
You're going to need to modify your dataset to return those records (in your example data, "Status 3") with NULL for the rest of the values. Then you can replace the NULL's with 0, either in your SQL query or in the table.
Use an outer join to get all the status records back whether or not there are matching customer records. Something like this:
SELECT CustomerEventId, DateTime, CONVERT(varchar, DateTime), 103) AS DATEVAL, StatusId,
status.description as StatusDescription, StatusTime, GroupId, group.Description as GroupDescription
From Customers
inner join group on customers.GroupId = group.id
right outer join status on customers.StatusId = status.id
Group By CustomerEventId, DateTime, StatusId, status.description, StatusTime, GroupId, group.Description
Hope this helps.
Jarret