Crystal Reports Problem

DeBiese

New member
Joined
Apr 24, 2005
Messages
4
Programming Experience
Beginner
Hi,
Is there anyone who knows how to do a replace (Replace(string, string)) on a databasefield in crystal reports when the report is being made?
The databasefield contains a string value that needs to be replaced by another value of a databasefield depending on which fields are queried...
Example:
Field 1: "This is just an example of {something}"
Field 2: "my problem"
{something} needs to be replaced with the value in field 2.

I'm looking to do this on the vb.net side.
I've read somewhere there is a format event of each section in crystal reports that should be accessible in vb. I haven't found though how to do it.

Example:
Private Sub DetailSection1_Format(ByVal pFormattingInfo as Object)
<code>
End Sub

Anyone an idea?
 

DavidT_macktool

Well-known member
Joined
Oct 21, 2004
Messages
502
Location
Indiana
Programming Experience
3-5
Examples of pushing data to a Crystal Report

This is an example of how to set a Parameter used in a Crystal Report:
The Parameter is "Quantity" in the report. "iShopNumqty" is an integer variable.

Dim TestRpt As New rptTest1 'Use the Crystal Report Name

Dim QuantityFields As New CrystalDecisions.Shared.ParameterFields
Dim QuantityField As New CrystalDecisions.Shared.ParameterField
Dim QuantityVal As New CrystalDecisions.Shared.ParameterDiscreteValue
QuantityField.ParameterFieldName = "Quantity"
QuantityVal.Value = iShopNumqty
QuantityField.CurrentValues.Add(QuantityVal)
QuantityFields.Add(QuantityField)
TestRpt.SetParameterValue("Quantity", iShopNumqty)

This is an example of how to set a text object in a crystal report:
the text object is "txtContact" in the report. "tCPOContact" is a string variable.

Dim TestRpt As New rptTest1 'Use the Crystal Report Name

Dim ContactText As CrystalDecisions.CrystalReports.Engine.TextObject
ContactText = CType(TestRpt.ReportDefinition.ReportObjects.Item("txtContact"), CrystalDecisions.CrystalReports.Engine.TextObject)
ContactText.Text = tCPOContact


hope this helps,
 
Top Bottom