on 04-21-2014 10:35 AM
Hi,
Hope anybody can help.
After upgrading to Crystal Reports for .NET 4.0 (CRforVS 13_0_0.exe) from Crystal Reports for Visual Studio 2005, the reports cannot filter on datetime Types anymore from Visual Studio. The reports works fine, when parameters are entered through the "Main Report Preview", but when provide from Visual Studio it does not filter.
I have tried to use different ways to send the Start end End value to the report, but with no help. When I filter e.g. on a simple string value on a string type field sending the values works fine. I have tried changing the format of the datatime values send, but all with no luck.
The database looks like this
.....
QueueID varchar(50)
QueueStartAt DateTime
....
Filter in Report looks like this
{EM_T_STATISTICS_SOFTQUEUE.QueueStartAt} in {?StartDate] to {?EndDate]
my Code looks like this:
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim objRpt As New TVSoftQueueReporter.test
'crParameterDiscreteValue.Value = Format(PeriodeStart, "yyyy-MM-dd 00:00:00")
'crParameterDiscreteValue.Value = Format(PeriodeStart, "dd-MM-yyyy 00:00:00")
crParameterDiscreteValue.Value = PeriodeStart
crParameterFieldDefinitions = objRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("StartDate")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
'crParameterDiscreteValue.Value = Format(PeriodeStop, "yyyy-MM-dd 23:59:59")
'crParameterDiscreteValue.Value = Format(PeriodeStop, "dd-MM-yyyy 23:59:59")
crParameterDiscreteValue.Value = PeriodeStop
crParameterFieldDefinitions = objRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("EndDate")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
CrystalReportViewer1.ReportSource = objRpt
CrystalReportViewer1.Refresh()
Any idea, could this really be a bug?
Hi Keld,
Try the sample 'vbnet_web_rangeparams.zip' from below samples collection.
https://smpdl.sap-ag.de/~sapidp/012002523100006252812008E/net_web_smpl.exe
use the code and develop a new app with CR 13 references.
Also, upgrade to SP9. You are currently using base build and there have been many issues fixed till SP9.
http://scn.sap.com/docs/DOC-7824
- Bhushan
Senior Engineer
SAP Active Global Support
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Getting started and moving ahead with Crystal Reports .NET applications.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhushan,
I tried the code with no luck. I even changed to removing the DataTime paramers to just use a simple string value with an Equal to function. Surprisingly it did not work!
I tried several ways to set the parameters with no luck at all. I then tried to make a new report just filtering on a String value with an Equal to Function. And that worked. Then I removed the parameter from the Selection and deleted the parameter, then I created a parameter with exactly the same name and added it as a filter.
The I got the problem it will not use a parameter passed!
Here is a picture showing the code and the value is there runtime.
Any Ideas?
Best regards
Keld
No body has anything on this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.