|
-
Sep 16th, 2003, 09:55 PM
#1
Thread Starter
Addicted Member
Display in crystal report values inputted by user [RESOLVED]
Hi all,
In my form, I am passing range of values to be passed to a dataset as recordsource to my crystal report.
In my report, I wanted to get those range of values (date) and display them.
For example, if the user inputs
From date : 09/15/2003
To date : 09/30/2003
I want those values displayed in my report.
How can I do that?
Many thanks.
Last edited by Marivic; Sep 17th, 2003 at 01:01 AM.
-
Sep 17th, 2003, 12:57 AM
#2
Thread Starter
Addicted Member
Display in crystal report values inputted by user[RESOLVED]
For those who are interested:
I used the parameter collection and passed them to crystal.
-
Sep 18th, 2003, 01:49 PM
#3
Lively Member
Marivic,
Can you post how you did that? I'm trying to do the same thing & struggling to figure it out.
Thanks
-
Sep 18th, 2003, 10:11 PM
#4
Thread Starter
Addicted Member
First, in your crystal report, define the parameter that would accept the value you are passing.
then in your code:
Code:
' Objects used to set the parameters in the report
Dim pvCollection As New ParameterValues()
Dim pdvFromDate As New ParameterDiscreteValue()
Dim pdvToDate As New ParameterDiscreteValue()
' Set the discreet value
pdvFromDate.Value = dtpfrom.Value.ToShortDateString
pdvToDate.Value = dtpto.Value.ToShortDateString
' Add it to the parameter collection.
pvCollection.Add(pdvFromDate)
pvCollection.Add(pdvToDate)
oRpt.DataDefinition.ParameterFields("@fromdate").ApplyCurrentValues(pvCollection)
oRpt.DataDefinition.ParameterFields("@todate").ApplyCurrentValues(pvCollection)
HTH
-
Nov 15th, 2003, 12:55 PM
#5
Frenzied Member
I get an invalid field name errror on this line:
VB Code:
rpt.DataDefinition.ParameterFields("@beginDate").ApplyCurrentValues(pvCollection)
I changed the code around little bit.
VB Code:
Dim pvCollection As New ParameterValues()
Dim pdvFromDate As New ParameterDiscreteValue()
Dim pdvToDate As New ParameterDiscreteValue()
' Set the discreet value
pdvFromDate.Value = tranPeriodEnd.ToShortDateString
pdvToDate.Value = tranPeriod.ToShortDateString
' Add it to the parameter collection.
pvCollection.Add(pdvFromDate)
pvCollection.Add(pdvToDate)
rpt.DataDefinition.ParameterFields("@beginDate").ApplyCurrentValues(pvCollection)
rpt.DataDefinition.ParameterFields("@endDate").ApplyCurrentValues(pvCollection)
It's tough being an unhandled exception...
___________
VB.NET 2008
VB.NET 2010
ORACLE 11g
CRYSTAL 11
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
|