|
-
Oct 19th, 2006, 06:33 AM
#1
Thread Starter
Hyperactive Member
Date Parameter
Hi I hope this is the correct forum....
I have created a report on Visual Studio .Net 2003 (using report wizard) atttached to SQL Server 2000. Everything fine, and the report returns the data required...
The report has paramters including a dateto and datefrom.... can I introduce a calendar/datepicker or such control so that the format of the dates will always be correct?
Or any other ideas on how i should do this???
Thanks
-
Oct 19th, 2006, 08:04 AM
#2
Frenzied Member
Re: Date Parameter
Can you just use the Format Editor?...right click on the object.
It's tough being an unhandled exception...
___________
VB.NET 2008
VB.NET 2010
ORACLE 11g
CRYSTAL 11
-
Oct 19th, 2006, 08:22 AM
#3
Thread Starter
Hyperactive Member
Re: Date Parameter
 Originally Posted by EyeTalion
Can you just use the Format Editor?...right click on the object.
im soz... i dun get what u are sayin.... maybe I didnt explain properly... I dun have the control... thas what im askin for?!
I can go to report parameters but that does not have anything important for this case!....
-
Oct 19th, 2006, 08:30 AM
#4
Frenzied Member
Re: Date Parameter
Where is your date coming from? If it's coming from the database, place the field on the report and you can use the Format Editor to format it the way you like. If you need the user to input the dates, use the Parameter Field and you'll still have the ability to format the way you need..
It's tough being an unhandled exception...
___________
VB.NET 2008
VB.NET 2010
ORACLE 11g
CRYSTAL 11
-
Oct 19th, 2006, 08:40 AM
#5
Thread Starter
Hyperactive Member
Re: Date Parameter
The user has to enter a start date and end date which are used in the "where" clause of my SQL query.... instead of having a textbox appear (where the user enters the date) I would like a DateTimePicker item appear, so the user has to select a date from a calendar.... is that possible?!
I still dont really think you understand what I'm sayin - or I dont understand ur answer!!
thanks....
-
Oct 19th, 2006, 01:01 PM
#6
Frenzied Member
Re: Date Parameter
How about this? I'm assuming the report is embedded in a .NET app. Place two calendar controls on a form. Call one StartDate and the other endDate. Have the user select the two dates and then save them to a variable. Then use those variables in your SQL statement...then execute your report....hope this helps.
It's tough being an unhandled exception...
___________
VB.NET 2008
VB.NET 2010
ORACLE 11g
CRYSTAL 11
-
Oct 20th, 2006, 04:42 AM
#7
Thread Starter
Hyperactive Member
Re: Date Parameter
 Originally Posted by EyeTalion
How about this? I'm assuming the report is embedded in a .NET app. Place two calendar controls on a form. Call one StartDate and the other endDate. Have the user select the two dates and then save them to a variable. Then use those variables in your SQL statement...then execute your report....hope this helps.
Thanks Sounds like a good idea...any idea how I would send the two parameters to the date?!
thanks
-
Oct 20th, 2006, 04:45 AM
#8
Re: Date Parameter
 Originally Posted by pame1la
Thanks  Sounds like a good idea...any idea how I would send the two parameters to the date?!
thanks
Do you want to get the value between date
-
Oct 20th, 2006, 05:44 AM
#9
Thread Starter
Hyperactive Member
Re: Date Parameter
 Originally Posted by shakti5385
Do you want to get the value between date
No I need the DateTo and DateFrom for my query when creating the report, the report can create its own parameters, BUT i want the user to select the date from DateTimepicker control, and not enter it (like it does currently)...so that I can ensure date format is correct...
I tried creating a form which has 2 datetimepicker and entered them into a dataset, but don't know how to set them in the report as the parameters
-
Oct 20th, 2006, 06:12 AM
#10
Re: Date Parameter
VB Code:
Dim S As String
S = "{Table.DateField}>=date( " & DTPicker1.Year & "," & DTPicker1.Month & "," & DTPicker1.Day & ") And {Table.DateField}<= date(" & DTPicker2.Year & "," & DTPicker2.Month & "," & DTPicker2.Day & ")"
With CrystalReport1
.ReportFileName = App.Path & "\ReportName.rpt"
.SelectionFormula S
.Action = 1 'Will Show The Report
End With
Check the value of the S , I am passing here as a crystal report formula
-
Oct 23rd, 2006, 06:24 AM
#11
Thread Starter
Hyperactive Member
Re: Date Parameter
 Originally Posted by shakti5385
VB Code:
Dim S As String
S = "{Table.DateField}>=date( " & DTPicker1.Year & "," & DTPicker1.Month & "," & DTPicker1.Day & ") And {Table.DateField}<= date(" & DTPicker2.Year & "," & DTPicker2.Month & "," & DTPicker2.Day & ")"
With CrystalReport1
.ReportFileName = App.Path & "\ReportName.rpt"
.SelectionFormula S
.Action = 1 'Will Show The Report
End With
Check the value of the S , I am passing here as a crystal report formula
Soz for late reply, been away!!! Did I not mention, I am using SQL Server Reporting Services, and using Visual Studio .Net 2003 to create the report... I am not using crystal reports....
Any more ideas?!
Thanks
-
Oct 23rd, 2006, 06:59 AM
#12
Re: Date Parameter
Then what is the problem
can you post the problem so the it i easy to other for understand
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|