I want to generate report based on the date fields. In my table there is a 'date' field. When I take it from the database it shows in vertically, I want it should show in horizontally.
for eg.
Code Name 20/8/2009 21/08/2009 22/8/2009 ----> these are col
1001 Pradeep 1 2 3 -->data to show

where in Code, Name and Date there are three fields in my table Person (Code,Name,Date)

How to generate it? Plz help me, its urgent.

Recommended Answers

All 5 Replies

What are you storing in the 'Date' field in your table? The actual date or a number?

What are you storing in the 'Date' field in your table? The actual date or a number?

Hi,
In date field actual date is stored not number. Based on this date I want to show the report horizontally.

In Crystal Reports you can use formulas on various properties of any field. What you can do is, insert text fields for each date column you have, and for each text fields do the following:

Right click, and select 'Format Object'
You will see many buttons that say x-2 besides each attribute of this object. You can basically use any of these depending on your requirement.
Lets use the Font color. Click on the 'Font' tab and the button next to the Color.
Formula workshop window opens up. Here you can write a formula as per your need. You can see all the report fields, database fields above, functions that you can use and operators.
You can simply have a formula like
if (Table_Name.Date = 'whatever date you wanna compare it with')
crBlack
else
crWhite

This will change the color of the object to black if condition is true else it will change it to white making it invisible.

This is just one example of what you can do, you can explore the functions and operators and do whatever you like!

Hope this helps.


Hi,
In date field actual date is stored not number. Based on this date I want to show the report horizontally.

>I want it should show in horizontally.
Yes, It is Cross-Tab report.

>I want it should show in horizontally.
Yes, It is Cross-Tab report.

Hi,
Sir obviously it is cross tab report, but in cross tab u must have to specify summarize option for your total or sum whatever. I don't want any summarization while displaying the record horizontally. I am just giving u how I want to display the data-

Code Name Details 20/6/2009 21/6/2009

1001 Pradeep Remark G-P G-P
InTime 10:00am 10:15am
OutTime 6:00pm 6:00pm

1002 Sunil Remark G-P G-P
InTime 10:00am 10:15am
OutTime 6:00pm 6:00pm

so is it possible to display, plz help me it is taking lot of time. In datagrid it is possible. but there is an requirement in Crystal Report.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.