Changing a formula @ Run Time - Report Designer Component 
Author Message
 Changing a formula @ Run Time - Report Designer Component

I am using VB 6.0 & the Report Designer Component

Can anybody help me with this code:

    Dim app As CRAXDRT.Application
    Dim rpt As CRAXDRT.Report
    Dim defs As CRAXDRT.FormulaFieldDefinitions

    Set app = New CRAXDRT.Application
    Set rpt = app.OpenReport(strMyPath)

    Set defs = rpt.FormulaFields
    defs.Item("FormulaName").Text = """new formula"""

I get a "type mismatch error" in the last line.  If I use a numeric index,
it works (but I have to know the numeric index for the formula).

On line help says:

Item Returns FormulaFieldDefinition Object. Item has an index parameter that
"can be either a string reference to the formula field or a numeric, 1-based
index."
 When a numeric index is used, the items in the collection are indexed in
the order they were added to the report.

Instead of using the Item property as shown, you can reference a formula
field directly, for example, FormulaFieldDefinitions("ExampleFormula").

Anybody have any idea what I am doing wrong here?
--
Brian Beninger



Tue, 14 May 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Report Designer Component - Changing Data Source At Run-Time

2. Changing Groups Using Report Designer Component

3. Changing SQL statement in Report Designer Component

4. How to change the ConnectionString in the VB6 Data Designer object at run time

5. Changing Formulas at run time

6. Data Report Designer - Creating Hierarchy at Run Time

7. Run Time Report Designer?

8. Crystal Report 8 ActiveX Designer Run Time Library

9. Crystal Report Designer Invoking at RUN TIME

10. Crystal Reports 6 Report Designer Component

11. Crystal Reports Report Designer Component

12. Crystal Report Designer Component (Previewing a report.)

 

 
Powered by phpBB® Forum Software