Is it possible to use extensive formulas (e.g. "if" or vlookup functions) in the "Custom Calculation Script"?

I am working on a form fill PDF converted from MS excel. This is for others to use who don't have MS excel that need to use my spreadsheet.
1. I would like to know how complex can the formulas be in the custom calculation script in the calculate tab under properties in a cell menu?
2. Where can I find what formulas will work in the custom calculation script along with the format for those formulas to work correctly (tutorials would help)?
I have tried writing an "if" function but received and error so I am assuming either functions don't work in the script or there is a different format than standard spreadsheet formats.
Bruce

In that case the for loop would be:
    for (var i = 0; i < 8; i += 1) {
        sum += +getField("Total." + i).value;
So initially, the counter i is equal to zero, so the field name used with the getField method is:
"Total." + 0, which results in the string "Total.0". With each iteration, the variable i is incremented by 1, so the subsequent field names are the following:
"Total.1"
"Total.2"
"Total.3"
"Total.4"
"Total.5"
"Total.6"
"Total.7"
The script gets the value of each field, converts it to a number, and adds the number it to the running sum.

Similar Messages

  • Is it possible to simulate a table for reference in  the "Custom Calculation Script" in Acrobat?

    I am attempting to simulate a table in a Acrobat form where the formula looks at the number or name from another field and looks through the code for the name or number reference and returns the value associated with the number or name. Is this possible in Acrobat forms?
    Bruce

    Yes, it's possible. You can get the name of the field that is being calculated using event.target.name, and then you can manipulate that name to get a row number (for example) and access other fields in that row.

  • How to convert an Excel Formula to a Custom Calculation Script in a Adobe Acrobat 9 Form?

    Hello,
    I am not familiar whatsoever with Javascript and need some help in converting the following Excel Formula so that I can enter it into a Custom Calculation Script in a Adobe PDF Form. Here is the formula:
    =IF(E15<25.01,9.95,IF(E15<50.01,11.95,IF(E15<75.01,13.95,IF(E15<100.01,16.95,IF(E15<150.01 ,19.95,IF(E15<200.01,24.95,IF(E15>200.00,E15*0.125)))))))
    Where "E15" will be the text field named "Subtotal" on my Adobe PDF Form.
    Thank you for any help you can provide!

    Fortunately JavaScript has the 'switch' statement so nested if statements can be avoided.
    var E15 = this.getField("Subtotal").value;
    switch(true) {
    case (E15 < 25.01) :
    event.value = 9.95;
    break;
    case (E15 < 50.01) :
    event.value = 11.95;
    break;
    case (E15 < 75.01) :
    event.value = 13.95;13
    break;
    case (E15 < 100.01) :
    event.value = 16.95;
    break;
    case (E15 < 150.01) :
    event.value = 19.95;
    break;
    case (E15 < 200.01) :
    event.value = 24.95;
    break;
    case (E15 > 200) :
    event.value = E15 * 0.125;
    break;
    default:
    event.value = "";
    break;
    } // end switch;

  • Is it possible to use creative cloud online with both Mac/windows system (on the same computer, bootcamp) without paying twice ?

    Hello, I work with a Macbook pro, divided into mac and win 8 (with Bootcamp), is it possible to use Creative Cloud subscription with both system without paying twice.
    Bonjour, J'utilise un Macbook pro partitionné Bootcamp mac et windows 8, est-il possible que l'abonnement à Creative Cloud en ligne fonctionne indifféremment dans les deux systemes (sur le même ordi), sans payer deux fois.
    Merci,
    jho

    Your subscription allows for two functioning installations (normally on separate machines, but I imagine you could install the two as you indicate).

  • Third Party keyboard- possible to "Use all F1, F2, etc. keys as standard function keys"?

    I've got a 3rd party Anker slim mac keyboard (http://www.amazon.com/Anker%C2%AE-Bluetooth-Wireless-Keyboard-Tablets/dp/B005ONM DYE).
    I really need to be able to use the F7 and F8 keys for my audio program (Pro Tools 10), but they always do the consumer-keys actions (rewind/play in itunes). Everywhere I look says to go to System Preferences and select the "Use all F1, F2, etc. keys as standard function keys" button, but since I have a third-party keyboard, that option does not exist. Using an applescript to try and do it anyway doen't work either. The closest I've gotten is using the freeware FunctionFlip, but that requires me to press and hold the Fn key to use them as function keys. I don't want that.
    Is there ANY way, official or third party, free or paid, that I can get this to work without buying a new keyboard?
    Thanks!
    Computer is a late 2012 Mac Mini with Mountain Lion

    Hello,
    I think Spark cured this for another person and the same problem...
    http://www.shadowlab.org/Software/spark.php

  • Can I use Partial class to enhance a typed dataset without losing the custom code?

    Hi All,
    I wanted to see if I could use a Partial class for one of the datatable classes to add custom code so that when the dataset is regenerated I don't lose my code.
    Partial public
    Class
    WA_MMTP_TrackerDataSet1
     'Code for dataset
     Partial Public Class PATIENTSTableAdapter
            <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
             Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"),  _
             Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)>  _
            Public Overloads Overridable Function FillbyClinicianId(ByVal dataTable As WA_MMTP_TrackerDataSet1.PATIENTSDataTable, ClinicianId As Integer, sql As string) As Integer
                 Dim dd As System.Data.SqlClient.SqlCommand
                dd = new System.Data.SqlClient.SqlCommand
                dd.CommandText = Sql
                dd.Connection = OpenConnection() '  UsersTableAdapter1.Connection
                Me.Adapter.SelectCommand = dd 'Me.CommandCollection(0)
                If (Me.ClearBeforeFill = true) Then
                    dataTable.Clear
                End If
                Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
                Return returnValue
            End Function
    'Other code for datatable
    end class
    end class
    I'd like to take the function FillbyClinicianId and put it in a separate partial class like so and remove the function by the same name from the original file (dataset file):
    Partial Public Class PATIENTSTableAdapter
            <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
             Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"),  _
             Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)>  _
            Public Overloads Overridable Function FillbyClinicianId(ByVal dataTable As WA_MMTP_TrackerDataSet1.PATIENTSDataTable, ClinicianId As Integer, sql As string) As Integer
                 Dim dd As System.Data.SqlClient.SqlCommand
                dd = new System.Data.SqlClient.SqlCommand
                dd.CommandText = Sql
                dd.Connection = OpenConnection() '  UsersTableAdapter1.Connection
                Me.Adapter.SelectCommand = dd 'Me.CommandCollection(0)
                If (Me.ClearBeforeFill = true) Then
                    dataTable.Clear
                End If
                Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
                Return returnValue
            End Function
    end class
    But when I try this, the compiler gives the following errors:
    Error 91 'Adapter' is not a member of 'AttendTrackerFull.WA_MMTP_TrackerDataSet1.PATIENTSTableAdapter'. 
    Error 92 'ClearBeforeFill' is not a member of 'AttendTrackerFull.WA_MMTP_TrackerDataSet1.PATIENTSTableAdapter'. 
    I guess I'm a little confused. once code is moved into the custom partial class it seems to lose any knowledge of the main class file and any references in the class. Am I doing it wrong? or is it a restriction of the .Net since it is in another
    file. If its because its in another file, my next question would it be better to take the partial class I created to contain my custom code, should I just move my partial class to the bottom of the dataset.designer.vb file? But if I do this, wont it still
    erase my custom code. Any suggestions?
    Thanks
    Michael

    Thanks for the reply.
    They are compile time errors, but the error shows up even before compiling, so I guess it would be designer time exception also.
    What I did the other day was to create a new class file (didn't add a namespace statement to class) then added the code in prev message. This morning I added a new module and added the prev code in it incased in the namespace
    namespace ADO.NET.DataSet1TableAdapters statement. But I still have the same errors messages. I tried
    to set the Custom tool.namespace property of the dataset to WA_MMTPDataset and then did the following in a module:
    namespace WA_MMTPDataset
    Module Module4
    Partial Public Class PATIENTSTableAdapter
    <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
    Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
    Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _
    Public Overloads Overridable Function FillbyClinicianId(ByVal dataTable As WA_MMTP_TrackerDataSet1.PATIENTSDataTable, ClinicianId As Integer, sql As string) As Integer
    Dim dd As System.Data.SqlClient.SqlCommand
    dd = new System.Data.SqlClient.SqlCommand
    dd.CommandText = Sql
    dd.Connection = OpenConnection() ' UsersTableAdapter1.Connection
    Me.Adapter.SelectCommand = dd 'Me.CommandCollection(0)
    If (Me.ClearBeforeFill = true) Then
    dataTable.Clear
    End If
    Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
    Return returnValue
    End Function
    End Class
    Partial Public Class UsersTableAdapter
    <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
    Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
    Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _
    Public Overloads Overridable Function FillbyClinicianId(ByVal dataTable As WA_MMTP_TrackerDataSet1.UsersDataTable, ClinicianId As Integer, sql As string) As Integer
    Dim dd3 As System.Data.SqlClient.SqlCommand
    dd3 = new System.Data.SqlClient.SqlCommand
    dd3.CommandText = Sql
    dd3.Connection = OpenConnection()
    Me.Adapter.SelectCommand = dd3 'Me.CommandCollection(0)
    If (Me.ClearBeforeFill = true) Then
    dataTable.Clear
    End If
    Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
    Return returnValue
    End Function
    End Class
    End Module
    End Namespace
    But I'm still getting the same errors.

  • Using ms project 2007 and vba macro to list all the custom fields used in the project?

    Hi,Using ms project 2007 vba macro, I would like to be able to list all the custom fields used in the project and their corresponding field names. e.g. let us say I create a calculated duration field and name it "expected duration" and the name
    of the field I select is Duration1.
    I am trying to write a macro that will list all the used custom fields such as the result would look like:
    Duration1 ---> "expected duration"
    Text1       ---> "anything"
    Flag1        ---> "....."
    Number1  ---> "..............."
    Can anyone provide me with the solution?
    Regards,
    Chuck

    John,
    I found this module, which provides the the list of custom fields used in the project but does not provide the name given to the field. Here below is the module and hope you could help me achieve this by modifying the macro to list the renamed field.
    ' MSP Checks all Custom Task Fields
    Sub checkfields2()
    'This macro will check and report out which custom task fields are used
    'It requires Project 2002 and above as it relies on the GetField
    'and FieldNameToFieldConstant methods which were not introduced until
    '2002.
    'It does not include resource fields, however it is a simple matter to
    'do it by replacing the pjTask constant with pjResource.
    'Copyright Jack Dahlgren, Oct. 2004
    Dim mycheck As Boolean
    Dim myType, usedfields As String
    Dim t As Task
    Dim ts As Tasks
    Dim i, it As Integer
    Set ts = ActiveProject.Tasks
    usedfields = "Custom Fields used in this file" & vbCrLf
    myType = "Text"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 30
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> "" Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Number"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 20
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> 0 Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Duration"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If Left(ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)), 2) <> "0 " Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Cost"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> 0 Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Start"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> "NA" Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    myType = "Finish"
    usedfields = usedfields & vbCrLf & "--" & UCase(myType) & "--" & vbCrLf
    For i = 1 To 10
    mycheck = False
    it = 0
    While Not mycheck And (it < ts.Count)
    it = it + 1
    If Not ts(it) Is Nothing Then
    If ts(it).GetField(FieldNameToFieldConstant(myType & i, pjtask)) <> "NA" Then
    usedfields = usedfields & myType & CStr(i) & vbCr
    mycheck = True
    End If
    End If
    Wend
    Next i
    MsgBox usedfields
    End Sub
    This is what the module gives me. But I would like to have beside Text 1 the name that is shown as below. e.g Text1 is "Test".
    Would you mind helping me achieve this?
    Thanks in advance.
    Chuck

  • Is it possible to use Webcenter task flows i.e. Poll Service in a custom ADF application?

    We can use the Poll service in our WebCenter Portal application. Is it possible to configure an ADF web application to use WebCenter Portal's task flows? How can we achieve this requirement?

    Hi.
    There is a link that points here: http://www.oracle.com/technetwork/indexes/samplecode/jdeveloper-adf-sample-522118.html
    Oracle JDeveloper and ADF Sample Code
    Contains a Polls Demo Client and Admin Console Taskflows
       The Poll taskflow installed is a sample application. It is not part of an Oracle product.
    These are not supported by the standard Support processes.
    Sample Code for Developers and Admins
    Download the sample code and scripts here to learn or help accelerate your own development or admin efforts. You may modify (but not redistribute) sample code.
    Sample code is not certified or supported by Oracle unless explicitly identified to be; it is intended for educational or testing purposes only.

  • Is there any one knows how to use labview 6.0 to make a "continue" function like the one in C language?

    I am using labview 6.0 and i like to know is there any one knows how to stop the current iteration in while loop or for loop and continue to do the next iteration,just like the "continue" statement in C or C++ language?

    Simple test here in LV6 confims that you can't do this. Not in a useful
    sense anyway. "Stop" doesn't stop execution simply of the current VI, it
    also kills all VIs above it. It would hence be difficult to argue that this
    approach is in any way similar to "continue".
    What version of Labview have you tested this on and can you post a
    demonstration?
    Craig Graham
    Physicist/Labview Programmer
    Lancaster University, UK
    "Oleg" wrote in message
    news:506500000005000000E45B0000-1011517314000@exch​ange.ni.com...
    > Hi,
    > you can orginize all the inner actions of your while loop into the
    > SubVI. Then use the Functios/Application Control/Stop.vi in this SubVI
    > to stop the current interation in any point you want. This will stop
    > your SubVI and yo
    u will automatically goto the next iteration in your
    > while loop.

  • Using lineair formula, but outcome 0 if X=0

    Hi all,
    I am new to this forum and working with Adobe Acrobat X pro for some months now. Currently I am facing some difficulties with a formula. Simplified, I want Adobe to calculate the price of a hose, with fixed costst (couplings) and variable costs (length of the hose, based on the numbers of meters that they select). Their response can be chosen in a dropdown menu in meters (0, 5, 10, 15, 20, 25). The calculation that follows is simple:
    451 + 8X
    However, since the item is an option, if X= 0 this means that the user does not want the item at all. Yet the result still equals 451 euros. I want the outcome to be 0 if 0 meters is selected.
    In excel we could solve the issue using the Round function (Round equals 1 if X > 0 and 0 if X equals 0. However, in PDF I have no clue how to deal with this (javascript I guess?).
    In practice it is slightly more complicated, since the same hose can be selected for 2 separate purposes and I want to show the total of these two as outcome. That is, the formula is 451*(1(if hose is wanted for a) + 1(if hose is wanted for b))  + 8(a+b) . See screenshot for what I mean.   
    Can you help me?
    Thanks a lot in advance

    You have to use custom calculation scripts to perform the calculations. You need to use the conditional statement i
    f(logical test) {
    //block of script
    } else {
    //block of script
    to perform conditional execution of blocks of code.
    Custom scripts require a lot of details and a very clear statement of the problem.

  • Is it possible to use a vector filter mask for smart filters?

    Hello
    I have a very specific question. With smart objects, you can use smart filters and you can use a smart filter mask to define the filter effect area. Now, the filter mask is like a regular layer mask, in that its effectively a raster image. I'm wondering if it's possible to use a vector filter mask as well? I haven't yet found an option to do so. Any help would be greatly appreciated.
    I'm using Photoshop CS5.
    Thank you
    R. Kroll

    I'm wondering if it's possible to use a vector filter mask as well?
    Not to the best of my knowledge.
    A possible workaround (depending on the SO) might be to duplicate it, apply the Filter and apply the Vector Mask to the SO itself.

  • Is it possible to use a sprint hot spot as a network connection on HP Officejet 8600 Pro?

    Is it possible to use a sprint hot spot as a network connection on HP Officejet 8600 Pro?

    @Johndcrum
    It's possible to use a hot spot connection but its not recommended. The connection isn't reliable.

  • I have 2 iMacs, one has a thunderbolt port and the other has a mini display port. Would it be possible to use one as an extension of the other? If so what cable would I need.

    Hi,
    As the title of the thread says. I have an older iMac with a mini display port and a newer iMac with a thunderbolt port. Would it be possible so that the older iMac is an extension of my new iMac. The reason for this is because logic x can be a abit clustered on one screen.
    Thanks

    If you'll be using the 2010 iMac as the display, a Mini DisplayPort to Mini DisplayPort cable.
    It's not possible to use the 2011 iMac as the display through Target Display mode in that configuration.
    (126322)

  • Is it possible to use C++ in a Kernel Extension?

    In the "Kernel Extension Programming Topics" document there are two examples of kernel extensions - HelloKernel and Hello I/O Kit.
    The Hello IO Kit is created as an I/O Kit Driver project and HelloKernel as a kext project.
    Hello I/0 Kit has C++ classes in it whereas HelloKernel is just C.
    Is it possible to use C++ in a kext project? If so what header files or bundles must be included to make it possible?
    My aim is to develop an NKE (which I presume has to be created as a kext project) and I would rather implement it it using classes than using just C.

    hotcheese wrote:
    Was it pre-Snow Leopard?
    Yes
    I've just seen this following text from the Kernel release notes for Snow Leopard, would this make a difference? ( I notice it mentions I/O however, why is C++ allowed in I/O kexts but not in others?)
    *Mixed C/C++ Kexts*
    Mac OS X Snow Leopard features support for kexts that use both C and C++ code. On prior
    releases of Mac OS X, making use of Libkern C++ classes in a generic (C-based) kext was a
    risky proposition, since the I/O Kit auto-unloading mechanism destroyed any kext
    referencing such classes if there were no instances of them. Apart from that, even if non-
    Libkern C++ was used, the stub routine invoked at unload called the kext’s static C++
    destructors before the kext’s stop routine, and when the kext was auto-unloaded the stop
    routine wasn’t invoked at all.
    Snow Leopard corrects these issues by:
    Marking only kexts that define subclasses of IOService for auto-unload. Non-I/O Kit
    kexts loaded on Snow Leopard can safely use and subclass Libkern C++ classes.
    Altering the stub unload routine to call the kext’s stop routine first, then the kext’s
    static C++ destructors. Important: To gain this behavior you must build your kext to
    be targeted against Snow Leopard, as the stub routine is built into the kext.
    Always unloading a kext by calling both the stop routine and then the C++ static
    destructors, regardless of kext type (generic or I/O Kit).
    That is very interesting. I suggest you post your question on Apple's Darwin kernel mailing list. I have seen postings there that both echo what I told you and claim that you can make C++ work fine. It is highly likely that I just need more experience writing kernel code (and a better project idea). I would like to know the answer to this question myself. It doesn't seem as cut and dried anymore.

  • Can possible  to build extension in CS4 using Creative Suite Extension Builder

    I have adobe flash builder 4.5 and extenstion builder. It only suport max version CS5.5 and min version CS5. But i want the extension in CS4. Can it possible to develop extension of CS4 using creative suite extension builder?

    No.

Maybe you are looking for

  • Trying to use iCloud email on my pc - do I need to buy Outlook Express?

    I have an iPad and iPhone, but have kept my PC.  Converting to iCloud for my mail.  Do I need to buy Outlook Express to use iCloud email on my PC?

  • Program to arrange 4 strings in ascending order .

    can any one gimme the code to arrage 4 strings in ascending order.

  • Data Extraction from PDF

    I am creating a large PDF form that people will fill out, save, and return to us. I am wondering if there is a simple method to extract the data from the PDF and store the values in a database (excel or access). I can program in java if needed, but I

  • SAPJCo3 JCoServer restart error

    Hello All, I happened an error when I want to restart my JCoServer. I used the SAPJCo3's sample code StepByStepServer.java. After I set the connection properties into the connectPorperties object. then I used step3SimpleTRfcServer() method to start J

  • Separating ABAP and J2EE stack after an Add-in installation

    Hi All, While I need to migrate an Add-in installation (ABAP + J2EE) to a new machine, there is also a requirement to separate these stacks into two separate instances. Can you please suggest the approach for this? Any suggestions are greatly appreci