Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Selection (Need to Display Calendar) 2

Status
Not open for further replies.

brxmas

Programmer
Feb 9, 2004
69
US
SQL Server 2000
Crystal Reports 9.0

I have a Crystal report using the following parameters:

Year
Period
start_date
end_date

When creating the start_date parameter - how can I display the calendar so the user can select the date? There is a period_dates table in the database.

I appreciate any help. Thanks in advance.
 
I believe the calendar will automatically be available for the parameter selection if you set the parameter datatype as date.

-LB
 
LB

I really appreicate your help, but there is a table in the database that we use for 544 a period calendar. Users need to be able to see the Period Calendar to select date criteria from. See example below:

Period 9 - September
start_date = 08.29.2005 = Default Calendar 08.28.2005
end_date = 09.25.2005

start_dateLY = 08.30.2004
end_dateLY = 09.26.2004

Is there a way that I can show our Period Calendar not the default calendar.

Thanks again for your help.

BC
 
I'm not aware of any way to do this, but someone else might know of a way. This question might get a better response in the CR Integrate forum.

-LB
 
LB,

How do I access the CR Integrate Forum?

Thanks again.

BC
 
Funny old thing but I have (had) a similar problem where I wanted the user to be able to select an Accounting Period (AP) using a simple parameter, my solution is as follows - 3 steps;

1. I created a formula along the lines of;
StringVar:=ap
If {date}> DateTime(yyyy,mm,dd,hh,mm,ss) And {date}< DateTime(yyyy,mm,dd,hh,mm,ss) Then ap = "AP01";

repeat this line for each period.

drag this formula onto the report and suppress it.

(I did it this way as the last period (AP12) ends on the 31st of march so I couldn't use some fancy formula to take date ranges from (say) the first Monday to the last Sunday - unless someone would like to show me)).

2. I then created a Parameter (ie called accperiod) and typed in each description; AP01 - Apr 05, AP02 - May 05 etc.

3. Now use the (can't remember what it's called)-selector and create a new ?, select the formula created in step 1 and make it equal to the parameter created in step 2. When the report is refreshed the user will see a parameter and the dropdown will contain the options entered at step 2.

This is my first pass at a solution and has 2 obvious flaws; it's only good for the date duration set in step 1 (ie it will have to be maintained in the future) and, if you make an error in setting the 'To' and 'From' dates the report will be corrupt, so if anyone else has a slicker method (there must be) I'd also be grateful to hear of it. Note; I've done this from memory (I'm at home Crystal is at work!) so forgive the errors - I'm sure you've got the drift of what I'm doing.
 
Sarpal1,

Thanks, I'll try the information you provided and let you know the outcome.

I appreciate your quick response.

BC
 
Sarpal1,

I created my variable and did the following:

StringVar:=ap
If {date}> DateTime(yyyy,mm,dd,hh,mm,ss) And {date}< DateTime(yyyy,mm,dd,hh,mm,ss) Then ap = "AP01";

I get an error after DateTime(yyyy,mm,dd,hh,mm,dd)it gives me a message: The )is missing

Thanks.

-BC
 
Sorry for taking so long to reply APB, the full formula should look something like this;

StringVar accountingperiod;
If{tppin020.sidt} < DateTime (2005,08,29,00,00,00) Then accountingperiod := "Too early";
If{tppin020.sidt} > DateTime (2005,08,29,00,00,00) and {tppin020.sidt} < DateTime (2005,09,25,23,59,59) Then accountingperiod := "AP06 - Sep 05";

Where {tppin020.sidt} is your field and repeat the "If" for each period. I included the first line to remove errors generated by periods earlier than now. By the way the " I can't remember" bit was the Select Expert (duh!).

Hope this explains it more clearly - if not, let me know.

Paul
 
Just found a link to this site whilst surfing here. With some engineering of a couple of his formulae it may be possible to produce a dynamic AP range (first Monday to last Sunday) so there would be no need to hand code ranges.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top