Date Part or Format Date

Hi,
I have a datetime column in the universe. The format of the date is "mm/dd/yyyy hh:mm:ss
when users run report they only want to see the format as MON-YYYY.
what syntax shall I use can anybody help.

Hi Thanks for the reply,
I am using sql server 2005 database.
and Webi Reporting tool.
I have date column in universe table : 4/1/07 12:00 AM (format)
when I drag it on to my report i get only 4/1/07 (without time) . I have to format the column to see the time.
But in few of my report I don't need time and day.
I only need Month & date ,
In universe I created the object with " datename(MM,START_DATETIME)' - 'datename(year,START_DATETIME) and its giving full month name.
I can do the format at report level , but its showing full name of month
(like January, February etc) I just want to see 3 character for month
the format should be JUN-2009
Thanks for help

Similar Messages

  • Excel Web Part KPI Format

    I am having a frustrating time with an Excel Web Part and am hoping someone can help me.
    I have created a named range in Excel 2013 which contains some KPI status indicators.  I have published this named range to a SharePoint 2013 site.  Unfortunately, the web part does not look the same as it does in Excel.  The KPI status
    indicators are not centered properly in the cell and there are shadow gridlines that were hidden in the Excel spreadsheet.
    I have tried everything I can think of to get the KPI status indicators to format properly:  various combinations of cell alignments, merge and centering of cells, etc., with no luck.
    Also it seems that the only way to remove the "gridlines" is to merge the "unused" cells.
    Any thoughts or suggestions would be greatly appreciated.

    Hi,
    I suppose it is by designer. The only way is to merge the "unused" cells.

  • Javascript validate date format?

    i cant figure out how to check the format of the date, i want it to check that the date is
    dd/mm/yy
                   if(document.getElementById(i+"eddstartdate").value == ????)
                        window.alert('You Must Enter a Start Date with a valid format');
                        return;
                   }

    I'm sure I had a small solution to this simple requirement. But I'm pasting the solution below.
    Include a js file named as say dateValidate.js with contents below and call the js function isDate(val,format) wherein you pass the value and the required format. Based on the boolean value return show the required message.
    var MONTH_NAMES = new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
    // isDate ( date_string, format_string )
    // Returns true if date string matches format of format string and
    // is a valid date. Else returns false.
    // It is recommended that you trim whitespace around the value before
    // passing it to this function, as whitespace is NOT ignored!
    function isDate(val,format) {
         //alert("val="+val)
         var date = getDateFromFormat(val,format);
         //alert("date="+date)
         if (date == 0) { return false; }
         return true;
    // compareDates(date1,date1format,date2,date2format)
    //   Compare two date strings to see which is greater.
    //   Returns:
    //   1 if date1 is greater than date2
    //   0 if date2 is greater than date1 of if they are the same
    //  -1 if either of the dates is in an invalid format
    function compareDates(date1,dateformat1,date2,dateformat2) {
         var d1 = getDateFromFormat(date1,dateformat1);
         var d2 = getDateFromFormat(date2,dateformat2);
         if (d1==0 || d2==0) {
              return -1;
         else if (d1 >= d2) {
              return 1;
         return 0;
    //      function to alert messages..
    /*function warnInvalid(s)
    {   alert(s)
        return false
    // formatDate (date_object, format)
    // Returns a date in the output format specified.
    // The format string uses the same abbreviations as in getDateFromFormat()
    function formatDate(date,format) {
         format = format+"";
         var result = "";
         var i_format = 0;
         var c = "";
         var token = "";
         var y = date.getYear()+"";
         var M = date.getMonth()+1;
         var d = date.getDate();
         var H = date.getHours();
         var m = date.getMinutes();
         var s = date.getSeconds();
         var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
         // Convert real date parts into formatted versions
         // Year
         if (y.length < 4) {
              y = y-0+1900;
         y = ""+y;
         yyyy = y;
         yy = y.substring(2,4);
         // Month
         if (M < 10) { MM = "0"+M; }
              else { MM = M; }
         MMM = MONTH_NAMES[M-1];
         // Date
         if (d < 10) { dd = "0"+d; }
              else { dd = d; }
         // Hour
         h=H+1;
         K=H;
         k=H+1;
         if (h > 12) { h-=12; }
         if (h == 0) { h=12; }
         if (h < 10) { hh = "0"+h; }
              else { hh = h; }
         if (H < 10) { HH = "0"+K; }
              else { HH = H; }
         if (K > 11) { K-=12; }
         if (K < 10) { KK = "0"+K; }
              else { KK = K; }
         if (k < 10) { kk = "0"+k; }
              else { kk = k; }
         // AM/PM
         if (H > 11) { ampm="PM"; }
         else { ampm="AM"; }
         // Minute
         if (m < 10) { mm = "0"+m; }
              else { mm = m; }
         // Second
         if (s < 10) { ss = "0"+s; }
              else { ss = s; }
         // Now put them all into an object!
         var value = new Object();
         value["yyyy"] = yyyy;
         value["yy"] = yy;
         value["y"] = y;
         value["MMM"] = MMM;
         value["MM"] = MM;
         value["M"] = M;
         value["dd"] = dd;
         value["d"] = d;
         value["hh"] = hh;
         value["h"] = h;
         value["HH"] = HH;
         value["H"] = H;
         value["KK"] = KK;
         value["K"] = K;
         value["kk"] = kk;
         value["k"] = k;
         value["mm"] = mm;
         value["m"] = m;
         value["ss"] = ss;
         value["s"] = s;
         value["a"] = ampm;
         while (i_format < format.length) {
              // Get next token from format string
              c = format.charAt(i_format);
              token = "";
              while ((format.charAt(i_format) == c) && (i_format < format.length)) {
                   token += format.charAt(i_format);
                   i_format++;
              if (value[token] != null) {
                   result = result + value[token];
              else {
                   result = result + token;
         return result;
    // Utility functions for parsing in getDateFromFormat()
    function _isInteger(val) {
         var digits = "1234567890";
         for (var i=0; i < val.length; i++) {
              if (digits.indexOf(val.charAt(i)) == -1) { return false; }
         return true;
    function _getInt(str,i,minlength,maxlength) {
         for (x=maxlength; x>=minlength; x--) {
              var token = str.substring(i,i+x);
              if (token.length < minlength) {
                   return null;
              if (_isInteger(token)) {
                   return token;
         return null;
    // END Utility Functions
    // getDateFromFormat( date_string , format_string )
    // This function takes a date string and a format string. It matches
    // If the date string matches the format string, it returns the
    // getTime() of the date. If it does not match, it returns 0.
    // This function uses the same format strings as the
    // java.text.SimpleDateFormat class, with minor exceptions.
    // The format string consists of the following abbreviations:
    // Field        | Full Form          | Short Form
    // -------------+--------------------+-----------------------
    // Year         | yyyy (4 digits)    | yy (2 digits), y (2 or 4 digits)
    // Month        | MMM (name or abbr.)| MM (2 digits), M (1 or 2 digits)
    // Day of Month | dd (2 digits)      | d (1 or 2 digits)
    // Hour (1-12)  | hh (2 digits)      | h (1 or 2 digits)
    // Hour (0-23)  | HH (2 digits)      | H (1 or 2 digits)
    // Hour (0-11)  | KK (2 digits)      | K (1 or 2 digits)
    // Hour (1-24)  | kk (2 digits)      | k (1 or 2 digits)
    // Minute       | mm (2 digits)      | m (1 or 2 digits)
    // Second       | ss (2 digits)      | s (1 or 2 digits)
    // AM/PM        | a                  |
    // Examples:
    //  "MMM d, y" matches: January 01, 2000
    //                      Dec 1, 1900
    //                      Nov 20, 00
    //  "m/d/yy"   matches: 01/20/00
    //                      9/2/00
    //  "MMM dd, yyyy hh:mm:ssa" matches: "January 01, 2000 12:30:45AM"
    function getDateFromFormat(val,format) {
         var date_split=val.split("/");
         /*if(date_split[0].length<2)
              date_split[0]="0"+date_split[0];
         if(date_split[1].length<2)
              date_split[1]="0"+date_split[1];
         val = date_split[0] + "/" + date_split[1] + "/" + date_split[2];*/
         val = val+"";
         format = format+"";
         var i_val = 0;
         var i_format = 0;
         var c = "";
         var token = "";
         var token2= "";
         var x,y;
         var now   = new Date();
         var year  = now.getYear();
         var month = now.getMonth()+1;
         var date  = now.getDate();
         var hh    = now.getHours();
         var mm    = now.getMinutes();
         var ss    = now.getSeconds();
         var ampm  = "";
         while (i_format < format.length) {
              // Get next token from format string
              c = format.charAt(i_format);
              token = "";
              while ((format.charAt(i_format) == c) && (i_format < format.length)) {
                   token += format.charAt(i_format);
                   i_format++;
              // Extract contents of value based on format token
              if (token=="yyyy" || token=="yy" || token=="y") {
                   if (token=="yyyy") { x=4;y=4; }// 4-digit year
                   if (token=="yy")   { x=2;y=2; }// 2-digit year
                   if (token=="y")    { x=2;y=4; }// 2-or-4-digit year
                   year = _getInt(val,i_val,x,y);
                   if (year == null) { return 0; }
                   i_val += year.length;
                   if (year.length == 2) {
                        if (year > 70) {
                             year = 1900+(year-0);
                        else {
                             year = 2000+(year-0);
              else if (token=="MMM"){// Month name
                   month = 0;
                   for (var i=0; i<MONTH_NAMES.length; i++) {
                        var month_name = MONTH_NAMES;
                        if (val.substring(i_val,i_val+month_name.length).toLowerCase() == month_name.toLowerCase()) {
                             month = i+1;
                             if (month>12) { month -= 12; }
                             i_val += month_name.length;
                             break;
                   if (month == 0) { return 0; }
                   if ((month < 1) || (month>12)) { return 0; }
                   // TODO: Process Month Name
              else if (token=="MM" || token=="M") {
                   x=token.length; y=2;
                   month = getInt(val,ival,x,y);
                   if (month == null) { return 0; }
                   if ((month < 1) || (month > 12)) { return 0; }
                   i_val += month.length;
              else if (token=="dd" || token=="d") {
                   x=token.length; y=2;
                   date = getInt(val,ival,x,y);
                   if (date == null) { return 0; }
                   if ((date < 1) || (date>31)) { return 0; }
                   i_val += date.length;
              else if (token=="hh" || token=="h") {
                   x=token.length; y=2;
                   hh = getInt(val,ival,x,y);
                   if (hh == null) { return 0; }
                   if ((hh < 1) || (hh > 12)) { return 0; }
                   i_val += hh.length;
                   hh--;
              else if (token=="HH" || token=="H") {
                   x=token.length; y=2;
                   hh = getInt(val,ival,x,y);
                   if (hh == null) { return 0; }
                   if ((hh < 0) || (hh > 23)) { return 0; }
                   i_val += hh.length;
              else if (token=="KK" || token=="K") {
                   x=token.length; y=2;
                   hh = getInt(val,ival,x,y);
                   if (hh == null) { return 0; }
                   if ((hh < 0) || (hh > 11)) { return 0; }
                   i_val += hh.length;
              else if (token=="kk" || token=="k") {
                   x=token.length; y=2;
                   hh = getInt(val,ival,x,y);
                   if (hh == null) { return 0; }
                   if ((hh < 1) || (hh > 24)) { return 0; }
                   i_val += hh.length;
                   h--;
              else if (token=="mm" || token=="m") {
                   x=token.length; y=2;
                   mm = getInt(val,ival,x,y);
                   if (mm == null) { return 0; }
                   if ((mm < 0) || (mm > 59)) { return 0; }
                   i_val += mm.length;
              else if (token=="ss" || token=="s") {
                   x=token.length; y=2;
                   ss = getInt(val,ival,x,y);
                   if (ss == null) { return 0; }
                   if ((ss < 0) || (ss > 59)) { return 0; }
                   i_val += ss.length;
              else if (token=="a") {
                   if (val.substring(i_val,i_val+2).toLowerCase() == "am") {
                        ampm = "AM";
                   else if (val.substring(i_val,i_val+2).toLowerCase() == "pm") {
                        ampm = "PM";
                   else {
                        return 0;
              else {
                   if (val.substring(i_val,i_val+token.length) != token) {
                        return 0;
                   else {
                        i_val += token.length;
         // If there are any trailing characters left in the value, it doesn't match
         if (i_val != val.length) {
              return 0;
         // Is date valid for month?
         if (month == 2) {
              // Check for leap year
              if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) { // leap year
                   if (date > 29){ return false; }
              else {
                   if (date > 28) { return false; }
         if ((month==4)||(month==6)||(month==9)||(month==11)) {
              if (date > 30) { return false; }
         // Correct hours value
         if (hh<12 && ampm=="PM") {
              hh+=12;
         else if (hh>11 && ampm=="AM") {
              hh-=12;
         var newdate = new Date(year,month-1,date,hh,mm,ss);
         return newdate.getTime();
    Hope this helps
    Regards
    Rohit

  • SharePoint 2010 list view web part not showing conditional formatting

    when I create conditional formatting in custom list is working fine & when it call through web part page (Data view web part) conditional formatting not showing. data is showing without conditional formatting.
    Dinuka M.

    When you use conditional formatting on some page it is writing inline CSS codes inside that page. thats why when you create a new page and add the same web part to that page, you must edit that page to apply conditional formatting to that
    web part.
    Best Regards, Mustafa Yılmaz MCITP, MCPD | www.mustafa-yilmaz.org | www.sharepointciyiz.biz
    When you say edit the page, do you mean edit it in SharePoint Designer, or in SharePoint itself. And is it a case of just editing, then saving the page and it will apply the conditional formatting, or is there a specific property you need to edit, and if so,
    what is it?

  • Partition External Harddrive and part format Extended Journaled part fat32?

    Hello
    I bought a Toshiba NTFS formatted External Harddrive for the safe keep of my files.
    I want it to make partition into 2, and one part to format Mac Extended (Jounaled), one part to FAT32.
    Is this possible?
    Many thanks.

    Thank you very much.
    Can I have related question?
    Is it possible to make 3 partitions on a harddisk?
    If it is,
    Can I retain NTFS on a partitioned part?
    Or does it have to be entirely formated to Mac readable/wrtitable fotmat?
    I mean if I partision in 3 parts can I format
    part 1 Mac JOurnal
    part 2 FAT32
    part3 to retain NTFS?
    Many many thanks

  • Header line not displaed in MT103 Format

    Hi all,
    We are working on MT103 format, we are not getting the header line data
    In image 1 we are getting "HKBCCATT 103" but in image 2 we are not getting that line.
    Kindly help us what should be done so we can get "HKBCCATT 103"
    Regards,
    shegar.

    Hi,
    It would have helped if you had indicated in any way what functionality are you using to produce the file... If I look at the settings for MT103 in transaction OBPM1, and the event module for Event 20 - Start/File header, the standard event implementation FM FI_PAYMEDIUM_MT103_20 takes in into gs_swift_103 structure as part of format parameters the field PAYMHEAD, which controls writing of header record. But since you didn't bother to supply any information whatsoever, one can only guess if this is applicable to your case...
    cheers
    Jānis

  • Backup of iTunes library for prior to hard drive formatting

    My PC is currently running on Windows XP and has become very sluggish, so I'm going to format my C: drive and then install Windows 7. I'd like to check what I need to do with iTunes prior to and after formatting my C: drive.
    My music files are on an external hard drive, and as well as a backup of these, I also have a backup of the My Documents\My Music\iTunes folder, which I believe holds all the info regarding play counts, playlists etc. (please coorect me if I'm wrong).
    I'm assuming I then need to do the following:
    - deauthorise my PC for my Apple account and then uninstall iTunes software
    - format my C: drive, then install Windows 7
    - download iTunes software from the Apple website and authorise my PC.
    I just want idiot-proof clarification on the easiest way to get all my tracks and playlist/library info back onto my PC and into iTunes from the the external hard drive, so I have exactly the same library and info that I currently have.
    Many thanks,
    Dan Southam

    More or less... You can leave out the uninstalling iTunes part, the format will take care of that.
    On your rebuilt machine you need to make sure that the same drive letter is assigned to your external drive otherwise the paths that iTunes holds for your files will become invalid. You can restore your backup of the iTunes library folder into C:\Users\<You>\Music\iTunes install iTunes and all should be fine.
    tt2

  • How to format body of outgoing email...

    just wondering if "\n"'s should be added to the body of an outgoing email to prevent one long line of text or do most email clients automatically wrap the text...for example...
    lets say i compose an email by holding down the number 2 for a few lines (linewrap is set to true)...if i sent this email, would most email clients interpret this as a multiline email or would it be just one long line of 2's...
    thanx in advance

    I'd assume you have no guarantee about the formatting applied by the end email client and add the new lines yourself.
    In my experience, even this is not guaranteed to work as some destination clients (and/or mail servers) will enforce a line wrap inside the body of the email. That is, they will actually insert new line characters where there wasn't any.
    The only way to have any control over formatting is to use a system in which formatting is specified.. like HTML. You could include an HTML part in your messages (in addition to the text part) which formats the messgae however you like. This is more likely (but still not guaranteed) to be honored at the other end.

  • Image Date Format to show parts of seconds

    Hello All,
    Does anyone know if is possible to change the format of the Image Date field. My D2X is can several images in a second. The format in the List shows the existing format of MMDDYY hhmmss but no parts of a second yet I belive that parts of seconds are in the data. For example a tiff sent Photoshop and named by date contains 1/10 seconds.
    Thanks
    Dick

    Hmmm.... Not sure why the format was ignored when I selected SYSTIMESTAMP... Try this instead
    SCOTT @ hp92 Local> create table ts( col1 timestamp );
    Table created.
    SCOTT @ hp92 Local> insert into ts values( systimestamp );
    1 row created.
    SCOTT @ hp92 Local> select col1 from ts;
    COL1
    2005-09-12
    SCOTT @ hp92 Local> alter session set NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF';
    Session altered.
    SCOTT @ hp92 Local> select col1 from ts;
    COL1
    2005-09-12 16:47:07.840000Anyone know why SYSTIMESTAMP didn't obey the NLS_TIMESTAMP_FORMAT setting?
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Sun-Java-System-SMTP-Warning

    Customers using our company's products have been finding the following error message when sending messages with image attachments from our devices:
    "Sun-Java-System-SMTP-Warning: Lines longer than SMTP allows found and truncated"
    RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies http://www.faqs.org/rfcs/rfc2045.html
    states:
    (5)   Encoded lines must not be longer than 76 characters,
              not counting the trailing CRLF. If longer lines are
              found in incoming, encoded data, a robust
              implementation might nevertheless decode the lines, and
              might report the erroneous encoding to the user.Our devices comply with this RFC to the letter.
    Can anyone explain why the Sun Java System SMTP server is rejecting these messages?
    If necessary, I can provide network capture files from the connection between our device and an SMTP server.
    A sample successful SMTP connection with a Postfix SMTP server follows:
    220 doc.doc.pixord.com ESMTP Postfix
    EHLO pixord.com
    250-doc.doc.pixord.com
    250-PIPELINING
    250-SIZE 20480000
    250-VRFY
    250-ETRN
    250 8BITMIME
    MAIL FROM:
    250 Ok
    RCPT TO:
    250 Ok
    DATA
    354 End data with <CR><LF>.<CR><LF>
    from:
    to:
    subject: This is just test.
    date: Thu, 05 May 2005 08:10:09 +0800
    MIME-Version: 1.0
    Content-Type: multipart/mixed;
    .boundary="--=_iMaIl_BoUnDrY_1"
    ----=_iMaIl_BoUnDrY_1
    Content-Type: text/plain;
    This is just a test.
    ----=_iMaIl_BoUnDrY_1
    Content-Type: image/jpeg;
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
    .filename="test.jpg"
    /9j/2wCEABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19i
    Z2hnPk1xeXBkeFxlZ2MBERISGBUYLxoaL2NCOEJjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj
    Y2NjY2NjY2NjY2NjY2NjY2NjY2NjY//EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCwEA
    ----SNIPPED BY ME----
    Skz7VZIFMKj0oAgJHoaaSPepyi+lNMYoAhOPWm8eoqYximmP3oA//9k=
    ----=_iMaIl_BoUnDrY_1--
    250 Ok: queued as 5AC3815763F
    RSET
    250 Ok
    QUIT
    221 ByeMIME message was snipped by me in order to shorten the message.
    I also removed the E-mail addresses.

    I'm sorry.
    1. The max line length is 998 characters, plus cr/lf
    2. If you're getting the error message, then whatever that message was composed with is broken, and emitting lines longer than that.
    Messaging Server has configurable choices. By default, it simply truncates the lines. You can choose to "wrap" them.
    See channel keyword, "wrapsmtp"

  • Mixed Arabic/Latin text confuson in a single String

    Hi all,
    I hope someone knows the answer to this issue!
    I've got an application in Java which calls another app via a stored procedure and callable statement, passing various parameters across. One of these parameters is a buffer containing transaction information.
    Now we're working on an Arabic language proof of concept, and when I create this buffer containing both Arabic, Latin and numeric data, the order of the string is messed up.
    E.g.
    The data may be (in order):
    I
    AED
    17
    &#1588;&#1575;&#1585;&#1577; &#1575;&#1604;&#1606;&#1602;&#1575;&#1591;
    1.7
    101010
    Test seventeen
    17D
    This appears in the buffer (with some padding) as:
    IAED17&#1588;&#1575;&#1585;&#1577; &#1575;&#1604;&#1606;&#1602;&#1575;&#1591; 1.7 101010Test seventeen 17D
    As you can see, the order has changed - the numeric fields appear to have been included with the Arabic text.
    This causes the API we're calling to break, as you can imagine - expected fields are not appearing in the right place in the buffer.
    The string for the buffer is being built as follows:
    StringBuffer paramBuffer = new StringBuffer(BUFFER_INITIAL_CAPACITY);
    while (iterator.hasNext()) {
    String fieldName = iterator.next().toString();
    // Get Object using field name from Vector.
    FieldApi field = (FieldApi)fields.get(fieldName);
    tempCtr = tempCtr + field.getLength();
    if (field.getLength() == 0) {
    break; // We have reached end of the fields
    //Add each formatted field to param.
    paramBuffer.append(field.getString());
    Now, I suspect that I could get around this by constructing a byte array and using a setBytes method on my callableStatement. However, the set up of my JDBC connection means that I can't use setBytes (translateBinary is set to true, giving a data type mismatch exception), and this set up is something I can't change.
    I'm sure this is a problem with the fact that Arabic languages are right to left rather than left to right, and the String I create attempts to format it in this manner (and gets it a little confused when a numeral is next to Arabic text). Is there a way I can tell the String to leave things exactly as they're added, rather than attempting to format them?
    Any help would be appreciated! :-)
    Cheers,
    Dan
    P.S. I'm aware that what is displayed and what is actually there may not be the same, but when I inspect the contents of the buffer in the stored procedure, the order is indeed wrong.

    Hi Dan,
    Some time ago a faced a similar problem whenn preparing text for display. I solved it by wrapping the text in a html table, thus forcing the elements to remain in the exact order I wnated them in. Something as follows:
    import java.awt.BorderLayout;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.SwingUtilities;
    public class MixedArabic {
        public static void main(String[] args) {
         SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
              new MixedArabic().createGUI();
        private String[] parts = new String[] { "AED", "17",
             "\u0634\u0627\u0631\u0629 \u0627\u0644\u0646\u0642\u0627\u0637",
             "1.7", "101010", "Test seventeen", "17D" };
        private void createGUI() {
         JFrame frame = new JFrame();
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.add(new JLabel(createString(parts, false)),
              BorderLayout.PAGE_START);
         frame.add(new JLabel(createString(parts, true)), BorderLayout.PAGE_END);
         frame.pack();
         frame.setLocationRelativeTo(null);
         frame.setVisible(true);
        private String createString(String[] parts, boolean formatted) {
         StringBuilder sb = new StringBuilder();
         if (formatted) {
             sb.append("<html><table><tr>");
         for (String part : parts) {
             sb.append(formatted ? "<td>" : ' ');
             sb.append(part);
             sb.append(formatted ? "</td>" : ' ');
         if (formatted) {
             sb.append("</tr></table></html>");
         return sb.toString();
    }Piet

  • Emulating HTTP POST for file upload with J2ME

    I have search through a lot of site and couldn't find the actual code. I try to emulate below html with J2ME.
    <form method="POST" enctype="multipart/form-data" action="Insert.asp">
    <td>File :</td><td>
    <input type="file" name="file" size="40"></td></tr>
    <td> </td><td>
    <input type="submit" value="Submit"></td></tr>
    </form>
    here is my code :
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    byte[] filecontent = file byte content ...
    try {
    c = (HttpConnection)Connector.open("http://xx.com/insert.asp");
    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("Content-Length", String.valueOf(cmg.length + 15));
    c.setRequestProperty("Content-type","multipart/form-data");
    os = c.openOutputStream();
    os.write("file=c:\\abc.png".getBytes());
    os.write(filecontent);
    os.flush();
    I can emulate form with text field and it work, but when it come to file upload, above code not working, I don't know what to put for the outputstream, filename ? content ? or both ? since the html only has one field that is the "file" field. The file is actually store in rms with filename abc.png, and I just put in the c:\ for the server as a dump path.

    File upload is more complicated then that... you need multi-part MIME formatting.... But I have just the code...
    http://forum.java.sun.com/thread.jspa?forumID=256&threadID=451245

  • Prolog with soap adapter in PI

    Dear All,
    We run a scenario Proxy=>PI=>HTTP
    The remote service accepts messages POSTed using either the form-encoded format (name, value pairs)
    or the multi-part mime format which enables the files to be passed to the web service.
    In both cases, the external service replies with a multi-part message.
    We are going to use the SOAP adapter (plain HTTP does not support attachments)
    with nosoap flagged.
    What is best approach to add a prolog before the actual XML with SOAP adapter,
    to simulate the form-encoded format?
    Example :
    USER=USER1&PASS=PASS1&DB=DB1
    In the 2nd situation, how to create the different documents before the actual XML?
    Example :
    7d924f5b0464
    Content-Disposition: form-data; name="USER"
    USER1
    7d924f5b0464
    Content-Disposition: form-data; name="PASS"
    PASS1
    7d924f5b0464
    Content-Disposition: form-data; name="DB"
    DB1
    Best regards,
    KR,
    Laurent

    Dear All,
    We run a scenario Proxy=>PI=>HTTP
    The remote service accepts messages POSTed using either the form-encoded format (name, value pairs)
    or the multi-part mime format which enables the files to be passed to the web service.
    In both cases, the external service replies with a multi-part message.
    We are going to use the SOAP adapter (plain HTTP does not support attachments)
    with nosoap flagged.
    What is best approach to add a prolog before the actual XML with SOAP adapter,
    to simulate the form-encoded format?
    Example :
    USER=USER1&PASS=PASS1&DB=DB1
    In the 2nd situation, how to create the different documents before the actual XML?
    Example :
    7d924f5b0464
    Content-Disposition: form-data; name="USER"
    USER1
    7d924f5b0464
    Content-Disposition: form-data; name="PASS"
    PASS1
    7d924f5b0464
    Content-Disposition: form-data; name="DB"
    DB1
    Best regards,
    KR,
    Laurent

  • Sending email attachements using unix !!

    hi
    I want to send report generated my spooled file as attachment using unix shell script.
    Can somebody help me out ?
    many thanks

    Nothing to do with PL/SQL.
    Anyway, here's a snippet from a Unix shell script I wrote that does notification (via various methods). The code snippet is from the part where an e-mail with attachment is created for the Unix mail command. The variable names are (I hope) self explanatory.
    <font color="blue">
    ConstructMail()
      # do we have an attachment and does the file exist?
      if  [ "$ATTACHMENT" != "" ] && [ ! -f $ATTACHMENT ]
      then
        Abort "Error. File [$ATTACHMENT] not found."
      fi
      # create the boundary tags for the attachment
      if [ "$ATTACHMENT" != "" ]
      then
        BASE=`basename ${ATTACHMENT}`
        BOUNDS1="-"`hostname`.`date +%y%m%d%H%M`.$$
        BOUNDS2="--"$BOUNDS1
      fi
      # now we construct a MIME e-mail that includes boundaries for e-mail
      # attachments
      echo "To: $EMAIL_RECIPIENT"                              >> $LETTER
      echo "Subject: $SUBJECT"                                    >> $LETTER
      echo "MIME-Version: 1.0"                                    >> $LETTER
      if  [ "$ATTACHMENT" = "" ]
      then
        echo "Content-Type: Text/plain; charset=US-ASCII"           >> $LETTER
      else
        echo "Content-Type: Multipart/Mixed; Boundary=\"$BOUNDS1\"" >> $LETTER
        echo ""                                                     >> $LETTER
        echo "$BOUNDS2"                                             >> $LETTER
        echo "Content-Type: Text/plain; charset=US-ASCII"           >> $LETTER
      fi
      # now let's add the message's text body
      if [ -f $LETTER_BODY ]
      then
        cat $LETTER_BODY                                            >> $LETTER
      else
        Abort "Error. Letter body [$LETTER_BODY] not found!"
      fi
      # if we have an attachment, let's add it now
      if  [ "$ATTACHMENT" != "" ]
      then
        echo "$BOUNDS2"                                                   >> $LETTER
        echo "Content-Type: Text/plain; charset=US-ASCII; name=\"$BASE\"" >> $LETTER
        cat ${ATTACHMENT}                                                 >> $LETTER
      fi
    </font>The only real complexity is creating the boundary tags between attachment and the mail body - and of course specifying the correct e-mail headers so that the mail reader will know what is what.
    The above code creates a $LETTER file and this is then simply e-mailed using the Unix mail command, e.g.
    /usr/bin/mail $RECIPIENT < $LETTER
    More details in RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies. http://www.faqs.org/rfcs/rfc2045.html

  • Barcode shows a bunch of squares when barcode is made on AI CS11. Does anyone know a fix for this? We have CS2 running on another PC and we don't get this problem.

    Barcode shows a bunch of squares when barcode is made on AI CS11. Does anyone know a fix for this? We have CS2 running on another PC and we don't get this problem.
    Background:
      Using FrameMaker 7.1 to create a PDF file where a CS11 barcode file is embedded. PDF generates fine but we get a bunch of squares when we copy and paste the barcode data into Notepad.
      We have CS 2 running on another PC and we don't get this problem. Do I need to install a plugin (if any) for CS11 to get this to work?
    Thanks!

    Thanks for your feedback.  I was not able to mention earlier that in my line of work, we use Notepad to check if the barcode text is written correctly or if the corresponding text can be found if searched in the PDF... We use FREE3OF9.TTF font when entering text values for the barcode (usually in document/part number format exclusive for our company's use) in AI CS11. After saving the AI file, we attach it in a document using FrameMaker 7.1, then a PDF file is created. The output PDF will be a certification sheet for our products. They (our clients) should be able to scan the document/part number out of the barcode. I'm sorry, I could not divulge any other information so I am not sure if this clears out the issue. It used to work before but I had to get my PC formatted and since then I have been encountering this problem. I am trying to figure out if we missed to install a component or something got messed up after re-installing Adobe Illustrator CS11.

Maybe you are looking for

  • Hr abap urgent

    hello experts, I have a requirement in the project .There is a programme which creates new hire sap account in sap r/3 manully in production server .Currently this programme SKIPS INFOTYPE 105 Subtype 0001.The requirement is mentioned below.we are no

  • ERROR During call of SOAP with a SOAP- RFC- SOAP Synchronous scenario

    Hello Experts, I've recently created a SOAP->RFC->SOAP synchronous scenario but every time I'm invoking the SOAP via XMLSpy then i will hang and send a timeout error. Also a log in XI was generated as shown below. I hope you could help me on this one

  • File metadata management - application wanted

    Hi folks, i have a lot of pictures and other files, that are lying around, i guess we all have. the problem with sorting emerges ever again. sorting in folders results in a very strict and static structure, which is good sometimes and sometimes not.

  • In my shared area on network it's displaying that I shared with a fellow macbook pro

    However I haven't shared with any other macbook pro user, to the best of my knowledge, so I am wondering how this has appeared, or am I just being completely stupid and is it just displaying my macbook pro?

  • UWL iView in Sharepoint: Popup shows TLN

    We are displaying the Unviversal Worklist (UWL) iView in Sharepoint. Whenever an item therein is clicked, the resulting Popup displays the DTN (Detailed Navigation) and TLN (Top-level Navigation) in the Popup and displays the content in the Content A