Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Position at Run Time

Status
Not open for further replies.

dabineri

Programmer
Jun 20, 2001
265
US
I am using VB6 and CR9.
Is it possible to set the position of a field on the report at run time by somehow specifying the x and y coordinates of the field box? In other words, can I give the user the option as to where a field will appear on the final report?

Thanks for any advice on this topic.

David Abineri

 
Using the RDC, you can set the Width, Top, Left, etc. of any field on the report. For example:
Code:
[COLOR=green]'Set the {Product.Product ID} in the Details section's _
   Top and Left to 0 and 10, respectively[/color]
Dim crxSection As CRAXDRT.Section
Dim crxFieldObject As CRAXDRT.FieldObject
Set crxSection = Report.Sections("D")
For i = 1 To crxSection.ReportObjects.Count
    Select Case crxSection.ReportObjects(i).Kind
        Case crFieldObject
            Set crxFieldObject = crxSection.ReportObjects(i)
            With crxFieldObject
                Select Case .Field.Name
                    Case "{Product.Product ID}"
                        .Top = 0
                        .Left = 10
                End Select
            End With
            Set crxFieldObject = Nothing
    End Select
Next i
-dave
 
Dave, Thanks for this, it looks like what I need.

What units are being used for .Top and .Left?

Does Report.Sections("D") mean the Details section?

Thanks again for this information!

David Abineri

 
I believe pixels are used, and yes, "D" will give you the Details section.

-dave
 
Dave, Can one set the font size and style also. What are these properties? Where does one find the list of such properties?

Thanks again for all your help.

David Abineri

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top