Losing carriage returns in textarea / using plpdf to generate report

Hello,
I'm using Apex 3.1.1 and Oracle 10g database. I would appreciate any suggestions on how I can preserve carriage returns in a textarea when sending the text to a package that generates a report. Please see example of current problem (below code). I'm using an onkeypress function to check for keycode = 13 when the Enter key is pressed -- that is working. I also created an alert to show the url value -- I can see the text on multiple lines, so that appears to be working as well. The textarea value parameter in the package is defined as varchar2. Per the support folks at plpdf.com, chr(13) indicates an explicit line break, and they told me to check my text. I don't know what I'm missing. Thank you for any suggestions you may have.
Lisa
  function callPLPDFRep()
      var url;
      url = '#OWNER#.' + $x('P&APP_PAGE_ID._REPORT_PROCEDURE').value + '?' + build_params();
      w = open(url, "winPDFRep", "Scrollbars=1, resizable=1, width=800, height=600");
      if (w.opener == null)
        w.opener = self;
        w.focus();
   function build_params()
    var lparms;
    lparms = '';
    lparms = lparms + '&p_incorrect=' + $x('P212_INCORRECT').value;
    lparms = lparms + '&p_correct=' + $x('P212_CORRECT').value;
    return lparms;
  }Text in textarea:
035 5768 06/15/2010
035 5768 06/16/2010
035 5768 06/17/2010
Printout on report:
035 5768 06/15/2010035 5768 06/16/2010035 5768 06/17/2010

Hello Michael,
Thank you for your response. After doing some researching and experimenting, here's what I have found so far.
First, using an onkeypress function to alert the keycode, a chr(13) is being returned when I press the Enter key in the textarea.
  function check_Enter(e)
    var keynum;
    var textval = $x('P212_INCORRECT').value;
    if(document.all) 
      keynum = e.keyCode
    else
      keynum = e.which
    alert(keynum);     
  }Next, when I access the value of the textarea via javascript with $x('P212_INCORRECT').value, the chr(13) is automatically converted to the newline character (\n). In an attempt to replace the \n with a \r so plpdf will recognize the carriage return, I added a javascript replace function before sending the text to the package, and it does not work.
  function build_params()
    var lparms;
    lparms = '';
    lparms = lparms + '&p_incorrect=' + $x('P212_INCORRECT').value;
    lparms = lparms + '&p_correct=' + $x('P212_CORRECT').value;
    alert(lparms.split(/\n/g).length - 1);  // confirm that a newline character is found
    lparms = lparms.replace( new RegExp( "\n", "g" ), "\r");  // replace newline character with carriage return
    return lparms;
  }When I tried to replace the newline character (\n) with chr(13), the chr(13) is printed out like it is text instead of a special character. In order to test that I have the correct syntax for the replace function in javascript, I tried replacing \n with '...', and then in the package that generates the PDF, I replaced the '...' with chr(13). That works!
In response to your comment about the PLPDF procedure for multi line section, I am using: plpdf.PrintMultiLineCell(180, 6, l_incorrect, '0', 0). As a newbie to javascript, I am not sure why replacing \n with \r is not working. Can you advise how to use a chr(13) in the javascript replace function and have it recognized as a special character and not text? I don't know how to view special characters in the textarea other than checking for them with javascript.
Thanks, Lisa

Similar Messages

  • Carriage Returns in Textarea field in APEX Mail

    Greetings all,
    I have a form that the users fill out and when they click submit it uses APEX Mail to send the contents to individuals in an HTML format. One of the fields is a text area where the individual will enter information like the sample below:
    First to Arrive:  Bob
    Second to Arrive: Jane
    Third to Arrive: Sandy
    Last to Arrive: FredWhen the email is received, instead of being on one line, each entry follows the next like:
    First to Arrive: Bob Second to Arrive: Jane Third to Arrive: Sandy Last to Arrive: Fred
    I posted about getting the form fields to show the carriage returns and that works fine. Now trying to figure out what to add to make sure that line breaks are handles as html breaks br tags. Any assistance and examples would be appreciated.
    Thanks
    Wally
    Edited by: wfsteadman on Feb 17, 2011 4:49 PM

    3.  Re: Carriage Returns in Textarea field in APEX Mail
           617301
    this code looks like it should work but doesnt,
    REPLACE(REPLACE(REPLACE(:TEXT_FIELD_ITEM,CHR(10)||CHR(13),'<br/>'),CHR(10),'<br/>'),CHR(13),'<br/>')
    ....thanks.

  • Carriage return in textarea - how do I check for and remove it???

    I have an html form that has a <textarea> element for user input. I work mainly with Java and some JavaScript. Since carriage returns are permitted in a <textarea> element, upon retrieving the value submitted, my Java and/or JavaScript variables contain carriage returns as well, making the values incomplete.
    For Example :
    String dataSubmitted = request.getParameter("formInput");
    <script language="JavaScript">
    var textValue = "<%=dataSubmitted%>";
    ....//do other stuff
    </script>When I view the source of my JSP page, the above statement of code looks like this:
    var textValue = "This is some text that
    I submitted with a carriage return";I'm putting the text submitted through this form into a mysql database, and when I pull up the values I find that it has recorded the carriage return as well. There is an actual symbol representing a carriage return in the db field.
    What I'd like to do is use some Java code to go through each character of the String and find and remove the carriage return, perhaps replacing it with an empty space instead. But how do I check for a carriage return in a String variable?
    Also, is there a way to use JavaScript to alert the user when the carriage return button is pressed when they're in the <textarea>?
    Any input is appreciated,
    Thank You,
    -Love2Java

    What I'd like to do is use some Java code to go through
    each character of the String and find and remove the
    carriage return, perhaps replacing it with an empty
    space instead. But how do I check for a carriage return
    in a String variable?The carriage return is represented by the \r. Generally there is also a newline, the \n. You can use String#replaceAll() to replace occurences of them by a space.
    string = string.replaceAll("\r\n", " ");
    Also, is there a way to use JavaScript to alert the user
    when the carriage return button is pressed when they're
    in the <textarea>?You can capture keys using the 'onkeypress' attribute. The keyCode of a the return key is 13. So simply catch that:<textarea onkeypress="if (event.keyCode == 13) alert('You pressed the return button.'); return false;"></textarea>The return false prohibits the linebreak being inserted. If you remove that, then it will be inserted anyway.

  • Carriage return in TextArea Flash component in Director 11

    Hello.
    I have a very big problem now
    Neither embedded Flash movies with textareas or standard flashcomponent TextArea from Director tool pallete do not react on keyboard button "Enter" pressings. There is no carriage return after ENTER button is pressed. The same with End and Home buttons!!
    Please help with any advise.
    Is that a common bug?
    See attached test.dir file. Try to type something in both textareas and then press ENTER button on keyboard. You should realize then what I'm crying about(((
    Alexey

    I too struggled with this issue. If you're looking for a solution still I have written one. Used the attached script in your Flash document, I spent a few days going back and forth between Director and Flash to figure this one out. Basically what I do is attach a key listener to the movieclip containing the textfield object that on keyDown gets the currently focused textField (this way it will work with multiple textField objects). After that it determines if the enter key is hit and if it is inserts a "/n" break at the selection starting point. The only issue is if you select a whole word in the textField and hit enter a break will be placed at the beginning of the highlighted word and that word will not be deleted. Hopefully this helps.
    -b
    // BY / contempt.productions inc.  10.30.09
    // Director 11.5 fix for bug where dynamic textfields don't register ENTER or RETURN key in Flash sprites
    // Solution involves inserting a \n carriage return wherever cursor insertion point starts.
    // In Flash this adds 2 carriage returns for every hit of the enter/return key
    // In Director 11.5 it adds 1 carriage return
    // Change "body_txt" to represent the dynamic textField object this script is referencing
    myListener = new Object();
    myListener.onKeyDown = function() {
    _global.textFocus = Selection.getFocus();
    // get a string of the path to the currently focused textField object
    _global.selStart = Selection.getBeginIndex();
    // get the insertion point, this is the start of any selection
    var multiText = body_txt.text;
    // get the text from the current textField object
    var theKey = Key.getCode();
    // get the current keyCode (13 is the keyCode for "enter/return" key)
    if (eval(textFocus) == eval(body_txt)) {
    // determine if focused textField and current textField are the same
    if (theKey == 13) {
    // enter key is pressed
    var firstPart = multiText.slice(0, selStart);
    // get the current textField's text from the beginning to the insertion point
    var secondPart = multiText.slice(selStart, multiText.length);
    // get the textField's text from the insertion point to the string's end
    body_txt.text = firstPart+"\n"+secondPart;
    // concatenate the first and second part of the textField's text with a carriage return
    Selection.setSelection(selStart+1,selStart+1);
    // place the text insertion point properly
    myListener.onKeyUp = function() {
    var theKey = Key.getCode();
    Key.addListener(myListener);

  • Carriage return in textArea

    Hi, I have a problem about the textArea. When I compile a textarea the carriage return is casual because it doesn't work as an editor text program. So the words that I write are "break off" casually.How can I implement a textArea that simulate an editor text program about carriage return? Is exist an option in the properties of the textarea in NetBeans 4.0 that implement it?
    Thanks!

    An example:
    if I write in runtime in the textArea this words:
    "Yesterday I played in the garden with my dog and then I studied Java in my bedroom"
    and the dimension's textArea is more small than the dimension of the sentence writed above, I have the next view in the textarea:
    "Yesterday I played in the garden with my dog and then I s
    tudied Java in my bedroom"
    Instead I want that the word "studied" doesn't break off as in the next example
    "Yesterday I played in the garden with my dog and then I
    studied Java in my bedroom"

  • Using SQVI to generate report of open and released delivery schedule lines

    All,
    I'm using SQVI  to generate an excel spreadsheet for some buyers to show open released schedule lines because they are a 1 line item per scheduling agreement company.
    I used the logical database MEPOLDB instead of a table joint and pulled fields from EKKO(vendor, SA #,&purchasing group), EKPO(Material Number), EKEH(schedule line type), and EKET(delivery date, scheduled qty,previous qty).
    Does this sound like I'll get the results I want on paper as long as I use the right selection criteria, because the report I'm getting isn't quite what I expect? I am unable to identify which lines are authorized to ship vs. trade-off zone, planning, etc. in the report thus far.

    Hi Mark,
                 I have faced same requirement. I am not sure about transporting to TST and PROD. I done by this way.
    After generating SQVI program in DEV , I assigned that program  to a transaction and tested in DEV. Later i have regenarated SQVI in Production. then I assigned the generated Program to same transaction in DEV. And transported the Tcode assignment of program to Production..
    About authorization , if its not sensitive report, BASIS can restrict at transaction level.
    Regards,
    Ravi.

  • Investigating carriage returns in communities using various Apple products

    Testing the ability to read and post in an Apple community from PC, iPhone and iPad using "return" to space paragraphs.
    This is a new paragraph and should have a line break in between
    Multiple line breaks in between
    More line breaks
    End

    It seems that from an iPhone, the line breaks are replaced with the following code:
    <p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
    Putting some additional line breaks from a Windows PC here to test. Via the PC, the reply input contains a WYSIWYG RTE whereas the iPhone contained what looked like a text area

  • How to Add Carriage Return After PageBreak using XSL code?

    Hi,
    I have created one RTF Template for Check printing. My requirement is to print check on next page if total number of invoices exceeds certain value.
    I achieved this and used below condition in my RTF Template.
    <xsl:if xdofo:ctx="inblock" test="count($invLines)>=$lpp"><xsl:attribute name="break-after">page</xsl:attribute></xsl:if>
    "lpp" is global variable whose value is set at the start of template. Now i also want to add some space after pagebreak in my Template.
    Like presently, check prints at the top of page, so i want to print it after leaving 9-10 lines blank.
    Can anyone please help me to achieve this?
    Thanks
    Amit

    Hi,
    I tried below syntax but its working only for first page, its not giving space for second page
    <xsl:if xdofo:ctx="inblock" test="count($invLines)>$lpp"><xsl:attribute name='space-after'>700pt</xsl:attribute></xsl:if>
    I want to combine it with page-break. Like i need specific space only after page break. I tried to combine both, but its not working. Any inputs on these?
    <xsl:if xdofo:ctx="inblock" test="count($invLines)>$lpp"><xsl:attribute name='space-after'>100pt</xsl:attribute>
    <xsl:attribute name="break-after">page</xsl:attribute></xsl:if>
    Thanks
    Amit
    Edited by: user11982820 on Apr 14, 2010 5:52 AM

  • Using Webi to generate report from Microsoft Project?

    Does anyone know if there a way to create a Webi report from Microsoft Project?  Can put me in the right direction towards accomplishing this task?

    Hi,
    For this use Microsoft .Net with Integration of Business Intelligence(BI/BOBJ). Select web I reports with Crystal Reports generation and use in the .Net Project.
    All the Best
    Madhu.....

  • Using DisplayOutput() after generating report via PeopleCode??

    Hello!
    I'm working on my first XMLP report and they'd like the report to be generated and immediately pop up in a PDF format after they click a button in PeopleSoft. Unfortunately I'm getting a think-time error during my DisplayOutput() command and I don't know if it's something I missed or did incorrectly or if it's just not possible.
    Here's my code; it's on a Record Field FieldChange event.
    &sOutputFormat = "PDF";
    &sRptDefn = "KC_APPR_DOC";
    &sTemplateId = ""; /*should bring in default*/
    /*Set-Up Report*/
    &ReportDef = create PSXP_RPTDEFNMANAGER:ReportDefn(&sRptDefn);
    &ReportDef.Get();
    ...populate stand-alone rowsets via CreateRowset and then .Fill ...
    &sLangCode = &Lang_cd;
    /*Provide a Data Source for the Report*/
    &ReportDef.SetRuntimeDataRowset(&rs);
    /*Generate the Report*/
    &ReportDef.ProcessReport(&sTemplateId, &sLangCode, %Date, &sOutputFormat);
    &ReportDef.DisplayOutput(); /*causing a think-time error*/
    Everything goes great until the DisplayOutput command where I get the following think-time error:
    "Think-time PeopleCode event (ViewAttachment), but a SQL update has occurred in the commit interval. PSXP_RPTDEFNMANAGER.Utility.OnExecute Name:zipandViewAttachment PCPC:2423 Statement:51
    Called from:PSXP_RPTDEFNMANAGER.ReportDefn.OnExecute Name:DisplayOutput Statement:1312
    Called from:EP_BTN_LINK_WRK.EP_PRINT_PB.FieldChange Statement:48
    Think-time PeopleCode events such as messages requiring a user response cannot be executed if a SQL update, insert, or delete has occurred in the commit interval. Examples of PeopleCode that invoke update type of SQL includes Process Scheduler, TriggerBussinessEvent, or MarkWorked. A unit of work cannot contain both think-time events and update type SQL."
    I'm on PeopleSoft 8.9, bundle 14. PeopleTools 8.48.11.
    Thank you for any help you can give!
    Sandy

    I had the same error and this fixed the problem.
    /*generate and display report*/
    &oRptDefn.ProcessReport(&sTmpltID, &sLangCd, &AsOfDate, &sOutFormat);
    CommitWork(); /*I added this and error is gone */
    &oRptDefn.DisplayOutput();

  • Carriage returns in a textarea are not being stored ??

    Hello developers,
    Ive been looking a couple hours for a solution but cant find it.
    In my app users enter text into a textbox like im doing now.
    When i want to display the text it has lost the carriage returns.
    Im using tomcat and mysql here.
    A solution to deal with the returns ?

    Super thanx, kinda stupid of me i once used that <pre> a couple years ago..
    Its working fine now execpt for the fact tha i have one space before the text starts
    Like this
    sfslfj
    sfsafa
    afsasff
    produced by this code
    <sql:query var="empList" scope="session">
              SELECT * FROM vragen
              ORDER BY vraagnr ASC
         </sql:query>     
         <table width="90%" border="1">
         <c:forEach items="${empList.rows}" var="row">
    <tr>      
    <td border ="0"><c:out value="${row.vraagnr}"/> <td/></tr>
    <tr><td> <pre> <c:out value="${row.vraag}"/> </pre>
         </td>
         </tr>
         </c:forEach>
         </table>

  • Help needed with Carriage Return in Unicode system

    Hi Experts,
    we have an issue with one of our programs regarding the carriage return that is used when creating a csv file. This issue has only came about because of the recent upgrade to ECC6.
    The main change to the program was the redefinition of the line feed variable.
    Existing statement was --> DATA: v_lf TYPE x VALUE '0D'.
    This was then replaced with
    New statement --> DATA: v_lf type c VALUE cl_abap_char_utilities=>cr_lf.
    Since this change has been implemented, the csv file that is created and sent on as an attachment via the function SO_NEW_DOCUMENT_ATT_SEND_API1 is now not displayed correctly.
    When looking at the attachment in trn SOST, a message is also displayed saying the file is not in a recognizable format when selecting the file to view.
    The hex value for cl_abap_char_utilities=>cr_lf is 000D000A and this seems to be causing the issue.
    I've also tried using Function FI_DME_CHARATERS as I only really want to use the CR. However, the hex value for this is 000D and not 0D.
    Is there any way of converting this to have a hex value of 0D?
    Thanks in advance,
    Chris

    HI,
    Sorry it is not the CONTENTS_TXT it is CONTENTS_BIN. Instead of CONTENTS_BIN you need to pass to CONTENTS_HEX
    Check my Code..i have used the CONTENTS_HEX instead of CONTENTS_BIN
    DATA: l_tab_lines TYPE i,
            l_string TYPE char300,
            l_line TYPE string.
      CONSTANTS : l_c_255(255)  TYPE c VALUE '255',
                  l_c_txt(3)    TYPE c VALUE 'TXT'.
      DATA: lt_reclist  TYPE STANDARD TABLE OF somlreci1,       "Recipients
            lt_objpack  TYPE STANDARD TABLE OF sopcklsti1,
            lt_objhead  TYPE STANDARD TABLE OF solisti1,
            lt_objtxt   TYPE STANDARD TABLE OF solisti1,     "Body of EMail
            lt_objbin   TYPE STANDARD TABLE OF solisti1."Attachment of EMail
      DATA: l_doc_chng TYPE sodocchgi1,     "attributes of document to send
            l_reclist  LIKE LINE OF lt_reclist,
            l_objpack  LIKE LINE OF lt_objpack,
            l_obj      LIKE LINE OF lt_objhead.
      DATA :
        l_hex LIKE solix,
        lt_contents_hex LIKE STANDARD TABLE OF solix ,
        conv TYPE REF TO cl_abap_conv_out_ce,
        l_buffer TYPE xstring,
        l_hexa(510) TYPE x.
    * Completing the recipient list
      l_reclist-receiver = p_emailid.
      l_reclist-express  = 'X'.
      l_reclist-rec_type = 'U'.
      APPEND l_reclist TO lt_reclist.
      CLEAR  l_reclist.
    * Body of Email Message
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
      l_obj-line = '<html>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = '<body>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<p><code>Hello,</p></code>'(t04).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = cl_abap_char_utilities=>newline.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
      CONCATENATE
       '<p><code>'(f01)
       'Please click the link to access the Confirmation Form.'(t01)
       'Kindly complete the same and return it to the HR contact 15 days' &
       ' prior to the date of confirmation of the employee.'(t02)
       '</p></code>'(f02) INTO l_obj-line SEPARATED BY space.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = cl_abap_char_utilities=>newline.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
      CONCATENATE '<a href="' text-l01 text-l02 '">'
             INTO l_obj-line.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      CONCATENATE  '<p><code>'(f01)
                   'Link to Confirmation Forms'(034)
                   '</p></code>'(f02)
                   '</a>'
             INTO l_obj-line.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = cl_abap_char_utilities=>newline.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
      l_obj-line = '<p><code>The details of the employees ' &
                   'are as follows:</p></code>'(017).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = cl_abap_char_utilities=>newline.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
    * Table headings in the Mail Body
      l_obj-line =  '<table border="1">'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<tr>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =   '<th><p><code>Name</p></code></th>'(030).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<th><p><code>Department</p></code></th>'(031).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<th><p><code>DOJ</p></code></th>'(032).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '<th><p><code>Confirmation Date</p></code></th>'(033).
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line =  '</tr>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
    ** Body of Email Message
    * Email Attachment
    * Append headings
      CONCATENATE 'Employee No.'(002)
                  'Employee Group'(016)
                  'Employee Name'(001)
                  'Designation'(003)
                  'Joining Date'(004)
                  'Department'(005)
                  'Branch/Location'(006)
                  'Unit'(007)
                  'Confirmation Due'(008)
                  'Form sent on'(009)
                  'Form Return by'(010)
                  'Employee Group'(016)
                  'Qualification'(012)
                  'Trainee Category'(013)
                INTO l_string
           SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
      APPEND l_string TO lt_objbin.
      CLEAR l_string.
      APPEND INITIAL LINE TO lt_objbin.
      LOOP AT p_emp_details INTO i_emp_details_line.
        CONCATENATE i_emp_details_line-pnalt
                    i_emp_details_line-egroup
                    i_emp_details_line-ename
                    i_emp_details_line-stext
                    i_emp_details_line-srvdt
                    i_emp_details_line-ltext
                    i_emp_details_line-pbtxt
                    i_emp_details_line-btrtx
                    i_emp_details_line-mndat
                    i_emp_details_line-fsdate
                    i_emp_details_line-frdate
                    i_emp_details_line-egroup
                    i_emp_details_line-ptext
                    i_emp_details_line-ftext
               INTO l_string
          SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
        APPEND l_string TO lt_objbin.
        CLEAR l_string.
        l_obj-line =  '<tr>'.
        APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
        CONCATENATE '<td>' '<p><code>'(f01)
                     i_emp_details_line-ename '</p></code>'(f02) '</td>'
                     INTO l_string.
        APPEND l_string TO lt_objtxt.   CLEAR l_string.
        CONCATENATE '<td>' '<p><code>'(f01)
                    i_emp_details_line-ltext '</p></code>'(f02) '</td>'
                    INTO l_string.
        APPEND l_string TO lt_objtxt.   CLEAR l_string.
        CONCATENATE '<td>' '<p><code>'(f01)
                    i_emp_details_line-srvdt '</p></code>'(f02) '</td>'
                    INTO l_string.
        APPEND l_string TO lt_objtxt.   CLEAR l_string.
        CONCATENATE '<td>' '<p><code>'(f01)
                    i_emp_details_line-mndat '</p></code>'(f02) '</td>'
                    INTO l_string.
        APPEND l_string TO lt_objtxt.   CLEAR l_string.
        l_obj-line =  '</tr>'.
        APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      ENDLOOP.
      l_obj-line = '  </table>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = '</body>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      l_obj-line = '</html>'.
      APPEND l_obj TO lt_objtxt.   CLEAR l_obj.
      IF r_cprob EQ 'X'.
        l_string = 'Completion of probation List'(018).
      ELSE.
        l_string = 'Completion of extension of probation List'(035).
      ENDIF.
      APPEND l_string TO lt_objhead.
    * APPEND object_header.
      CALL FUNCTION 'SO_RAW_TO_RTF'
        TABLES
          objcont_old = lt_objbin
          objcont_new = lt_objbin.
      LOOP AT lt_objbin INTO l_line.
       conv = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' endian = 'B').
        CALL METHOD conv->write( data = l_line ).
        l_buffer = conv->get_buffer( ).
        MOVE l_buffer TO l_hexa.
        MOVE l_hexa TO l_hex-line.
        APPEND l_hex TO lt_contents_hex.
      ENDLOOP.
    * File name for attachment
      CONCATENATE 'Completion of probation List'(018)
                   sy-datum '.XLS' INTO l_obj SEPARATED BY space.
      APPEND l_obj TO lt_objhead.
    * Email Body Details
      CLEAR l_tab_lines.
      DESCRIBE TABLE lt_objtxt LINES l_tab_lines.
      l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 +
                              STRLEN( l_string ).  "size of doc in bytes
      l_doc_chng-obj_name = sy-repid.
      l_doc_chng-obj_langu = sy-langu.
      l_doc_chng-obj_descr = l_string.
      l_doc_chng-sensitivty = 'P'.          "  Send mail as a confidential
      l_objpack-head_start = 1.
      l_objpack-head_num   = 1.
      l_objpack-body_start = 1.
      l_objpack-body_num   = l_tab_lines.
      l_objpack-doc_type   = 'HTML'. "l_c_txt.
      APPEND l_objpack TO lt_objpack.
      CLEAR  l_objpack.
    * Email Attachment Details
      CLEAR l_tab_lines.
      DESCRIBE TABLE lt_objbin LINES l_tab_lines.
    * Creation of the entry for the compressed attachment
      l_objpack-transf_bin = 'X'.
      l_objpack-head_start = 1.
      l_objpack-head_num   = 1.
      l_objpack-body_start = 1.
      l_objpack-doc_type   = 'XLS'.
      l_objpack-obj_name   = l_obj.
      l_objpack-obj_descr  = l_obj.
      l_objpack-body_num   = l_tab_lines.
      l_objpack-doc_size   = l_tab_lines * l_c_255.
      APPEND l_objpack TO lt_objpack.
      CLEAR  l_objpack.
    * Send the document
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = l_doc_chng
          put_in_outbox              = ' '
          commit_work                = 'X'
        TABLES
          packing_list               = lt_objpack
          object_header              = lt_objhead
    *      contents_bin               = lt_objbin
          contents_txt               = lt_objtxt
          contents_hex               = lt_contents_hex
          receivers                  = lt_reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.

  • How to put a carriage return in a String

    I am creating an error message on my class which is called and displayed on my JSP page.
    In my string I want it to do a Carriage return. I used a \n however it just ignores it when displayed in JSP using scriplets.
    Class declaration:
    -- Want this line to start on the next line..
    /** Used for the Error message for a text box. */
    private final String TEXTBOX_ERROR_MSG = "\n NOTE: The text box characters left count may not be accurate.";
    Used in getDBErrors() method:
    --errors is an array of error records displayed in the JSP
    if(this.notes != null && this.notes.length() > 4000)
         errors.add("Notes Tab: Notes section cannot be greater than 4000 characters." +  this.TEXTBOX_ERROR_MSG);
    JSP Page code:
    --Get the list of Errors from the class
    List pbrDBErrors = editBean.getDBErrors();     
    -- Display errors:
    for(int l=0; l<pbrDBErrors.size(); l++)
    %>
    <li>
        ----------- Display ERROR Message Here
        <%= (String)pbrDBErrors.get(l) %>
    </li>
    <%
    } %>++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    All the code works great - Its just the TEXTBOX_ERROR_MSG is displayed on the same line as the rest of the message and it scrolls off the page.
    How do it get it to do a cariage return?? \n does not seem to work.
    Thanks

    I learned something new today.. I guess I can go home :)
    I am creating an error message on my class which is
    called and displayed on my JSP page.
    In my string I want it to do a Carriage return. I
    used a \n however it just ignores it when displayed
    in JSP using scriplets.
    Class declaration:
    -- Want this line to start on the next line..
    /** Used for the Error message for a text box.
    private final String TEXTBOX_ERROR_MSG = "\n NOTE:
    The text box characters left count may not be
    accurate.";
    Used in getDBErrors() method:
    --errors is an array of error records displayed in
    the JSP
    if(this.notes != null && this.notes.length() >
    4000)
    errors.add("Notes Tab: Notes section cannot be
    ot be greater than 4000 characters." +
    this.TEXTBOX_ERROR_MSG);
    JSP Page code:
    --Get the list of Errors from the class
    List pbrDBErrors = editBean.getDBErrors();     
    -- Display errors:
    for(int l=0; l<pbrDBErrors.size(); l++)
    %>
    <li>
    ----------- Display ERROR Message Here
    <%= (String)pbrDBErrors.get(l) %>
    </li>
    <%
    } %>++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++
    All the code works great - Its just the
    TEXTBOX_ERROR_MSG is displayed on the same line as
    the rest of the message and it scrolls off the page.
    How do it get it to do a cariage return?? \n does not
    seem to work.
    ThanksThanks the <br> worked great....

  • XQuery contains function failing due to carriage return in XML

    I am trying to perform the following xquery:
    declare namespace tei="http://www.tei-c.org/ns/1.0";
    for $line in //tei:l
    where some $value in $line
    satisfies (contains($value, "A cherdd, myn Siat"))
    return $line
    this works fine for almost all cases except when al 'l' element contains a carriage return half way through it, e.g.
    <l n="15">A cherdd, myn Siat, yn
    batent</l>
    if I try to run the xquery above again to find the whole contents of the 'l' element it fails due to the carriage return
    declare namespace tei="http://www.tei-c.org/ns/1.0";
    for $line in //tei:l
    where some $value in $line
    satisfies (contains($value, "A cherdd, myn Siat, yn batent"))
    return $line
    I've been reading all the usual guides/sites and it seems that it might be possible to mitigate the effects of the 'carriage return' by the use of indexes. What I would really like to do however is to remove all the carriage returns. Does anyone know if it is possible to issue a command to dbxml to do this or should I just continue to investigate indexes?
    thanks in advance
    Edited by: user534203 on 27-Jul-2012 02:05

    I have found a solution to my problem.
    Basically, the problem was that my XML editor, Oxygen, has a 'pretty print' formatting command which cause windows line breaks to be introduced when XML lines get too long to make things easier to read.
    I was saving the files with these line breaks included. Instead I should have been saving the files using the Document>Source>Join and Normalize menu option (Ctrl J). This removes all of the offending line breaks and solves the search problem within the db.
    Hope this helps someone out there.
    :)

  • Carriage returns within an appointment

    Is there a way to modify iCal so that when you want to create a new line within an appointment you can use Return rather than have to type Option-Return? I moved over from Palm Desktop (because of its instability) and never had to use the option key while typing within an appointment. It's very annoying!

    The internal name of the field indicates its purpose - Summary. For longer, multi-line (with all the carriage returns you want) use the notes (description) field.
    AK

Maybe you are looking for