?
Solved

vb and Crystal Report

Posted on 2001-08-27
4
Medium Priority
?
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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