By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,660 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,660 IT Pros & Developers. It's quick & easy.

Update a field in a crystal report at run time

P: n/a
Hi,

I made a crystal report which contains a text field of empty value. I want
to know how to fill this field at the run time by a variable. Andbody give a
hand?

Thank in advance
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies

P: n/a
Create a parameter, then create a formula that passes the value from that
parameter into the text field.
Or
Drag the parameter onto the CR and when the report runs have a formula that
controls when the parameter supressed.
Or
If you are getting you data from a dataset just drag that field onto the
report.

http://www.wizkil-webs.net/NET/DotNe...pt_Samples.htm

Hope one of those helped.
BrianDH
"Li Pang" wrote:
Hi,

I made a crystal report which contains a text field of empty value. I want
to know how to fill this field at the run time by a variable. Andbody give a
hand?

Thank in advance

Nov 21 '05 #2

P: n/a
Instead of using a blank text field, use a parameter field. Create a
parameter in your report, and then place it on your report. To pass a value
into the parameter, see if this helps:
"Li Pang" <Li****@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.com...
Hi,

I made a crystal report which contains a text field of empty value. I want
to know how to fill this field at the run time by a variable. Andbody give a hand?

Thank in advance

Nov 21 '05 #3

P: n/a
Sorry about that--

see if this helps:
http://blogs.aspadvice.com/rjdudley/...2/21/2737.aspx
"Li Pang" <Li****@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.com...
Hi,

I made a crystal report which contains a text field of empty value. I want
to know how to fill this field at the run time by a variable. Andbody give a hand?

Thank in advance

Nov 21 '05 #4

P: n/a
Code example using a parameter thats been placed on the report.
///
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

Dim crReportDocument As New ReportName
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue

crParameterFieldDefinitions =
crReportDocument.DataDefinition.ParameterFields()
crParameterDiscreteValue = New ParameterDiscreteValue
crParameterFieldDefinition = crParameterFieldDefinitions.Item(0)
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterDiscreteValue.Value = "Pass Value Here"
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crPa rameterValues)

CrystalReportViewer1.ReportSource = crReportDocument
CrystalReportViewer1.Visible = True
\\\
"Li Pang" wrote:
Hi,

I made a crystal report which contains a text field of empty value. I want
to know how to fill this field at the run time by a variable. Andbody give a
hand?

Thank in advance

Nov 21 '05 #5

P: n/a
BrianDH & Richard Dudley,

Thanks for your helps. It works fine by using parameters in CR.

Li

"Li Pang" wrote:
Hi,

I made a crystal report which contains a text field of empty value. I want
to know how to fill this field at the run time by a variable. Andbody give a
hand?

Thank in advance

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.