Solved

vb and Crystal Report

Posted on 2001-08-27
4
182 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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 …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

726 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