• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

VB.net Crystal Formula field alignment

I am creating a Formula field that converts a decimal to a text string and adds a Pct sign.
totext(Sum({GMFTempWeeklyProd1.Mon})/{?TtlPounds}* 100)+ '%'
By default this is left aligned. I can't find a place in the Crystal interface to right align this field. I have searched for a way to do it in code but have not been successful.
I think I am looking for something like:

Dim crObject as ??????? This has to refer to the Report I have already loaded

For each crObject in crObject.ReportDefinition.ReportObjects
   If crObject.name = "FormulaFieldName" then
      crObject.ObjectFormat.HorizontalAlignment = Alignment.RightAlign
    end if

Any suggestions?
  • 2
1 Solution
Are you creating the field in code?

I believe you just need to use Object

mpdillonAuthor Commented:
The field is created in the designer and not in code.

In code I am trying to identity the field and change its horizontal alignment.

I made the following changes based on your suggestion

 'I am not exactly sure of this statement. I can't check as computer is off
dim cryRpt as crystal.ReportDocumant

Dim crObject as  OBJECT

For each crObject in cryRpt.ReportDefinition.ReportObjects
mpdillonAuthor Commented:
Worked great
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now