Solved

vb and Crystal Report

Posted on 2001-08-27
4
176 Views
Last Modified: 2011-10-03
What happened when I do replace a formula?
I have 2 builded formulas in my report.
In a second statement, If I understand correctly, I want to append a new statement to the first formula.

    'Supply record selection based on dates
    strSelectionFormula = "{Orders.Order Date} in Date(" & _
    Format(txtFromDate, "yyyy,m,d") & ") to Date(" & _
    Format(txtToDate, "yyyy,m,d") & ")"

    crptXtreme.ReplaceSelectionFormula (strSelectionFormula)
    'Note: parentheses around strSelectionFormula are optional
   
    'Set @Order + Tax formula
    If txtTaxRate = "" Then
        crptXtreme.Formulas(0) = "Order + Tax={Orders.Order Amount}"
    Else
        crptXtreme.Formulas(0) = "Order + Tax={Orders.Order Amount} *" & Str(txtTaxRate / 100 + 1)
    End If  
0
Comment
Question by:Sychev1
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
What is your CR formula name, you can set only to that name, and I dont think you could do like Order + Tax.

If your formula name is SumOrderTax in CR, then you could set like:

crptXtreme.Formulas(0) = "SumOrderTax = {Orders.Order Amount}"

Try this. I am not sure, if this is what you need.
0
 

Author Comment

by:Sychev1
Comment Utility
Order + Tax - name of the 1-st formula.
I just can't figur out what i'm replacing by this. Which formyla:

   crptXtreme.ReplaceSelectionFormula (strSelectionFormula)
   'Note: parentheses around strSelectionFormula are optional
0
 

Author Comment

by:Sychev1
Comment Utility
And when i need to use replace.
0
 
LVL 9

Accepted Solution

by:
Valliappan AN earned 50 total points
Comment Utility
Ok, actually you are replacing the SelectionFormula property, and not any other formulas. i.e. you are replacing the filter for the CR data.

Hope this helps.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

11 Experts available now in Live!

Get 1:1 Help Now