Strange behaviour on text insert into a HTML pane

Hi all,
I am trying to fix a problem on inserting a span tag into an existing html page (in an EDITABLE JEditorPane).
The behaviour:
Assuming the cells in a table (3 rows, 2 columns) are numbered from 1 to 6, with cell one being the top left most, cell 2 top right, cell 3 middle left, etc.
1. Inserting the text "<span></span>" in cell 4 causes during any attempt to later type into cell 5 the characters to be appended instead into cell 4, directly after the close span tag.
2. The insertion in the first place behaves strange. If I have the caret positioned for cell 5 so that I can insert there
(via the function void javax.swing.text.html.HTMLEditorKit.insertHTML(HTML Document doc, int offset, String html, int popDepth, int pushDepth, Tag insertTag) )
even though the caret position is visible in cell 5, the insertion seems to take place in cell 4.
I can sort of compensate for this by adding 1 to the offset. However, then when inserting into a line of text, for example, "the quick red fox jumped over the lazy dog"
I insert directly before the 'j' in 'jumped', the insertion looks like this "the quick red fox j<span>..</span>umped over the lazy dog"
So that is no solution.
IMPORTANT! Just to prove it is not the span tag causing the trouble, if this span tag already exists in a cell on 'Load' of the html file, the strange behaviour is not observed.
Something is going wrong here. It is me? Or is it a bug?
Please help!!
Here is a test app, and the test html you can use (place in current directory).
Please test like this:
1. run application (the html should be loaded into the pane)
2. the span tag is programmed to automatically insert at cell 4 (by using the +1 method on the insert)
3. another span tag was already existing in the html file, at cell 8
4. Attempt to type into cell 5
result: the text appears instead at cell 4
5. Type into cell 9
result: the text correctly is entered into cell 9
See the difference!!
Help!
The test java app:
package small.test;
import java.awt.BorderLayout;
import java.awt.Container;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.StringReader;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import javax.swing.text.JTextComponent;
import javax.swing.text.html.HTML;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.parser.ParserDelegator;
public class HtmlInsertTest extends JEditorPane
     public HtmlInsertTest()
     public static void main(String args[])
          JFrame frame = new JFrame("Loading/Saving Example");
          Container content = frame.getContentPane();
          frame.setSize(600, 600);
          final HtmlInsertTest editorPane = new HtmlInsertTest();
          editorPane.setEditable(true);
          JScrollPane scrollPane = new JScrollPane(editorPane);
          content.add(scrollPane, BorderLayout.CENTER);
          editorPane.setEditorKit(new HTMLEditorKit());
          JPanel panel = new JPanel();
          content.add(panel, BorderLayout.SOUTH);
          frame.setSize(600, 600);
          doLoadCommand(editorPane);
          editorPane.insertHTML("<span>inserted text</span>", 84);
          frame.setVisible(true);
     public static String getHTML()
          return
          "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"+
          "<HTML>"+     "<HEAD>"+
          "     <META HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=utf-8\">"+
          "     <TITLE></TITLE>"+          
          "</HEAD>"+
          "<BODY LANG=\"en-AU\" DIR=\"LTR\">"+
          "<P STYLE=\"margin-bottom: 0cm\">This is a test xhtml document. "+
     "     </P>"+
     "     <P STYLE=\"margin-bottom: 0cm\">"+
     "     </P>"+
     "     <P STYLE=\"margin-bottom: 0cm\">Here is a table:</P>"+
     "     <P STYLE=\"margin-bottom: 0cm\">"+
     "     </P>"+
     "     <p></p>"+
           "     <TABLE WIDTH=100% BORDER=1 BORDERCOLOR=\"#000000\" CELLPADDING=4 CELLSPACING=0>"+
     "          <TR VALIGN=TOP>"+
     "               <TD WIDTH=50%>"+
     "                    <P>It has</P>"+
     "               </TD>"+
     "               <TD WIDTH=50%>"+
     "                    <P>2 columns</P>"+
     "               </TD>"+
     "          </TR>"+
     "          <TR VALIGN=TOP>"+
     "               <TD WIDTH=50%><P>And 4 rows</P></TD>"+
     "               <TD WIDTH=50%><P></P></TD>"+
     "          </TR>"+
     "          <TR VALIGN=TOP>"+
     "               <TD WIDTH=50%><P></P></TD>"+
     "               <TD WIDTH=50%><P></P></TD>"+
     "          </TR>"+
     "          <TR VALIGN=TOP>"+
     "               <TD WIDTH=50%><P></P></TD>"+
     "               <TD WIDTH=50%><P><span>existing text</span></P></TD>"+
     "          </TR>"+
     "          <TR VALIGN=TOP>"+
     "               <TD WIDTH=50%><P></P></TD>"+
     "               <TD WIDTH=50%><P></P></TD>"+
     "          </TR>"+
     "     </TABLE>"+
     "     <P STYLE=\"margin-bottom: 0cm\">"+
     "     </P>"+
     "     <P STYLE=\"margin-bottom: 0cm\">"+
     "     </P>"+
     "     <P STYLE=\"margin-bottom: 0cm\">"+
     "     </P>"+
     "     <P STYLE=\"margin-bottom: 0cm\">We will test the drag and drop"+
     "     functionality with this document. "+
     "     </P>"+
     "     <P STYLE=\"margin-bottom: 0cm\">It will be loaded with the hlml editor.</P>"+
     "     <P STYLE=\"margin-bottom: 0cm\">"+
     "     </P>"+
     "     <P STYLE=\"margin-bottom: 0cm\">"+
     "     </P>"+
     "     </BODY>"+
     "     </HTML>";
     public static void doLoadCommand(JTextComponent textComponent)
          StringReader reader = null;
          try
               System.out.println("Loading");
               reader = new StringReader(getHTML());
               // Create empty HTMLDocument to read into
               HTMLEditorKit htmlKit = new HTMLEditorKit();
               HTMLDocument htmlDoc = (HTMLDocument)htmlKit.createDefaultDocument();
               // Create parser (javax.swing.text.html.parser.ParserDelegator)
               HTMLEditorKit.Parser parser = new ParserDelegator();
               // Get parser callback from document
               HTMLEditorKit.ParserCallback callback = htmlDoc.getReader(0);
               // Load it (true means to ignore character set)
               parser.parse(reader, callback, true);
               // Replace document
               textComponent.setDocument(htmlDoc);
               System.out.println("Loaded");
          catch (Exception exception)
               System.out.println("Load oops");
               exception.printStackTrace();
          finally
               if (reader != null)
                    reader.close();
     public void insertHTML(String text, int offset)
          SwingUtilities.invokeLater(new insertAction(this, text, offset));
     class insertAction implements Runnable
          String text = "";
          int offset = 0;
          JEditorPane jEditorPane1 = null;
          public insertAction(JEditorPane _jEditorPane1, String _text, int _offset)
               jEditorPane1 = _jEditorPane1;
               text = _text;
               offset = _offset;
          @Override
          public void run()
               HTMLDocument doc = (HTMLDocument)jEditorPane1.getDocument();
               HTMLEditorKit kit = (HTMLEditorKit)jEditorPane1.getEditorKit();
               try
                    System.out.println("reading from string reader");
                    kit.insertHTML(     doc,
                                      offset,//+1
                                      text,
                                      0,//0
                                      0,//0
                                      HTML.Tag.SPAN);
                    System.out.println(jEditorPane1.getText());
               catch (Exception e)
                    System.out.println("error inserting html: " + e);
}Edited by: svaens on Jul 16, 2009 6:34 PM
fix another stuffed up attempt at a SSCCE.

Well, I know nothing about HTML in JEditorPanes. I have never been able to figure out how insertions work.
My comment was a warning to others. Some people (like me) avoid answering posting of this type for reasons given in the JavaRanch link. Others will answer anyway. Other might first check the other site to see if they are wasting there time, but they can only do that if a link was posted with the original question.
The only suggestion I have is to repost the question, (since this posting is now completely off topic) making sure to then respond to this posting stating that a fresh question has been asked so you don't get a discussion going on in two places.

Similar Messages

  • How to modify text insertion position in HTML in a JEditorPane

    Hi all,
    Thanks in advance if anyone knows the type of code I need to look at to solve my problem.
    It involves the insertion point (in the actual HTML) when editing text in a JEditorPane using type html/txt.
    for example, lets say you start to add text by typing in a JEditorPane which already contains some text.
    The html is:
    <html><head></head>
    <body>
    <span>inside</span>
    </body>
    </html>
    which represents visually:
    inside
    The user places the caret (by pointing and clicking the mouse) after the word 'inside'.
    The user types the word 'outside'.
    The resulting html will look like this:
    <html><head></head>
    <body>
    <span>insideoutside</span>
    </body>
    </html>
    I would very much prefer it to look like this:
    <html><head></head>
    <body>
    <span>inside</span>outside
    </body>
    </html>
    Does anyone know how to influence the position of insertion in this way?
    Thanks again,
    sean

    Success!!!
    In a tiny bit of a hacky way.
    I will share my path to success. Though I am sure it could be improved. The solution (except for the minor hack to get it to work at all) is quite simple.
    And it did indeed involve the use of the DocumentFilter.
    So, to recap, My objective was to prevent the user from causing the addition of text within a certain span tag in my HTML when editing visual through a JEditorPane.
    Specifically, in my HTML I have a number of span tags identified through a type attribute. My span tags look like this:
    <span type="reserved">hello</span>
    I wanted to prevent the user from being able to type (visually) to cause either this:
    <span type="reserved">next text hello</span>
    or
    <span type="reserved">hello new text</span>
    or
    <span type="reserved">he new text llo</span>
    Initially, I had used a Caret listener, and moved the caret along, which, besides being hugely ugly, wouldn't fix the main problem of, even when the user starts typing after the word 'hello' on the visual pane, the text would be appended within the span tag, and not outside. Even though if I were to check my position (with the following code) I would be told it wasn't associated with the span attribute at all
              Element elem = hdoc.getCharacterElement(pos);
              AttributeSet a = elem.getAttributes();
              AttributeSet spanAttributeSet = (AttributeSet)a.getAttribute(HTML.Tag.SPAN);
              // if spanAttributeSet is not null, then we properly found ' a span '.
              // now we need to discover if it is one of OUR spans
              if (spanAttributeSet != null)
                    { // blah .... do something
                    }Regardless of what it told me with the above code, if i were to type in at that position (just after the hello) it would be added to the span tag. Which is what I didn't want.
    But the discovery of the DocumentFilter was what I needed to look at. Although, I had a very strange problem of having to reassign the document filter several times to the editorPane (later checks would see it as null). I don't know why I have this problem, but I have made a work-around by ensuring the DocumentFilter is still assigned by reassigning it every time the user moves the caret in the editorpane. Not nice, but prevents my filter from being ignored.
    The real solution:
    Using the DocumentFilter, I was able to solve both my problems of , not allowing the user to type inside the word 'hello', and preventing the text typed after the 'hello' being appended inside the span tag by the Document model.
    This is my code:
               myFilter = new DocumentFilter(){
                    public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attrs) throws BadLocationException
                         System.out.println("in insert string");
                           if (isCaretOnReservedObject((HTMLDocument)fb.getDocument(), offset))
                                throw new BadLocationException("Reserved position", offset);
                           else
                                    Object val = attrs.getAttribute(HTML.Attribute.TYPE);
                                if (val!=null && val.equals("reserved"))
                                     super.insertString(fb, offset, string, null);
                                else
                                     super.insertString(fb, offset, string, attrs);
                    @Override
                    public void remove(DocumentFilter.FilterBypass fb,
                            int offset,
                            int length)
                     throws BadLocationException
                         super.remove(fb, offset, length);
                      public void replace(DocumentFilter.FilterBypass fb,
                             int offset,
                             int length,
                             String text,
                             AttributeSet attrs)
                      throws BadLocationException
                           if (isCaretOnReservedObject((HTMLDocument)fb.getDocument(), offset))
                                throw new BadLocationException("Reserved position", offset);
                           else
                                    Object val = attrs.getAttribute(HTML.Attribute.TYPE);
                                if (val!=null && val.equals("reserved"))
                                     super.replace(fb, offset, length, text, null);
                                else
                                     super.replace(fb, offset, length, text, attrs);
               ((AbstractDocument)this.getInternalJEditorPane().getDocument()).setDocumentFilter(myFilter);
         protected boolean isCaretOnReservedObject(HTMLDocument hdoc, int pos)
              boolean retval = false;
              Element elem = hdoc.getCharacterElement(pos);
              AttributeSet a = elem.getAttributes();
              AttributeSet spanAttributeSet = (AttributeSet)a.getAttribute(HTML.Tag.SPAN);
              // if spanAttributeSet is not null, then we properly found ' a span '.
              // now we need to discover if it is one of OUR spans
              if (spanAttributeSet != null)
                   Object type = spanAttributeSet.getAttribute(HTML.Attribute.TYPE);
                   if (type != null && type.equals("reserved"))
                        // for our logging, we get the ref, which holds the source
                        // of our value later
                        System.out.println(elem + ": the value is: " + spanAttributeSet.getAttribute("ref"));
                        retval = true;
              return retval;
         }And now, when I attempt to type on the word 'hello', nothing happens (great!), and when I type after it, it is not assigned the span tag attribute, and we later find it (when outputting html) at the outside of the span tag.
    I don't know if there is a better way to do this, but it looks and works fairly cleanly so far.
    And thanks to stas for your reply...... Maybe this is what you meant. . it certainly was the attributes I needed to fiddle with here, and it gave me an extra hint of what to look for when researching the problem.
    Edited by: svaens on Sep 28, 2009 6:56 PM
    forgot to add dependency to code snippet
    Edited by: svaens on Sep 28, 2009 9:34 PM
    fix bug

  • How to edit text inserted into a gif

    I have a gif image.  I opened the image.  I insert text the with horizontal text tool.
    After inserting I can move the text around, but I can’t edit the text, can’t add or change characters, can’t change color.
    Is there a way to do that?

    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    A screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Insert one html page into another html page

    Hi there,
    I wonder if sombody can help. I am trying to insert one short
    html page into another page. I could not find any option or feature
    in Dreamweaver that allow me to insert the page at all. The page I
    want to insert has the links and it is a short page, just like a
    banner. When I update the links on that page it will update all
    other pages in the website. I do not have to open many pages to
    update. I have been using FrontPage and I am now converting to
    Dreamweaver. Some codes from FrontPage does not work in
    Dreamweaver. I would very much appreciate if somebody can help with
    the codes.
    This is my website so that you can understand what I mean. At
    the top of the screen there are many links that are from one page I
    inserted into index.html. I use FrontPage. But, Dearmweaver does
    not work that way.
    Thank you. Kevin

    Be aware that IFrames carry all the disadvantages that frames
    do, for both
    you and your client's visitors.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "polarl light" <[email protected]> wrote in message
    news:g06ad0$2rm$[email protected]..
    >
    >> I wonder if sombody can help. I am trying to insert
    one short html page
    >> into
    >> another page. I could not find any option or feature
    in Dreamweaver that
    >> allow
    >> me to insert the page at all. The page I want to
    insert has the links
    >> and it
    >> is a short page, just like a banner. When I update
    the links on that
    >> page it
    >> will update all other pages in the website. I do not
    have to open many
    >> pages
    >> to update. I have been using FrontPage and I am now
    converting to
    >> Dreamweaver.
    >> Some codes from FrontPage does not work in
    Dreamweaver. I would very
    >> much
    >> appreciate if somebody can help with the codes.
    >
    > Depending on what you want to do you can use SSIs or an
    Iframe. SSIs are
    > good for things such as headers, menus and nav bars that
    you want to stay
    > the same across a range of pages. Iframes let you load
    an external HTML
    > file into a predefined area of your page so you can
    display different
    > content while staying on the same page.
    >

  • Strange behaviour when placing text frame on top of image

    Hi,
    Win XP, FM 8.04
    I have a front cover that consists of a TIF image that bleeds off the page. On top of that image I want to put a text frame with the book title.
    The strange thing is that when I create the text frame and use the toolbar buttons to nudge it down on the page, the text (but not the frame) suddenly jumps to a totally different place way down on the page, despite only nudging it, say, 10 mm.
    Any ideas why this is happening?
    /Mats

    Hi,
    Partly solved:
    After some tests, it seems FM does not like when you try to move a text frame over a transparent area in an image. The image in question was made by importing a PDF into Photoshop, then saving as TIF. Since the PDF contained an area that was had full transparency in InDesign (i.e. "Paper"), that area was also in the TIF image.
    The strange behaviour starts exactly at the border where the transparency starts. In non-transparent areas, there is no problem.
    Seems like a bug.
    /Mats

  • Strange result from insert into...select query

    Hello guys,
    I need your preciuos help for a question maybe simple, but that I can't explain by myself!
    I have a query of "insert into...select" that, as I have explained in the title, returns a strange result. In facts, If I execute ONLY the SELECT statement the query returns the expected result (so 2 rows); instead If I execute the entire statement, that is the "insert into...select", the query returns 0 rows inserted!!
    Following an example of the query:
    INSERT
    INTO TITOLI_ORI
    COD_TITOLO_RICCONS ,
    D_ESTRAZIONE ,
    COD_SOCIETA ,
    COD_PIANO_CONTABILE ,
    COD_CONTO_CONTABILE ,
    COD_RUBRICATO_STATISTICO_1 ,
    COD_NDG ,
    NUM_ESEGUITO ,
    CUR_IMPORTO_RICCONS ,
    CUR_IMPORTO_BICO ,
    FLG_MODIFICATO ,
    CUR_NON_ASSEGNATO ,
    FLG_QUOTATO ,
    COD_CATEG ,
    TIP_COPERTURA ,
    TIPTAS_TITOLO
    SELECT NEWID,
    '28-feb-2111',
    COD_SOCIETA,
    COD_PIANO_CONTABILE,
    COD_CONTO_CONTABILE,
    COD_RUBRICATO_STATISTICO_1,
    COD_NDG,
    NUM_ESEGUITO,
    CUR_VAL_IMPEGNI,
    'ABC' as CUR_IMPORTO_BICO,
    0 as FLG_MODIFICATO,
    NULL as CUR_NON_ASSEGNATO,
    FLG_QUOTATO,
    COD_CATEG,
    TIP_COPERTURA,
    TIP_TASSO
    FROM
    (SELECT S.COD_SOC AS COD_SOCIETA,
    S.TIP_PIANO_CNTB AS COD_PIANO_CONTABILE,
    S.COD_CONTO_CNTB AS COD_CONTO_CONTABILE,
    S.COD_RUBR_STAT AS COD_RUBRICATO_STATISTICO_1,
    TRC.COD_RAGGR_IAS AS COD_RAGGRUPPAMENTO_IAS,
    TRC.COD_NDG AS COD_NDG,
    TRC.COD_ESEG AS NUM_ESEGUITO,
    CAST((TRC.IMP_PLUS_MINUS_VAL/TRC.IMP_CAMB) AS FLOAT) AS CUR_VAL_IMPEGNI,
    TRC.TIP_QUOTAZ AS FLG_QUOTATO,
    TRC.COD_CAT_TIT AS COD_CATEG,
    TIP_COP AS TIP_COPERTURA,
    T.TIP_TASSO AS TIP_TASSO
    FROM S_SLD_CNTB S
    INNER JOIN
    (SELECT DISTINCT COD_SOC,
    TIP_PIANO_CNTB,
    COD_CONTO_CNTB,
    COD_RUBR_STAT ,
    COD_INTER_TIT AS COD_INTER
    FROM S_COLLEG_CONTO_CNTB_TIT
    WHERE COD_SOC = 'ME'
    ) CCC
    ON S.COD_SOC = CCC.COD_SOC
    AND S.TIP_PIANO_CNTB = CCC.TIP_PIANO_CNTB
    AND S.COD_CONTO_CNTB = CCC.COD_CONTO_CNTB
    AND S.COD_RUBR_STAT = CCC.COD_RUBR_STAT
    INNER JOIN S_TIT_RICCONS TRC
    ON CCC.COD_INTER = TRC.COD_INTER_TIT
    AND CCC.COD_SOC = TRC.COD_SOC
    AND TRC.COD_RAGGR_IAS = RTRIM('VALUE1 ')
    AND TRC.COD_RAGGR_IAS NOT IN ('VALUE2')
    AND TRC.DES_TIP_SLD_TIT_RICCONS IN ('VALUE3')
    AND TRC.DES_MOV_TIT = RTRIM('VALUE4 ')
    AND TRC.COD_CAT_TIT = RTRIM('VALUE4 ')
    AND TRC.COD_INTER_TIT = RTRIM('VALUE5')
    AND '28-feb-2011' = TRC.DAT_RIF
    LEFT JOIN S_TIT T
    ON T.COD_INTER_TIT = TRC.COD_INTER_TIT
    AND T.COD_SOC = TRC.COD_SOC
    AND '28-feb-2011' = T.DAT_RIF
    INNER JOIN S_ANAG_SOGG AG
    ON TRC.COD_NDG = AG.COD_NDG
    AND AG.COD_SOC = TRC.COD_SOC
    AND '28-feb-2011' = AG.DAT_RIF
    WHERE S.DAT_RIF = '28-feb-2011'
    AND (S.FLG_ANULL_BICO = 0
    OR S.FLG_ANULL_BICO IS NULL)
    AND S.COD_SOC = 'V6'
    AND LENGTH(RTRIM(S.COD_CONTO_CNTB)) = 10
    AND S.TIP_PIANO_CNTB = 'V7'
    AND TRC.IMP_PLUS_MINUS_VAL < 0
    AND SUBSTR(S.COD_CONTO_CNTB,1,7) IN (RTRIM('VALUE8 '))
    Thanks a lot

    Right, I have executed this steps:
    - I have changed the query with the select count(*)
    - Changed the insert into with the select count(*)
    - Executed the insert into
    These are the result:
    SQL> select count(*) from TITOLI_ORI2;
    COUNT(*)
    1
    BUT:
    SQL> select * from TITOLI_ORI2;
    A
    0
    The insert into that I've modified is this:
    INSERT INTO bsc.TITOLI_ORI2
    select count(*)
    FROM
    (SELECT bsc.NEWID,
    TO_DATE('28-feb-2111','DD-MON-YYYY') as data,
    COD_SOCIETA,
    COD_PIANO_CONTABILE,
    COD_CONTO_CONTABILE,
    COD_RUBRICATO_STATISTICO_1,
    COD_NDG,
    NUM_ESEGUITO,
    CUR_VAL_IMPEGNI,
    'ABC' AS CUR_IMPORTO_BICO,
    0 AS FLG_MODIFICATO,
    NULL CUR_NON_ASSEGNATO,
    FLG_QUOTATO,
    COD_CATEG,
    TIP_COPERTURA,
    TIP_TASSO
    FROM
    (SELECT S.COD_SOC AS COD_SOCIETA,
    S.TIP_PIANO_CNTB AS COD_PIANO_CONTABILE,
    S.COD_CONTO_CNTB AS COD_CONTO_CONTABILE,
    S.COD_RUBR_STAT AS COD_RUBRICATO_STATISTICO_1,
    TRC.COD_RAGGR_IAS AS COD_RAGGRUPPAMENTO_IAS,
    TRC.COD_NDG AS COD_NDG,
    TRC.COD_ESEG AS NUM_ESEGUITO,
    CAST((TRC.IMP_PLUS_MINUS_VAL/TRC.IMP_CAMB) AS FLOAT) AS CUR_VAL_IMPEGNI,
    TRC.TIP_QUOTAZ AS FLG_QUOTATO,
    TRC.COD_CAT_TIT AS COD_CATEG,
    TIP_COP AS TIP_COPERTURA,
    T.TIP_TASSO AS TIP_TASSO
    FROM bsc.S_SLD_CNTB S
    INNER JOIN
    (SELECT DISTINCT COD_SOC,
    TIP_PIANO_CNTB,
    COD_CONTO_CNTB,
    COD_RUBR_STAT ,
    COD_INTER_TIT AS COD_INTER
    FROM bsc.S_COLLEG_CONTO_CNTB_TIT
    WHERE COD_SOC = 'ME'
    ) CCC
    ON S.COD_SOC = CCC.COD_SOC
    AND S.TIP_PIANO_CNTB = CCC.TIP_PIANO_CNTB
    AND S.COD_CONTO_CNTB = CCC.COD_CONTO_CNTB
    AND S.COD_RUBR_STAT = CCC.COD_RUBR_STAT
    INNER JOIN bsc.S_TIT_RICCONS TRC
    ON CCC.COD_INTER = TRC.COD_INTER_TIT
    AND CCC.COD_SOC = TRC.COD_SOC
    AND TRC.COD_RAGGR_IAS = RTRIM('HFT ')
    AND TRC.COD_RAGGR_IAS NOT IN ('GPO')
    AND TRC.DES_TIP_SLD_TIT_RICCONS IN ('DISPONIBILI')
    AND TRC.DES_MOV_TIT = RTRIM('CONSEGNARE ')
    AND TRC.COD_CAT_TIT = RTRIM('OBBLIGAZIONE ')
    AND TRC.COD_INTER_TIT = RTRIM('334058')
    AND '28-feb-2011' = TRC.DAT_RIF
    LEFT JOIN bsc.S_TIT T
    ON T.COD_INTER_TIT = TRC.COD_INTER_TIT
    AND T.COD_SOC = TRC.COD_SOC
    AND '28-feb-2011' = T.DAT_RIF
    INNER JOIN bsc.S_ANAG_SOGG AG
    ON TRC.COD_NDG = AG.COD_NDG
    AND AG.COD_SOC = TRC.COD_SOC
    AND '28-feb-2011' = AG.DAT_RIF
    WHERE S.DAT_RIF = '28-feb-2011'
    AND (S.FLG_ANULL_BICO = 0
    OR S.FLG_ANULL_BICO IS NULL)
    AND S.COD_SOC = 'ME'
    AND LENGTH(RTRIM(S.COD_CONTO_CNTB)) = 10
    AND S.TIP_PIANO_CNTB = 'IS'
    AND TRC.IMP_PLUS_MINUS_VAL < 0
    AND SUBSTR(S.COD_CONTO_CNTB,1,7) IN (RTRIM('P044C11 '))
    Another time the strange result returns!!
    And I've created the table TITOLI_ORI2 as create table TITOLI_ORI2 (a number); to contain the number result of the query.

  • Strange Behaviour into Runtime Workbench

    Hi all,
    I have a question for us.
    Into our system PI 7.1 we have a strange behaviour in Runtime Workbench - Message Monitoring.
    When I choose for the fiel "FROM" the value "Database" I obtain the list of software component that I find the value "Integration Server".
    But when I choose the value "Database (Overview)" the value "Integration Server" into list of software component doesn't exist.
    Why Do the system have this behaviour?
    best regards,
    Davide Bruno

    Hey,
           The old way of seeing msg use - the db option... In Pi 71 the db overiew options gives you an aggregated view of ur messages. this is very helpful in tracking repeated failures, anylysing the types of failures etc...The "strange" view is actually a pretty neat tool... We used to do this in excel sheets after dowloading the  report from sxmb_moni..
    regards,
    Arvind R

  • SQL Loader-How to insert -ve & date values from flat text file into coloumn

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide.

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide. Try something like
    someDate    DATE 'DDMMYYYY'
    someNumber1      "TO_NUMBER ('s99999999.00')"
    someNumber2      "TO_NUMBER ('99999999.00s')"Good luck,
    Eric Kamradt

  • Help with a flash html inserting into DW

    Hello,
    I have created a enquiry section in flash for one of my html DW pages for my site. When I publish the flash doc ti creates a html page (Contact.html). When I open the flash html page in DW or upload it to my server, everything works fine. I recieve an email at my prefered destination etc etc. But as its only a section of my contact page of my website i need to insert it into my site page (get_in_touch.html) soon as i try and take all the stuff from contact.html and insert it into a div in my get_in_touch.html it doesn't respond when the submit button is pressed..... Can someone please help!!!!!
    Dan

    Thanks for all your help. I've managed to sort out the problem, still not
    sure what it was.... My sites live now.
    Just one question for you if you dont mind.
    The page which has the flash on it (yes this one again!) Well if someone
    goes to the page with out having flash player installed on their machine,
    i'm looking for some script to detect that there computer doesn't have
    Flash and redirect them to another html page I've created.
    Would really appreciated any advice you may have.
    many thanks,
    Dan
                                                                                    pziecina                                                 
                 <[email protected]>                                                                               
    To
                 09/09/2009 16:40                Daniel Herrington        
                                                 <[email protected]
                                                 m>                       
                    Please respond to                                       cc
                 clearspace-571537347-50                                  
                 [email protected]                               Subject
                      ums.adobe.com              Help with a
                                                 flash html inserting into DW
                                                                                    Hi
    Somewhere above your tag, you will have a line similar to this - Also in your tag the swf file -
    These are the files that I said may be wrong or missing.
    However if you just edit the flash generated page and include the items you
    require in this, and maintain the same file position, you should have no
    problems,
    PZ

  • I need to make a copy of an entire email, including the header w/the sender's info and time, etc. to insert into a letter, etc. How can I do this w/out cutting and paste and doing the header separately from the text.

    I need to make a copy of an entire email, including the header w/the sender's info and time, etc. to insert into a letter, etc. How can I do this w/out cutting and pasting   the header separately from the text. I know there is a way besides a screen shot but I've spend hours trying to find it.

    Smurfslayer wrote:
    For the particularly persnickety types you might want to expose the full headers in the email message as well.  It's easy enough to do, from mail's 'menu' select "view"; then "message"; then all headers.
    Another option you could use is a screen capture using Grab.
    Activate Grab, then shift + command + w (for a window screen shot).  Then confirm the window selection and click the mail message. 
    Dave
    Why are you addressing this to me...?
    I am not the OP...

  • Read text file insert into table using utl_file

    Hi
    i have script for read and insert into table but i want error records load into error table so i sent you my script and please fix the error log table
    script
    DECLARE
    v_line VARCHAR2(2000);
    v_file utl_file.file_type;
    v_dir VARCHAR2(250);
    v_filename VARCHAR2(50);
    BEGIN
    v_dir :='MID5010_DOC1TP';
    v_filename := 'OPT_CM_BASE.txt';
    v_file := utl_file.fopen(v_dir, v_filename, 'r');
    LOOP
    BEGIN
    utl_file.get_line(v_file, v_line);
    EXCEPTION
    WHEN no_data_found THEN
    EXIT;
    END ;
    v_line := REPLACE(v_line,'|','|~');
    INSERT
    INTO optum_icd10cm_base VALUES
    ( REPLACE(TRANSLATE(regexp_substr(v_line,'[^|~]+',1,1),'a~','a'),'.'),
    TRANSLATE(regexp_substr(v_line,'[^|~]+',1,2),'a~','a'),
    TRANSLATE(regexp_substr(v_line,'[^|~]+',1,3),'a~','a'),
    TRANSLATE(regexp_substr(v_line,'[^|~]+',1,4),'a~','a'),
    TRANSLATE(regexp_substr(v_line,'[^|~]+',1,5),'a~','a'),
    CASE
    WHEN LENGTH(regexp_substr(v_line,'[^|~]+',1,6)) < 10
    THEN to_date(ltrim(TRANSLATE(regexp_substr(v_line,'[^|~]+',1,6),'a~','a'),'0'),'mm-yyyy')
    ELSE to_date(TRANSLATE(regexp_substr(v_line,'[^|]+',1,6),'a~','a'),'mm-dd-yyyy')
    END,
    CASE
    WHEN LENGTH(regexp_substr(v_line,'[^|~]+',1,7)) < 10
    THEN to_date(ltrim(TRANSLATE(regexp_substr(v_line,'[^|~]+',1,7),'a~','a'),'0'),'mm-yyyy')
    ELSE to_date(TRANSLATE(regexp_substr(v_line,'[^|]+',1,7),'a~','a'),'mm-dd-yyyy')
    END,
    CASE
    WHEN LENGTH(regexp_substr(v_line,'[^|~]+',1,8)) < 10
    THEN to_date(ltrim(TRANSLATE(regexp_substr(v_line,'[^|~]+',1,8),'a~','a'),'0'),'mm-yyyy')
    ELSE to_date(TRANSLATE(regexp_substr(v_line,'[^|]+',1,8),'a~','a'),'mm-dd-yyyy')
    END,
    CASE
    WHEN LENGTH(regexp_substr(v_line,'[^|~]+',1,9)) < 10
    THEN to_date(ltrim(TRANSLATE(regexp_substr(v_line,'[^|~]+',1,9),'a~','a'),'0'),'mm-yyyy')
    ELSE to_date(TRANSLATE(regexp_substr(v_line,'[^|]+',1,9),'a~','a'),'mm-dd-yyyy')
    END,
    CASE
    WHEN LENGTH(regexp_substr(v_line,'[^|~]+',1,10)) < 10
    THEN to_date(ltrim(TRANSLATE(regexp_substr(v_line,'[^|~]+',1,10),'a~','a'),'0'),'mm-yyyy')
    ELSE to_date(TRANSLATE(regexp_substr(v_line,'[^|]+',1,10),'a~','a'),'mm-dd-yyyy')
    END,
    TRANSLATE(regexp_substr(v_line,'[^|~]+',1,11),'a~','a')
    -----commit;
    END LOOP;
    utl_file.fclose(v_file);
    END;
    text file
    A50.0||Short|Long|Full|01-01-2009|01-2009||01-01-2013|09-18-2012|C|
    A50.1||Short|Long|Full|01-01-2009|01-01-2009||001-2013|09-18-2012|C|
    A50.2||Short|Long|Full|01-01-2009|01-01-2009|67|01-01-2013|09-18-2012|C|
    A50.3||Short|Long|Full|011-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A50.4||Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|5|
    A50.5|R|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A50.6||Short|Long||01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A50.7||Short||Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    2345||Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.0|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.1|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.2|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.3|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.4|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.5|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.6|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.7|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.8|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A60.9|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A70.0|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A70.1|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A70.2|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A70.3|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A70.4|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    B222|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A4.1|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A4.2|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A4.3|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A4.4|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A4.5|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A4.6|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A4.7|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A4.8|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A4.9|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A5.0|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A5.1|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A5.2|D|Short|Long|Full|01-01-2009|01-01-2009|01-10-2013|01-01-2013|09-18-2012|C|
    A5.3|D|Short|Long|Full|01-01-2009|01-01-2009|01-10-2013|01-01-2013|09-18-2012|C|
    D642|D|Short|Long|Full|01-01-2009|01-01-2009|01-10-2013|01-01-2013|09-18-2012|C|
    A5.5|D|Short|Long|Full|01-01-2009|01-01-2009|01-10-2013|01-01-2013|09-18-2012|C|
    A5.6|D|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A5.7|C|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A001|C|Short Updated|Long Updated|Full Updated|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A009|C|Short Updated|Long Updated|Full Updated|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A5.10|C|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A0109|C|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    F10.0|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    F10.1|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    F10.2|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    F10.3|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    F10.4|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    F10.5|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    F10.6|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    F10.7|N|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A30|C|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A316|C|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    A317|C|Short|Long|Full|01-01-2009|01-01-2009||01-01-2013|09-18-2012|C|
    ----clearly read text file insert into table and error records load into error table
    please help me

    hI
    i am using utl_file prepared script but i got error like 01861. 00000 - "literal does not match format string"
    script:
    DECLARE
    f utl_file.file_type;
    s VARCHAR2(32000);
    f1 VARCHAR2(100);
    f2 varchar2(100);
    F3 VARCHAR2(100);
    F4 VARCHAR2(100);
    F5 VARCHAR2(100);
    F6 DATE;
    F7 DATE;
    F8 DATE;
    F9 DATE;
    F10 DATE;
    f11 CHAR(1);
    BEGIN
    --DBMS_OUTPUT.ENABLE(100000);
    f := utl_file.fopen('MID5010_DOC1TP', 'OPT_CM_BASE.txt', 'R');
    LOOP
    BEGIN
    UTL_FILE.GET_LINE(f, s);
    f1 := REGEXP_SUBSTR (s,'[^|]+',1,1);
    f2 := REGEXP_SUBSTR (REPLACE(s,'||','||'),'[^|]+', 1,2);
    F3 := REGEXP_SUBSTR (REPLACE(s,'||','||'),'[^|]+', 1,3);
    F4 := REGEXP_SUBSTR (REPLACE(s,'||','||'),'[^|]+', 1,4);
    F5 := REGEXP_SUBSTR (REPLACE(s,'||','||'),'[^|]+', 1,5);
    F6 := to_date(REGEXP_SUBSTR (REPLACE(s,'||','||'),'[^|]+',1,6),'mm-dd-yyyy');
    F8 := to_date(REGEXP_SUBSTR (REPLACE(s,'||','||'),'[^|]+',1,8),'mm-dd-yyyy');
    F7 := to_date(REGEXP_SUBSTR (REPLACE(s,'||','||'),'[^|]+',1,7),'mm-dd-yyyy');
    F9 := to_date(REGEXP_SUBSTR (REPLACE(s,'||','||'),'[^|]+',1,9),'mm-dd-yyyy');
    F10 :=to_date(REGEXP_SUBSTR (REPLACE(s,'||','||') ,'[^|]+',1,10),'mm-dd-yyyy');
    f11 := REGEXP_SUBSTR (REPLACE(s,'||','||'),'[^|]+', 1,11);
    INSERT
    INTO OPTUM_ICD10CM_BASE
    ( CODE,
    STATUS,
    SHORT_DESCRIPTION,
    LONG_DESCRIPTION,
    FULL_DESCRIPTION,
    CODE_EFFECTIVE_DATE,
    CHANGE_EFFECTIVE_DATE,
    TERMINATION_DATE,
    RELEASE_DATE,
    CREATION_DATE,
    VALIDITY
    VALUES
    F1,
    F2,
    F3,
    F4,
    F5,
    F6,
    F7,
    F8,
    F9,
    F10,
    f11
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    END;
    END LOOP;
    UTL_FILE.FCLOSE(F);
    END;
    please help me(in my org looks utl_file standards only)

  • Can I insert an html file as an image into an HTML page?

    The site I'm working on (www.ngospen.com) has PNGs for background art - 10 - 15 kb per image. As the site is intended for settings with low bandwidth, I'd like these background images to be as small as possible.
    When saving for the web, one of the options is Save As HTML file. When I open the file, the artwork appears the same as the PNG (no lost resolution), but it is a much smaller file size (1 - 2 KB).
    Is it possible to insert these HTML files into my HTML pages?
    Thanks!
    Ken D
    Creative Director
    Grateful Creative

    Are you meaning that you work with fireworks?
    If so the html and the images you export are flattened images (slices), you have to put those images directly into your html page.
    If you want to save the file (fireworks) as a flattened image you could also goto save as -> flattened png.
    If you save your image from fireworks just as png it contains the layer information etc. etc. from fireworks, that's why you should save them as flattened png, or just export the slices.
    http://www.dreamweaverfan.nl

  • [IDCS3 WIN Insert Text Variables into a document

    Hi all.
    Please, I need insert a Text Variable into a document.
    This document is not open in a window (I am importing it).
    Using ITextVariableSuite is not possible.
    Any idea, suggestion, way of work,...?
    Thanks in advance.
    Best regards,
    Juanma.

    When you are posting on both the mac and windows forum it would be nice to say so.
    When you are asking questions about the development of plugins, please do so on the appropriate forum: http://www.adobeforums.com/webx/.ee6b334/
    We are all end users here.

  • Pool data from text file and insert into database

    Can anyone tell me how to pool data from a text file and insert into database?
    let's say my text file is in this format
    123456 Peter 22
    234567 Nicholas 24
    345678 Jane 20
    Then I need to insert the all the value for this three column into a table which has the three column name ID, Name, Age
    Anyone knows? I need to do this urgently...Thank in advanced

    1. Use BufferedReader and read the file line by line.
    2. Loop thru the file and do the following steps with in this loop.
    3. Use StringTokenizer to seperate each line into three values (columns).
    4. Now create a insert statement with these values and add the statement to the batch (using addBatch() method of PreparedStatement or Statement).
    5. Finally (after exiting the loop), execute these batch of statements (using ps.executeBatch()).
    Sudha

  • Insert JAVA3D CODE into a HTML PAGE

    My java 3d code is working perfectly with javac and java command. I can see the result of my game in the appletviewer
    But when I want to insert the code into a html page,it dosen t work
    the java applet remain grey....
    Can someone tell me why and someone can tell me how to solve it
    Could you give me an example of HTML page using java 3D code with mulitple classes

    I don't know Java3D, but I know a little applets. :)
    Are you sure your browser understands the 3D API ?
    applets work with AWT and JDK1.1, (it's your browser than run your applet and not your jdk 1.3 or 1.4), so peraphs you should download a plug-in to run Java3D in your browser ?
    for example, if you want to use swing, you have to download a plug-in in your browser.
    and another problem is that different browsers work differently with a same applet : for example, IE 6.0 don't run than IE 4.0 or Netscape 3.0
    it's the internet's way of life... :)
    Good luck,
    David
    PS : sorry for my english, I'm from Paris ! :)

Maybe you are looking for