How can i return the Formula name from crystal Report 9 into VB6

Posted on 2006-03-29
Last Modified: 2010-04-17
Dear All,

I am passing a text value to a formula in Cry report 9.

   Mireport.FormulaFields.Item(3).Text = frmLogin.MUsername

It works Fine.

The problem is i have many reports. The index for the formula (LUserName ) does not have the
same index in all the reports.

I wish to send the formula value using the name of the formula and not the item(?).

Question by:Gururagguru
    1 Comment
    LVL 2

    Accepted Solution

    In my limited knowledge of Crystal 9 and reading your dilemma, I assume that Crystal 9 does not have strongly typed formula indexes to names.
    Therefore, you will have to use the exact index of the formula you are needing.

    You have a choice of leaving it as is or to solidify the interface contract by using an enum.

    'Declare an enum

    Public/Private/Friend Enum iFormula
      Formula0Name = 0
      Formula1 = 1
      Formula2 = 2
      LoginName = 3
      Formula4 = 4
    End Enum

    So in your procedure

    You could write:

       Mireport.FormulaFields.Item(iFormula.LoginName).Text = frmLogin.MUsername

    You can also use subs or functions to increase the contract coupling.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    only14 challenge 19 57
    seriesUp challenge 7 83
    VB 6.0 printer how to align 6 37
    java  and programming certification ? 4 36
    A short article about a problem I had getting the GPS LocationListener working.
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now