Solved

vb and Crystal Report

Posted on 2001-08-27
4
178 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
ID: 6430701
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
ID: 6431019
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
ID: 6431106
And when i need to use replace.
0
 
LVL 9

Accepted Solution

by:
Valliappan AN earned 50 total points
ID: 6431259
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 76
VBA saving file message display 5 67
Validating VB6 Function 19 59
JSON Response and request in VB6 application 11 424
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

809 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