String lenght of a multy-byte string

Hi Friends,
I am working with multy-byte(Korea) Strings. What I am doing is I am looking for the presence of an english substring in a multybyte string, find out the position of this substring using java indexof ()method.I am facing a problem here. For the purpose of comparing I am doing a toUppercase() of the multybyte string . I have noticed that this toUppercase() changes the string length and the position of the substring identified by the indexof() method becomes wrong. I could not find out a way to apply indexof() method in an "ignore-case" mode. Is there any java methods to resolve this. Please tell me a way out of this .
This is a bit urgent. Thanks in advance!!!

Well, I'm not sure what doing toUpperCase does to non-ASCII characters. If you want to know if it's
English characters, you should probably do something else...
java.lang.Character
    public static char toUpperCase(char ch) {
        char mapChar = ch;
        int val = A[Y[((X[ch>>5]&0xFF)<<4)|((ch>>1)&0xF)]|(ch&0x1)];
        if ((val & 0x00010000) != 0) {
            if ((val & 0x07FC0000) == 0x07FC0000) {
                switch(ch) {
                    // map chars with overflow offsets
                    case '\u00B5' : mapChar = '\u039C'; break;
                    case '\u017F' : mapChar = '\u0053'; break;
                    case '\u1FBE' : mapChar = '\u0399'; break;
                    // map char that have both a 1:1 and 1:M map
                    case '\u1F80' : mapChar = '\u1F88'; break;
                    case '\u1F81' : mapChar = '\u1F89'; break;
                    case '\u1F82' : mapChar = '\u1F8A'; break;
                    case '\u1F83' : mapChar = '\u1F8B'; break;
                    case '\u1F84' : mapChar = '\u1F8C'; break;
                    case '\u1F85' : mapChar = '\u1F8D'; break;
                    case '\u1F86' : mapChar = '\u1F8E'; break;
                    case '\u1F87' : mapChar = '\u1F8F'; break;
                    case '\u1F90' : mapChar = '\u1F98'; break;
                    case '\u1F91' : mapChar = '\u1F99'; break;
                    case '\u1F92' : mapChar = '\u1F9A'; break;
                    case '\u1F93' : mapChar = '\u1F9B'; break;
                    case '\u1F94' : mapChar = '\u1F9C'; break;
                    case '\u1F95' : mapChar = '\u1F9D'; break;
                    case '\u1F96' : mapChar = '\u1F9E'; break;
                    case '\u1F97' : mapChar = '\u1F9F'; break;
                    case '\u1FA0' : mapChar = '\u1FA8'; break;
                    case '\u1FA1' : mapChar = '\u1FA9'; break;
                    case '\u1FA2' : mapChar = '\u1FAA'; break;
                    case '\u1FA3' : mapChar = '\u1FAB'; break;
                    case '\u1FA4' : mapChar = '\u1FAC'; break;
                    case '\u1FA5' : mapChar = '\u1FAD'; break;
                    case '\u1FA6' : mapChar = '\u1FAE'; break;
                    case '\u1FA7' : mapChar = '\u1FAF'; break;
                    case '\u1FB3' : mapChar = '\u1FBC'; break;
                    case '\u1FC3' : mapChar = '\u1FCC'; break;
                    case '\u1FF3' : mapChar = '\u1FFC'; break;
                    // ch must have a 1:M case mapping, but we
                    // can't handle it here. Return ch.
                    // since mapChar is already set, no need
                    // to redo it here.
                    //default       : mapChar = ch;
            else {
                int offset = val  << 5 >> (5+18);
                mapChar =  (char)(ch - offset);
        return mapChar;
    }

Similar Messages

  • How to find the last element of a byte array

    Dear all,
    I have a byte array with a max lenght of 1024*50 bytes. In that array I store the bytes read from a file. How can I find where the array ends (i.e. which is the last valid element of the byte array)?
    Thank you for your help.
    Best Regards,
    JIM

    I want to send files over TCP connection using BufferedOutputStreams and BufferedInputStreams. The first side (e.g. the client) sends a file (e.g mp3 file or jpeg image) to the server using the code
      public void sendFile(Socket s, String FileName) throws Exception
              BufferedOutputStream out = new BufferedOutputStream(s.getOutputStream());  
              BufferedInputStream in = new BufferedInputStream(new FileInputStream(FileName));
              int len = 0;
              while ( (len = in.read(buffer)) > 0) {
                out.write(buffer, 0, len);
              in.close();
              out.flush();
            }(The client does not close the BufferedOutputStream out because other files will be sent afterwards)
    Then, the server receives the file using the code:
            public void receiveFile(Socket s, String FileName) throws Exception
              OutputStream out = new BufferedOutputStream(new FileOutputStream(FileName)); 
              InputStream in = new BufferedInputStream(s.getInputStream());
              int len = 0;
              while ( (len = in.read(buffer)) > 0) {
                out.write(buffer, 0, len);
                break;
              out.flush();
              out.close();
            }(likewise the InputStream in is not closed for the same reasons).
    In order the server to receive the file and stop reading the BufferedInputStream, I will have to make some modifications to this part of the code,
    while ( (len = in.read(buffer)) > 0)so as to know when the whole file has been received.
    Thus, even if I send the length of each file, I will not be able to read it. Could you please recommend me a solution?

  • Characters (multi-byte) in printjoin ignored in context index

    Hi everybody,
    I have one problem with a challenging text search in our company. The paragraph-sign should be found in multiple searches so we need to index tokens containing it.
    To make clear what I found out so far I constructed a test case. Seems to be important that the database character set is AL32UTF8 (edit: Database Version is 11.2.0.3).
    So at first I built a test-table and filled it with some rows:
    CREATE TABLE test_tab (test_col VARCHAR2 (30));
    INSERT ALL
      INTO test_tab VALUES ('print§join')
      INTO test_tab VALUES ('print#join')
      INTO test_tab VALUES ('print*join')
      INTO test_tab VALUES ('print\join')
      INTO test_tab VALUES ('print-join')
      INTO test_tab VALUES ('print_join')
      INTO test_tab VALUES ('print~join')
      INTO test_tab VALUES ('print;join')
      INTO test_tab VALUES ('print:join')
      INTO test_tab VALUES ('print,join')
      INTO test_tab VALUES ('print.join')
      INTO test_tab VALUES ('print/join')
      INTO test_tab VALUES ('print+join')
    SELECT * FROM DUAL;
    After that I created index preferences and built an index:
    BEGIN
      ctx_ddl.create_preference(
        preference_name => 'auf_auftrag_lexer'
       ,object_name     => 'BASIC_LEXER'
      ctx_ddl.set_attribute(
        preference_name => 'auf_auftrag_lexer'
       ,attribute_name  => 'printjoins'
       ,attribute_value => '§-./+~#_\,;:*'
      ctx_ddl.set_attribute(
        preference_name => 'auf_auftrag_lexer'
       ,attribute_name  => 'punctuations'
       ,attribute_value => '!:.;,?'
      ctx_ddl.set_attribute(
        preference_name => 'auf_auftrag_lexer'
       ,attribute_name  => 'numjoin'
       ,attribute_value => ','
      ctx_ddl.set_attribute('auf_auftrag_lexer'
       ,attribute_name  => 'alternate_spelling'
       ,attribute_value => 'german'
    END;
    CREATE INDEX i_test_tab_ctx ON test_tab(test_col)
      INDEXTYPE IS ctxsys.CONTEXT PARAMETERS ('LEXER auf_auftrag_lexer
                                              WORDLIST auft_fuzzy_pref
                                              STOPLIST ctxsys.empty_stoplist
                                              SYNC (EVERY "SYSDATE+1/24/30")');
    So printjoins contains all the special characters used in the rows of the table.
    But when we examine the results of the indexed tokens:
    SELECT token_text FROM dr$i_test_tab_ctx$i;
    TOKEN_TEXT
    JOIN
    PRINT
    PRINT#JOIN
    PRINT*JOIN
    PRINT+JOIN
    PRINT,JOIN
    PRINT-JOIN
    PRINT.JOIN
    PRINT/JOIN
    PRINT:JOIN
    PRINT;JOIN
    PRINT\JOIN
    PRINT_JOIN
    PRINT~JOIN
    14 rows selected
    All rows are indexed correctly cos all the special characters are defined as printjoins. One row is missing - the row containing the paragraph sign is splitted in two tokens ("JOIN" and "PRINT"). The paragraph sign is treated as not existent in the printjoins attribute value (but it is defined with the correct codepoint in the ctx-View).
    The paragraph sign differs from the other special characters so far, that it is stored as a multi(2-)-byte-character in the db. Content of the test_tab table:
    DUMP(TEST_COL)
    Typ=1 Len=11: 112,114,105,110,116,194,167,106,111,105,110 §-Sign
    Typ=1 Len=10: 112,114,105,110,116,35,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,42,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,92,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,45,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,95,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,126,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,59,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,58,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,44,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,46,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,47,106,111,105,110
    Typ=1 Len=10: 112,114,105,110,116,43,106,111,105,110
    13 rows selected
    So I suspect the multy-byte character set as a cause of the problem. But documentation says BASIC_LEXER supports the character set. I can't determine whether the problem has to do with storing the index preferences or appears while indexing the data.
    Seems to be a non-common problem - ideas anybody
    Thx in Advance
    Stephan
    Edit:
    Missed one thing - the mentioned auft_fuzzy_pref for index creation is just set for configure the index as a substring index:
    EXEC ctx_ddl.create_preference('AUFT_FUZZY_PREF', 'BASIC_WORDLIST');
    EXEC ctx_ddl.set_attribute('AUFT_FUZZY_PREF','SUBSTRING_INDEX','TRUE');

    Hi Teresa,
    You can test to send the XML-Mesage in "ISO-8859-1" encoding.
    You Chance the encoding on XML Header:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    maybe this works.
    Regards,
    Robin

  • PL/SQL Max character

    Hi All,
    What is the maximum length that can be stored in a variable for executing a query.
    var := 'SELECT * FROM TAB WHERE A='CLKJDJFAJDJFLA' AND B='DFLKAJSFJSKLAFJL'
    UNION ALL
    SELECT * FROM TAB WHERE A='CLKJDJFAJDJFLA' AND B='DFLKAJSFJSKLAFJL
    UNION ALL
    SELECT * FROM TAB WHERE A='CLKJDJFAJDJFLA' AND B='DFLKAJSFJSKLAFJL
    UNION ALL
    SELECT * FROM TAB WHERE A='CLKJDJFAJDJFLA' AND B='DFLKAJSFJSKLAFJL
    execute query using var.
    Thanks & Regards,
    CDPrasad

    cdprasad wrote:
    Hi all,
    As suggested
    I'm trying to run a SQL query in PL/SQL which is of lenght more than 32000 bytes.
    Since execute immediate cannot execute CLOB datatype,It can in 11g r2 onwards.
    Im divinding the strings into multiple pieces and trying to store in a varchar2(32000) datatype.
    Then I'l append these variables in execute immediate statement. I donno whether it will work or not.Right sort of idea (for 10g), but not with execute immediate. You have to use DBMS_SQL package instead and split it into 256 character chunks for the DBMS_SQL.VARCHAR2S array structure...
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_large_sql  CLOB;
      3    v_num        NUMBER := 0;
      4    v_upperbound NUMBER;
      5    v_sql        DBMS_SQL.VARCHAR2S;
      6    v_cur        INTEGER;
      7    v_ret        NUMBER;
      8  begin
      9    -- Build a very large SQL statement in the CLOB
    10    LOOP
    11      IF v_num = 0 THEN
    12        v_large_sql := 'CREATE VIEW vw_tmp AS SELECT ''The number of this row is : '||to_char(v_num,'fm0999999')||''' as col1 FROM DUAL';
    13      ELSE
    14        v_large_sql := v_large_sql || ' UNION ALL SELECT ''The number of this row is : '||to_char(v_num,'fm0999999')||''' as col1 FROM DUAL';
    15      END IF;
    16      v_num := v_num + 1;
    17      EXIT WHEN DBMS_LOB.GETLENGTH(v_large_sql) > 40000 OR v_num > 800;
    18    END LOOP;
    19    DBMS_OUTPUT.PUT_LINE('Length:'||DBMS_LOB.GETLENGTH(v_large_sql));
    20    DBMS_OUTPUT.PUT_LINE('Num:'||v_num);
    21    --
    22    -- Now split that large SQL statement into chunks of 256 characters and put in VARCHAR2S array
    23    v_upperbound := CEIL(DBMS_LOB.GETLENGTH(v_large_sql)/256);
    24    FOR i IN 1..v_upperbound
    25    LOOP
    26      v_sql(i) := DBMS_LOB.SUBSTR(v_large_sql
    27                                 ,256 -- amount
    28                                 ,((i-1)*256)+1 -- offset
    29                                 );
    30    END LOOP;
    31    --
    32    -- Now parse and execute the SQL statement
    33    v_cur := DBMS_SQL.OPEN_CURSOR;
    34    DBMS_SQL.PARSE(v_cur, v_sql, 1, v_upperbound, FALSE, DBMS_SQL.NATIVE);
    35    v_ret := DBMS_SQL.EXECUTE(v_cur);
    36    DBMS_OUTPUT.PUT_LINE('View Created');
    37* end;
    SQL> /
    Length:40015
    Num:548
    View Created
    PL/SQL procedure successfully completed.
    SQL> select count(*) from vw_tmp;
      COUNT(*)
           548
    SQL> select * from vw_tmp where rownum <= 10;
    COL1
    The number of this row is : 0000000
    The number of this row is : 0000001
    The number of this row is : 0000002
    The number of this row is : 0000003
    The number of this row is : 0000004
    The number of this row is : 0000005
    The number of this row is : 0000006
    The number of this row is : 0000007
    The number of this row is : 0000008
    The number of this row is : 0000009
    10 rows selected.
    SQL>

  • How many bytes can the string

    Hi,
    I have the problem to create the String with the lenght longer than 2 MBytes.
    For instance :
    byte[] b = new byte[10*1024*1024);
    len = b.length;
    String s = new String(b,0,len);
    Any helps are appreciated.
    PS: Pls assume b contains a data e.g. 7*1024*1024 and has the length of 7*1024*1024, everthing is ok until the String can not be instanstiated.
    Regards
    Paulus

    I have the problem to create the String with the lenght longer than 2 MBytes.What do you mean - what kind of problem? This works just fine:public class test {
        public static void main(String args[]) {
            byte[] b = new byte[10 * 1024 * 1024];
            for (int j = 0; j < b.length; j++) {
                b[j] = 97;
            String s = new String(b) + "b";
            System.out.println(s);
    }(although running did require setting the max. heap size bigger... :)

  • Converting ASCII text (byte array ending in null) to a String

    Hi all,
    I am trying to convert a null terminated ascii string stored in a byte array to a java String. When I pass the byte array to the String constructor it
    does not detect/interpret the null as a terminator for the ascii string. Is this something I have to manually program in? ie Check for where the null is and then
    pass that subarray of everything before the null to the String constructor?
    example of problem
    //               A   B  C   D   null   F   (note F is junk in the array, and should be ignored since it is after null)
    byte[] asciiArray = { 65, 66, 67, 68, 0,  70 };
    System.out.println(new String(asciiArray, "UTF-8"));
    //this prints ABCD"sqare icon"F

    Why do you expect the null character to terminate the string? If you come from a C or C++ background, you need to understand that java.lang.String is not just a mere character array. It's a full-fledged Java object that knows its length without having any need for null terminator. So Ascii 0 is just another character for String object. To achieve what you want to do, you have to manually loop through the byte array and stop when you encounter a null character.

  • How to get a string or byte array representation of an Image/BufferedImage?

    I have a java.awt.Image object that I want to transfer to a server application (.NET) through a http post request.
    To do that I would like to encode the Image to jpeg format and convert it to a string or byte array to be able to send it in a way that the receiver application (.NET) could handle. So, I've tried to do like this.
    private void send(Image image) {
        int width = image.getWidth(null);
        int height = image.getHeight(null);
        try {
            BufferedImage buffImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
            ImageIcon imageIcon = new ImageIcon(image);
            ImageObserver observer = imageIcon.getImageObserver();
            buffImage.getGraphics().setColor(new Color(255, 255, 255));
            buffImage.getGraphics().fillRect(0, 0, width, height);
            buffImage.getGraphics().drawImage(imageIcon.getImage(), 0, 0, observer);
            ByteArrayOutputStream stream = new ByteArrayOutputStream();
            JPEGImageEncoder jpeg = JPEGCodec.createJPEGEncoder(stream);
            jpeg.encode(buffImage);
            URL url = new URL(/* my url... */);
            URLConnection connection = url.openConnection();
            String boundary = "--------" + Long.toHexString(System.currentTimeMillis());
            connection.setRequestProperty("method", "POST");
            connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
            String output = "--" + boundary + "\r\n"
                          + "Content-Disposition: form-data; name=\"myImage\"; filename=\"myFilename.jpg\"\r\n"
                          + "Content-Type: image/jpeg\r\n"
                          + "Content-Transfer-Encoding: base64\r\n\r\n"
                          + new String(stream.toByteArray())
                          + "\r\n--" + boundary + "--\r\n";
            connection.setDoOutput(true);
            connection.getOutputStream().write(output.getBytes());
            connection.connect();
        } catch {
    }This code works, but the image I get when I save it from the receiver application is distorted. The width and height is correct, but the content and colors are really weird. I tried to set different image types (first line inside the try-block), and this gave me different distorsions, but no image type gave me the correct image.
    Maybe I should say that I can display the original Image object on screen correctly.
    I also realized that the Image object is an instance of BufferedImage, so I thought I could skip the first six lines inside the try-block, but that doesn't help. This way I don't have to set the image type in the constructor, but the result still is color distorted.
    Any ideas on how to get from an Image/BufferedImage to a string or byte array representation of the image in jpeg format?

    Here you go:
      private static void send(BufferedImage image) throws Exception
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        ImageIO.write(image, "jpeg", byteArrayOutputStream);
        byte[] imageByteArray = byteArrayOutputStream.toByteArray();
        URL url = new URL("http://<host>:<port>");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setDoOutput(true);
        connection.setRequestMethod("POST");
        OutputStream outputStream = connection.getOutputStream();
        outputStream.write(imageByteArray, 0, imageByteArray.length);
        outputStream.close();
        connection.connect();
        // alternative to connect is to get & close the input stream
        // connection.getInputStream().close();
      }

  • How to send byte array and String values to servlet from Swing application

    Hi all,
    I am new to swing, servlet, and socket connection.
    I have swing application to draw images and some input data. I dont know to send to server.
    byte[] buf = baos.toByteArray();
    URL servletURL = new URL("http://10.70.70.1:8080/servlet/SaveImage)
    URLConnection conn = servletURL.openConnection();
    conn.setDoOutput(true);
    BufferedWriter out = new BufferedWriter( new OutputStreamWriter( conn.getOutputStream() ) );
    out.write(buf&a=aaaa&b=bbbbb);
    out.flush();
    out.close();
    can I do like this. Strings are received in server side perfect. but i cant get byte array data. Please help me.
    Thanks in advance.

    <img src="myservlet">
    In your myservlet:
    response.setContentType("image/jpeg");
    then write your image date via ImageIO that uses response output stream.

  • How to put a String into a byte array

    How can i put a String into a byte array byte[]. So that i can send it to the serial port for output to an LCD display. Cheers David

    javadocs for String
    getBytes
    public byte[] getBytes()
    Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array.
    Returns:
    The resultant byte arraySince:
    JDK1.1

  • How to get the size of a string in bytes

    Morning,
    I’m trying to get the length in bytes of a string, the characters below are 3 byte UTF-8, but when I display
    The length of either int, looks like is double I got 120 and I think it should be 60. Any idea
    String requiredMsg = "όόόόόόόόόόόόόόόόόόόό";
    int byteCountUTF8 = requiredMsg.getBytes("UTF-8").length;
    int byteCountUTF8 = requiredMsg.getBytes().length;
    thanks

    OK, it is not 'o with acute', but rather 'Greek small omicron with tonos'.
    This page may help you sort it out:http://www.fileformat.info/info/unicode/char/3cc/index.htm.
    According to the page and to my tests, this Unicode 03CC has a 2 bytes (not 3) UTF-8 representation.
    String requiredMsg = "\u03CC";
    System.out.println(requiredMsg.getBytes("UTF-16").length);
    System.out.println(requiredMsg.getBytes("UTF-8").length);
    System.out.println(requiredMsg.getBytes().length); // In WindowsResult on my machine:
    4
    2
    1

  • How to get the length in bytes of a string

    My string has both latin (1 byte) and chinese (2 bytes).
    My program is in unicode system.
    How to measure the length in bytes of the string?
    the xlen function does not work.

    Hello,
    parameters : p_str type string.
    data : len type i.
    len = strlen( p_str ).
    write : / len.
    With Regards,
    BVS
    Hi BSV, your code return the number of characters not bytes.
    Remember chinese character in US are encoded with 2 bytes.
    And my string contain both latin and chinese characters.
    thanks

  • How to write a specific bytes of a string

    I'm using DataOutputStream object to write a specific string to a file. If I want to write that string
    to a file with preserving of 20 bytes (for example) as a header of the file. Even though the length of the string can be at any size, I just want it alwayst in 20 bytes. How could I do that. Please help! Thanks a lot.

    String s = "Less than 20";
    while(s.length() < 20) {
         s += " ";
    System.out.println(s + " " + s.length());Mark

  • Text strings from VISA read don't match identical looking text constants - could it be double byte characters"

    Our RS232-enabled instrument sends ASCII strings to COM 1 and I read strings in. For example I get the string "TPM", or at least it looks like "TPM" if I display it. However, if I send that to the selector input of a Case structure, and create a case for "TPM", whether the two appear to match varies. Sometimes it matches, and measuring its length returns 3. Sometimes it measures 7 or 11 or 12 characters long, and it doesn't match. I can reproduce a match or a mismatch by my choice of the command that went to the instrument prior to the command that causes the TPM response, but have made no sense of this clue. I have run it through Trim Whitespace, with Both Ends (the default) explicitly selected. I have also turned the string into a byte array, autoindexed a For loop on that, and only passed the bytes if they don't equal 32, or if they don't equal 0, thinking spaces or nulls might be in there, but no better.
    The Trim Whitespace function's Help remarks that it does not remove "double byte characters". But I can't find anything else about "double byte characters". Could this be the problem? Are there functions that can tell whether there are "double byte characters", or convert into or out of them? By "double byte characters", do they just mean Unicode?
    Solved!
    Go to Solution.

    Cebailey,
    The double byte characters are generally used for characters specific to languages other than English.  If you display your message in  " '\' Codes Display"  in a string indicator do you see any other characters?   You could also use Hex Display to see count the number of bytes in the message.  You are probably getting messages with non-printable characters that might need to be trimmed before using your application.  If you want more information the '\' Codes Display, there's a detailed description found in the LabVIEW Help.  You can also find the same information on our website in the LabVIEW Help.  Backslash ('\') Codes Display
    Caleb WNational Instruments

  • "buffer too small for string or missing null byte" inserting CR in excel

    I have created a Crystal Report based on below stored procedure.
    DELIMITER $$
    DROP PROCEDURE IF EXISTS `ww_test`.`PRD_Data_sp` $$
    CREATE PROCEDURE `ww_test`.`PRD_Data_sp` (in cyear int, in cmonth int, in groupby varchar(20), in Inv_type varchar(4))
    BEGIN
      select
              CASE WHEN groupby='Date' THEN  (p.FKDAT)
                   WHEN groupby='SalesOrg' THEN  CONCAT(p.VKORG,'_',p.VTWEG)
              END ,
              sum(p.QTYSAM),
              sum(p.CASESSOLD),
              sum(p.SOLDDOL)
              from ww_test.prd_data p
              where (month(p.FKDAT)=cmonth and year(p.FKDAT)=cyear) and
                     ((p.FKART) is null or not(p.FKART in ("FAZ","ZMBB","FAS",Inv_Type))) and
                     ((p.AUART) is null or not(p.AUART in ("ZMBB")))
              Group by
                  CASE WHEN groupby='Date' THEN  (p.FKDAT)
                       WHEN groupby='SalesOrg' THEN  CONCAT(p.VKORG,'_',p.VTWEG)
                  END
              Order by
                  CASE WHEN groupby='Date' THEN  (p.FKDAT)
                       WHEN groupby='SalesOrg' THEN  CONCAT(p.VKORG,'_',p.VTWEG)
                  END;
    END $$
    DELIMITER ;
    I have used Add Command to create report based on this.
    call ww_test.prd_data_sp({?Year},{?Month},{?GroupBy},{?InvType});
    I am able to refresh the report in crystal and as well in Infoview without any problem.
    But when i try to insert this report in Excel using Live Office it gives me error. I able to insert other crystal reports without any problem.
    An error occurred while opening the report. The report does not exist; you have insufficient rights to open the report; or you cannot make a connection to the BusinessObjects Web Service. (LO 02010)
    Failed to open report (LO 26619)
    Cannot open report document 
    Buffer too small for string or missing null byte.
    can anyone suggest where i am going wrong? Any input is appreciated.
    Crystal Reports 2008
    Live Office XI 3.1
    BOEdge XI 3.1
    Xcelsius 2008
    Thanks ,
    Madhavi

    With the CurrentValue method
    Crpt.ParamFields[3].CurrentValue := memo1.Text;
    Is there another solution ?

  • Conversion of String to Bytes and Length Calculation

    hi,
    How can I convert
    String to Bytes
    Bytes to String
    int to Bytes
    Bytes to int
    & int to String
    And I have to calculate the Length in Bytes of a String and int.
    Thanks

    double d = Double.parseDouble(new String(byteDouble)); Java doesn't seem to accept to convert byteDouble to a String...
    Exception in thread "main" java.lang.NumberFormatException: For input string: "[B@1d9fd51"
      at java.lang.NumberFormatException.forInputString (NumberFormatException.java:48)
      at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1213)

Maybe you are looking for

  • How can I create a 5 minute window?

    What I am trying to do is make a 5 minute window of events that happened last in my application. For some reason, I cannot get the "5 minutes"  to be just that. Here is what I want to do: I want to have events from the event structure written to a fi

  • One more time - problems with fans

    I realize this is but one of hundreds or possibly thousands of cases of Mac users being plagued by fan noise problems, but to me it has been a long and extremely frustrating saga. I have been a Mac user since the very beginning, through different ver

  • I got this message on my laptop when I tried to snyc my iPhone:

    The iTunes library.itl is locked, on a locked disk, or you do not have write permission for file. I have had no problems until yesterday afternoon. I un-installed and re-installed iTunes and still get the same message. I even get the message when jus

  • Group by index column?

    hi all, i have a table as follows col1 varchar(10), col2 varchar(10), col3 number(19,4), col4 number(19,4) for this sql statement, select col1,col2,col3,sum(col4) from table1 group by col1,col2,col3 will an index on(col1,col2,col3) help? thanks

  • Mngd Switch as Unmngd Switch

    Trying to find out if a managed switch, such as the SLM2048T can be configured as an unmanaged switch.  Our schools have laptop carts and we want to put switches in the carts so that the laptops will be plugged into the network when not in use and so