Print Page | Close Window

Select Expert Formula as Field

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=13540
Printed Date: 02 May 2025 at 12:30pm


Topic: Select Expert Formula as Field
Posted By: bokasen
Subject: Select Expert Formula as Field
Date Posted: 19 Jun 2011 at 5:34pm
Hi,

I am new in Crystal (8.5) and would like to know how to do the following:

I have created a formula in Report-->Select Expert, a date range (from/to) to pull out data from database and it is working well.

However, I would like to use the date range in select expert to be printed in my report's header that says,

Period Covered: 01-May-2011 to 31-May-2011

How do i do this?

Your help is highly appreciated.

Thanks.



Replies:
Posted By: Dewald
Date Posted: 19 Jun 2011 at 11:50pm
create 2 formulas.
1. FromDate :  minimum(DateParameter)
2. ToDate: Maximum(DateParameter)
 
Drag them to a text box on your report.


-------------
Dewald Botha
http://www.ITClarity.co.za


Posted By: bokasen
Date Posted: 20 Jun 2011 at 2:51pm
Hi Dewald,

Thanks for you help. It works like magic for neophyte like me.



Posted By: bokasen
Date Posted: 20 Jun 2011 at 3:28pm
Hi Dewald,

I noticed that my actual records only contain say data from 02 May 2011 to 30 May 2011 but i want to show it on my report header the following:

Period Covered: 01-May-2011 to 31-May-2011

The formula you'd given me returns 02-May-2011 to 30-May-2011 which is correct as far as the records in the database.

But is there a way where it will show 1-May-2011 instead of 02-May-2011 and 31-May-2011 instead of 30-May-2011 regardless of the actual records in the database?

This is just to avoid confusing the user of the report with regard to actual data period pulled out from the db.

Thanks again.


Posted By: Dewald
Date Posted: 20 Jun 2011 at 8:23pm
Once you have placed the formula on the report, you can right click and choose format field. You can chenge it there.


-------------
Dewald Botha
http://www.ITClarity.co.za



Print Page | Close Window