Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

BI Publisher -> Field Browser

Received Response
512
Views
4
Comments

Summary

BI Publisher -> Field Browser

Content

I'm Writing code (EX:<?//field/value = '0000'?>) for a text form field in Field Browser with in BI Publisher Tab (Word 2010) and I'm trying to copy this form field to another new word document when i do this it is not copying the actual code in it instead it is placing <?ref:xdo0001?> code. could you please let me know- is there any other way to copy the original code using Field browser.

Answers

  • Venkat Thota - BIP
    Venkat Thota - BIP Rank 7 - Analytics Coach

    This is known issue.

    just copy and paste the code inside the form field,dont copy form filed from one document to other.copying form filed diectly can work within the document.

    let me know if you have any issue.Thanks

  • Raghunath Mscs
    Raghunath Mscs Rank 3 - Community Apprentice

    Thank you for your response, Actually 2 resources are planning to work on a single template requirement and there are nearly 1200 form fields so I though It would be easy to copy the fields once one person is done with the coding to merge with the other one. so is this a limitation in BI publisher?.

    Thank you.

  • Smanikandan65
    Smanikandan65 Rank 5 - Community Champion

    The reason why you see <?ref:xdo0001?> in your code when copied is because, the template was built based on "Large form field" type.

    If it had been built on "Backward Compatible" then you can copy form field from one template to another template.

    This setting is available in BIP Desktop plugin --> Option

    Here you go with more details

    Large (Recommended if code exceeds 396 chars)

    By default RTF template choose “Large” as form type field

    Advantage: Supports up to 4000 characters in a form field

    Disadvantage: Requires XML loaded at all time in order to view the form field code otherwise source code will be broken

    image

    Backward Compatible (Recommended if code does not exceed 396 chars)

    Advantage: Doesn’t require XML data to view the form field code

    Disadvantage: Supports only up to 396 characters

    image

    Note: You can mix the two types in the same template. Whenever you want to code something very big then change it to Large and write the code and once done change it back to backward.

    So that only that particular filed can't be copied to other template.

  • Bob Lilly
    Bob Lilly Rank 2 - Community Beginner

    As Manikandan said, you can use the Backward Compatible form field type to keep the code within the formfield object. However, if you already have a document with lots of formfields in the Large format, it is still possible to copy them to another document with the help of some VBA code.

    The main problem in your case where you want to merge two documents is that you will have references with the same name in both source documents. However, you could also use VBA code to change the sequence numbers for the references in one of the documents to eliminate this duplication.

    The key is to understand that the code for fields that use references is stored in document variables. In VB, you can use the FormFields collection to access all of the fields in your document, and the Variables collection to access the code for the fields that use references. Note that the code in these variables is stored in a compressed format so it won't be readable, but that won't be an issue for this process.

    As an example, if you had MyTemplate1.rtf and MyTemplate2.rtf, and you wanted to merge them to create MyTemplate3.rtf. You could do the following:

    First copy MyTemplate2.rtf to MyTemplate3.rtf, then open MyTemplate1.rtf and MyTemplate3.rtf and run the following VBA macro:

    Dim docSrc As DocumentDim docTgt As DocumentSub RenumberReferences()   Set docSrc = Documents("MyTemplate1.rtf")   Set docTgt = Documents("MyTemplate3.rtf")   ' Get the name of the reference variable with the highest sequence number in the target   lastref = 0   For Each v In docTgt.Variables      vname = v.Name      If Left(vname, 3) = "xdo" Then         refnum = Val(Right(vname, 4))         If refnum > lastref Then            lastref = refnum         End If      End If    Next    Debug.Print lastref    ' Add the lastref amount to each of the variable names in the source    ' Add the new variables to the target document so they are found    ' when the formfields get copied        For Each v In docSrc.Variables      vname = v.Name      If Left(vname, 3) = "xdo" Then         refnum = Val(Right(vname, 4))         newref = "xdo" + Format(refnum + lastref, "0000")         docTgt.Variables.Add Name:=newref, Value:=v.Value      End If    Next       ' Add the lastref amount to each of the references in the source       For Each f In docSrc.FormFields      ftext = f.StatusText      If Left(ftext, 9) = "<?ref:xdo" Then         refnum = Val(Mid(ftext, 10, 4))         newref = "<?ref:xdo" + Format(refnum + lastref, "0000") + "?>"         f.StatusText = newref      End If    Next   End Sub

    Then copy all of the formfields and other content you need from Template1.rtf to Template3.rtf. Save Template3.rtf but close Template1.rtf without saving.

    Regards,

    Bob