Solved

vb and Crystal Report

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…

730 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