cancel
Showing results for 
Search instead for 
Did you mean: 

Get FieldObject Value

Former Member
0 Kudos

Hello,

I'd like to know how i can get a fieldobject value in a CR with VS 2008 ?

Of course, there is an error fldObject.Value does not exist.

My code sample :

For Each rptobject As ReportObject In cr.ReportDefinition.ReportObjects

Select Case rptobject.Kind.ToString

Case "FieldObject"

Dim fldObject As FieldObject = rptobject

If fldObject.Name.StartsWith("Avance") Then

If Not String.IsNullOrEmpty(fldObject.Value) Then

If IsNumeric(fldObject.Value) Then

Dim taux As Int32 = CType(fldObject.DataSource.Name, Int32)

taux = taux / 100

Dim taille As Int32 = fldObject.Width * taux

fldObject.Width = taille

End If

End If

End If

End Select

Next

Thanks per advance

Eric

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Eric;

This approach will not work, as you cannot have a field be a different width for each record. As far as the report is concerned, the field has one width, and that would be constant throughout.

Regards,

Jonathan

Answers (1)

Answers (1)

former_member208657
Active Contributor
0 Kudos

What is the actual problem you are trying to solve? As Jon mentioned you can't change the width of a field on a per record basis. Why not just make the width of the field wide enough for all possible data?