Using excel vi's loses trailing zeroes

I've been given to write a program that saves columns of numbers to a txt
file that is in the format of spreadsheet. All the numbers in this file are
3 places format even if there are trailing zeroes. I am using the excel
vi's that I downloaded from NI. When I save the file all the numbers lose
their trailing zeroes. So when the user opens the file using notepad the
columns tend to not line up anymore. I can format the numbers I am writing
into strings, but still all the rest of the spreadsheet loses its trailing
zeroes. I wrote a quick fix that reads all 32 columns and reformats them as
strings with 3 places, but that is kind of a kludge. Is there a better way?

"Greg McKaskle" wrote in message
news:[email protected]..
> > I've been given to write a program that saves columns of numbers to a
txt
> > file that is in the format of spreadsheet. All the numbers in this file
are
> > 3 places format even if there are trailing zeroes. I am using the excel
> > vi's that I downloaded from NI. When I save the file all the numbers
lose
> > their trailing zeroes. So when the user opens the file using notepad
the
> > columns tend to not line up anymore. I can format the numbers I am
writing
> > into strings, but still all the rest of the spreadsheet loses its
trailing
> > zeroes. I wrote a quick fix that reads all 32 columns and reformats
them as
> > strings with 3 places, but that is
kind of a kludge. Is there a better
way?
>
> I'm not positive that I understand what is going on, but if you have
access
> to the diagrams, you should look for where the numbers are formatted. To
> format a number as a string and pad with zeroes, you can change the format
> to %0f, or %08.3f for eight chars with three decimal chars and filled with
> zeroes.
In excel ObjectRepository.vi (from excel get data to modify.vi from excel
save.vi) the diagram can't be viewed without a password. I think that is
where the data is prepared for saving. I never even knew diagrams could be
protected like that.

Similar Messages

  • Answers report-download as Excel loose trailing zeroes

    Hi!
    When I download Answers report to Excle (Word) I loose trailing zeroes.
    1.2500 -> 1.25Trailing zeroes are important and I'd like that format remain as it is in OBI in all downloading types (Excel, Word etc).
    When I export to PDF (run through Oracle BI publisher) trailing zeroes are correct.
    Any help please.
    My config, OBI on Windows 2003 32 bit:
    Product Information
    Oracle Business Intelligence Product Version     10.1.3.4 (Build 080726.1900)
    Physical Presentation Catalog Path     \\?\C:\OracleBIData\web\catalog\teb\root
    Oracle BI Server Data Source     AnalyticsWeb
    Available Paging Memory (MB)     5176
    Available Virtual Address Space (MB)     1833

    Hi,
    here are mine data as requested ...
    The only three formating columns are Cash up KN, Cash up EUR i Cash up EUR/KN.
    Column that has problem has no "mso" like formating at all, only two decimal number format, defined in classic way in OBI.
    Generated Excel file from OBI:http://sites.google.com/site/vadasovi/icon_holders-1/BAZA.xls
    How it is opened in Excel 2003:http://sites.google.com/site/vadasovi/_/rsrc/1318338523563/Home/temp/2007.PNG , look column in red.
    Same file in Excel 2010 (other mashine then 2003:http://sites.google.com/site/vadasovi/_/rsrc/1318338543353/Home/temp/2010.png
    Both client are Win XP SP3 with Croatian locale (same one in detail).
    Rg,
    Damir

  • Export to excel truncates trailing zeros

    When we try to export to excel trailing zeros are truncated like this:
    In report on BIEE dashboar:
    Product----Amount
    Product A 327,876
    Product B 4,000
    Product C 1,278
    In the exported excel spreadsheet:
    Product A 327,876
    Product B 4
    Product C 1,278
    Any ideas for a solution?

    well it is because excel thinks the the comma is a decimal seperator in stead of a thousands seperator.
    So check your operating system properties and your excel properties.

  • How to remove trailing zeros using EngineeringFormatInfo?

    HI,
    I found a measurement studio formatter for SI notation.  
    For details, see the NI document.
    Here, I want to know how to remove any trailing zeros. I could not find any information about this. 
    For example, 
    code : string result = string.Format(EngineeringFormatInfo.Default, {0:s5}, double value)
    if  value = 1.2345678E-3,  result is 1.23457E-3. It is ok. 
    if  value = 1.2E-3,  result is 1.20000E-3. But I want to get "1.23m". 
    In labview, I usually use "%#.5p" format string.

    diluculo wrote:
    HI,
    I found a measurement studio formatter for SI notation.  
    For details, see the NI document.
    Here, I want to know how to remove any trailing zeros. I could not find any information about this. 
    For example, 
    code : string result = string.Format(EngineeringFormatInfo.Default, {0:s5}, double value)
    if  value = 1.2345678E-3,  result is 1.23457E-3. It is ok. 
    if  value = 1.2E-3,  result is 1.20000E-3. But I want to get "1.23m". 
    In labview, I usually use "%#.5p" format string.
    I don't understand how you are getting 1.23457E-3 ?  And claiming that is okay.
    If you are using the format string that you claim you are using, then you should be getting 1.23457m.
    It sounds like you are using string result = string.Format(EngineeringFormatInfo.Default, {0:E5}, value)

  • ALV export to Excel, some field lose char

    Dear SAP,
    when I develop a report have one field is PR NO(BANFN), and show result in ALV, then user download the report to excel, but the PR# lose the last number, I don't know how to solve this problem, Please help!
    Ivan

    Hi
    you can use  fm: CONVERSION_EXIT_ALPHA_OUTPUT
    to delete useless zero of aufnr
    Or:
    set fieldcatlog-seltext_l longer
    for example:
    fieldcatlog-fieldname = 'AUFNR'.
    fieldcatlog-seltext_l =  'ProductionNumber'.
    Wish it works.
    Best Regards.

  • How to delete trailing zeros from a quantity field to display in ALV?

    Hi there,
    i am retrieving the field LGMNG from LIPS table, which is of type QUAN(13). All LGMNG values there are stored as
    1,000
    20,000
    50,000 etc.
    But i want my values to be displayed as
    1
    20
    50 etc.
    i have tried the " shift v_variable right deleting trailing '0'" but it does not work.
    also, if the value of LIPS_LGMNG =  0,000, i need those columns in ALV empty(that is no zeros or comma displayed)
    can anyone please help?
    Thanks a lot,
    Mee

    hi,
    use this it will solve your problem, just write down this on your Fieldcatalog.
       WA_FIELDCATALOG-FIELDNAME = 'VALUE7'.
       WA_FIELDCATALOG-SELTEXT_L = 'Contribution EE(due)'.
      WA_FIELDCATALOG-DATATYPE = 'INT2'.           " it will remove trailing zero
      WA_FIELDCATALOG-DECIMALS_OUT = 0.
       APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
       CLEAR WA_FIELDCATALOG.

  • I want to remove Trailing zeros from a charecter value

    Hello ,
              i want to remove trailing zeros for a prticular value.Following is my code :
    DATA: V_FLOAT TYPE F VALUE '4.8240000000000000E+03',
               V_CHAR(25) ,
               P10_4(10) TYPE P DECIMALS 4.
    CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'
    EXPORTING
    FLOAT_IMP = V_FLOAT
    FORMAT_IMP = P10_4
    ROUND_IMP = ' '
    IMPORTING
    CHAR_EXP = V_CHAR.
    SHIFT V_CHAR RIGHT DELETING TRAILING '0'.
    WRITE : V_CHAR ."NO-ZERO.
    <u><b>Output:</b></u>
    if we pass the value '1.3000000000000000E+01' it should be 13.0
    ex2: '1.3400000000000000E+01' it should be 13.4
    ex3:'4.8240000000000000E+03' it should be 4824
    is there any way to get the solution without functional module. If so Please tell me with code.

    hi
    u can do it in number of ways.
    Use TCODE SU3
    Select default tab and select radio button 123467.89 in decimal notation and save it.
    or u can try :
    if you want to do this through ABAP program.
    1. to delete trailing spaces.
    SHIFT <V_VARIABLE> RIGHT DELETING TRAILING '0'.
    to delete leading zeroes,
    SHIFT <VARIABLE_NAME> LEFT DELETING LEADING '0'.
    only for one abap program, u can use set country command
    for all programs :
    sap menu>system->go to user profil->own data>default --> and choose ur format.
    hope this helps u.
    Regards,
    Prasanth
    Reward all hepful replies

  • How to get PL/SQL output in Excelsheet & preserve trailing zero for VARCHAR

    Hi All,
    I am trying to get the PL/SQL procedure out put to Excel sheet, I have wrote below code and it worked fine.
    CREATE OR REPLACE PROCEDURE plsql_to_excel_demo IS
    CURSOR cur_stock_details
    IS
    SELECT *
    FROM stocks;
    outfile UTL_FILE.file_type;
    l_chr_string VARCHAR2(100);
    l_chr_col_header VARCHAR2(100);
    l_chr_file VARCHAR2(100);
    l_chr_date VARCHAR2(20);
    BEGIN
    SELECT TO_CHAR(sysdate,'DD_MON_YYYY')
    INTO l_chr_date
    FROM dual;
    l_chr_col_header :='SYMBOL'||CHR(9)||'COMPANY'||CHR(9)||'CURRENT_PRICE'||CHR(9)||'TRADE_DATE'||CHR(9)||'NUMBER_TRADED_TODAY'
    ||CHR(9)||'TODAYS_HIGH'||CHR(9)||'TODAYS_LOW';
    l_chr_file := 'STOCK_REPORTS_'||l_chr_date||'.xls';
    outfile := UTL_FILE.FOPEN ('/u01/app/UTL/out',l_chr_file, 'W');
    UTL_FILE.PUT_LINE(outfile,l_chr_col_header);
    FOR rec_stock_details IN cur_stock_details LOOP
    /*l_chr_string := rec_stock_details.symbol||CHR(9)||''''||rec_stock_details.company||''''||CHR(9)
    ||rec_stock_details.current_price||CHR(9)||
    TO_CHAR(rec_stock_details.trade_date,'DD/MM/YYYY')||CHR(9)||rec_stock_details.number_traded_today||CHR(9)||
    rec_stock_details.todays_high||CHR(9)||rec_stock_details.todays_low;
    l_chr_string := rec_stock_details.symbol||CHR(9)||rec_stock_details.company||CHR(9)||rec_stock_details.current_price||CHR(9)||
    TO_CHAR(rec_stock_details.trade_date,'DD/MM/YYYY')||CHR(9)||rec_stock_details.number_traded_today||CHR(9)||
    rec_stock_details.todays_high||CHR(9)||rec_stock_details.todays_low;
    UTL_FILE.PUT_LINE(outfile,l_chr_string);
    END LOOP;
    UTL_FILE.FCLOSE (outfile);
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line ('Error in main '||SQLERRM);
    END plsql_to_excel_demo;
    I am facing the issue when I have VARCHAR2 column say Company in stocks table with value as 0000234. When I get the data Excel
    sheet I can only see 234
    for company name. I want to preserve the trailing zeros while getting the output in Excel sheet.
    I have tried with adding single quote (') please see the commented part in the above code, but it will give me output in company
    column in excel '0000234' which i don't want.
    Is there any way I can make this work and only get 0000234 as company name in Excel.
    Thanks for reading the post..
    regards,
    Shyam.
    Edited by: Suryawanshi on Mar 22, 2010 5:40 PM

    Yes, that should be a client (excel, or open office in my case) issue.
    I stole some code from http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:95212348059 to test this out.
    Adding a single quote to the beginning of the string worked fine with my version of Open Office, should work for your Excel as well.
    create table varchar2_test(col1 varchar2(10), col2 number(10));
    insert into varchar2_test values ('000189', 10);
    create or replace function  dump_csv( p_query     in varchar2,
                                          p_separator in varchar2 default ',',
                                          p_dir       in varchar2 ,
                                          p_filename  in varchar2 )
    return number
    is
        l_output        utl_file.file_type;
        l_theCursor     integer default dbms_sql.open_cursor;
        l_columnValue   varchar2(2000);
        l_status        integer;
        l_colCnt        number default 0;
        l_separator     varchar2(10) default '';
        l_cnt           number default 0;
    begin
        l_output := utl_file.fopen( p_dir, p_filename, 'w' );
        dbms_sql.parse(  l_theCursor,  p_query, dbms_sql.native );
        for i in 1 .. 255 loop
            begin
                dbms_sql.define_column( l_theCursor, i, l_columnValue, 2000 );
                l_colCnt := i;
            exception
                when others then
                    if ( sqlcode = -1007 ) then exit;
                    else
                        raise;
                    end if;
            end;
        end loop;
        dbms_sql.define_column( l_theCursor, 1, l_columnValue, 2000 );
        l_status := dbms_sql.execute(l_theCursor);
        loop
            exit when ( dbms_sql.fetch_rows(l_theCursor) <= 0 );
            l_separator := '';
            for i in 1 .. l_colCnt loop
                dbms_sql.column_value( l_theCursor, i, l_columnValue );
                utl_file.put( l_output, l_separator || l_columnValue );
                l_separator := p_separator;
            end loop;
            utl_file.new_line( l_output );
            l_cnt := l_cnt+1;
        end loop;
        dbms_sql.close_cursor(l_theCursor);
        utl_file.fclose( l_output );
        return l_cnt;
    end dump_csv;
    variable x number;
    begin
       :x :=    dump_csv
                   p_query     => 'select '''' || col1, col2 from varchar2_test',
                   p_separator => ',',
                   p_dir       => 'TEST_DIR',
                   p_filename  => 'test_output.xls'
    end;
    print :x

  • Add Trailing  zeros to a number or char

    Hi Experts,
               my material number is stored in the form of Character so i want to add a trailing zero to that number
               supposr for example my material number is ccf5a   so i want add zeroes to make it 18  like   cf5a0000000000000 characters
              Please help me on this  hoping for the quick replay.

    Use [CONCATENATE|http://help.sap.com/abapdocu/en/ABAPCONCATENATE.htm] (only once with a constant initialized with 18 zeroes)
    or
    go to [PAD|http://help.sap.com/abapdocu/en/ABAPCOMPUTE_STRING_FORMAT_OPTIONS.htm#!ABAP_ADDITION_3@3@] in [Embedded expressions format_options |http://help.sap.com/abapdocu/en/ABAPCOMPUTE_STRING_FORMAT_OPTIONS.htm] in [String Templates - embedded_expressions|http://help.sap.com/abapdocu/en/ABENSTRING_TEMPLATES_EXPRESSIONS.htm] in [string_exp - String Templates |http://help.sap.com/abapdocu/en/ABENSTRING_TEMPLATES.htm] in [string_exp - String Expressions|http://help.sap.com/abapdocu/en/ABAPCOMPUTE_STRING.htm] in [Expressions and Functions for String Processing |http://help.sap.com/abapdocu/en/ABENSTRING_PROCESSING_EXPR_FUNC.htm]
    Regards,
    Raymon

  • How to delete Trailing zeros in a string array

    I am reading data from RS232 port and storing the values in an array of 16 nos. Then converting the array of numbers into string using 'number to fractional string" function with precession 2  and sending the data string to Table. I am printing this table further for report generation.
    I am unable to remove the trailing zeros as i am defining precession 2 which is not needed for all the numbers in the table.
    Please help me how to remove the trailing zeros after decimal point which is very much necessary for report generation.
    regards
    Prasanna Kumar N M

    Use format into string in a FOR loop with a format specified of %#f. See attached example (LabVIEW 7.0)
    Message Edited by altenbach on 10-14-2006 05:40 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    AutoFormat.vi ‏17 KB
    AutoFormat.png ‏3 KB

  • Simple transformation dropping trailing zero.

    Hi experts.
    I am having a problem with my transformation file, and I was hoping someone could help me.
    I have created a simple transformation file, with a variable using the type of "DMBTR" which Does have 2 decimal points.
    IF I have data - the two decimal points print.
    EG if the amount is 100.57..    I get the 100.57 to print which is what I need and expect.
    BUT.
    IF the amount is 100.50    I am getting 100.5    Is is dropping the final zero amount, and therefore is failing in the validation.
    HOW can I FORCE the two decimal points to print?
    I have even tried it where I declare it as a variable of type "I" with 2 decimal points, and it still does not work.
    I can not figure out how to use the Number format   option with a Value-ref print line.
    If someone could help me with that.. I could try that to see if it worked.
    thank you.
    eg: of the way the data is declared:
      <tt:type name="GRTOT14" type="I" length="13" decimals="2"/>
    OR
      <tt:type name="GRTOT16" type="ddic:DMBTR"/>
      <tt:type name="GRTOT17" type="ddic:DMBTR"/>
    eg: of the way I am using it where I am getting only one decimal place if the 2nd decimal place is ZERO
                 <tot_grnt_sbsdy_amt tt:value-ref=".GRTOT14"/>
                   <tot_insu_prcd_amt tt:value-ref=".GRTOT16"/>
                  <tot_opay_rcap_amt tt:value-ref=".GRTOT17"/>
    PLEASE HELP.
    thank you.

    From what I understand about XML (could be more), the canonical representation of decimal values does not allow a fixed number of decimal places.
    SAP documentation:
    http://help.sap.com/saphelp_nw04/helpdata/en/52/491a40251e2402e10000000a1550b0/frameset.htm
    from there, this XML documentation is referenced:
    http://www.w3.org/TR/xmlschema-2/#decimal
    important bit:
    Leading and trailing zeroes are prohibited subject to the following: there must be at least one digit to the right and to the left of the decimal point which may be a zero.
    You already discarded my workaround: using a character or string type field and fill it to your liking prior to serialisation.
    Thomas

  • Retain trailing zero's after decimal

    Hi,
    i have a requirement to retain trailing zero's after decimal....
    is it possible?
    version: 9.2.0.7
    example: select 150.200 from dual;
    we will get 150.2 as output.
    but i need 150.200 as the output...
    how would i do this?

    oraDBA2 wrote:
    Hi tony,
    sorry, that is not the constant value...that is a variable based on the value, what user enters with the decimals.......if i understood you correctly,
    it seems like you will need to use char or varchar2 datatypes in that table to start doing what you would like to do in the way you wan't it.
    and still you have option to apply to_number and to_char on that varchar2 column.
    SQL> create table b (charr varchar2(15) );
    Table created.
    SQL>
    SQL>
    SQL> insert into b (charr) values ('1000.000');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select* from b;
    CHARR
    1000.000
    http://stanford.edu/dept/itss/docs/oracle/10g/appdev.101/b10795/adfns_ty.htm#1006325

  • SQLLoader inserting trailing zeroes

    Hi,
    I have a .csv file with numeric data having no trailing zeroes after decimal point.
    But when I import data from this .csv file into oracle using SQLLoader, the data is stored in the form having trailing zeroes after decimal point.
    The datatype of column into which I am inserting this data is VARCHAR2.
    Can anyone please provide some information regarding this?
    Thanks in advance!
    Avinash.
    Pune - India.

    Hello,
    I am not sure at all that posting this kind of question in a Forms forum would increase your chances to get an answer. Did you try the database relative forums?
    Francois

  • Custom Number Format With Leading & Trailing Zeros

    Hi!
    How can I define following number format in Apple Pages (v3.5)?
    Positive numbers: +#'##0.00 (e.g. +0.30 or +5'000.00)
    Negative numbers: -#'##0.00 (e.g. -0.30 or -5'000.00)
    If I create a custom number format and enable Show Trailing Zeros, the leading zero is not shown (e.g. +.30 instead of +0.30). Number format with Thousands Separator enabled comes closest to what I need, but misses the plus sign for positive numbers (which I need to represent differences).
    Any ideas? Thanks in advance for your help!

    Hi Tuna,
    Maybe the currency format would work for you,
    The plus sign is problematic. With the above your negative numbers will be red and in brackets, positive numbers will be black. You could use conditional highlighting to change that.
    quinn

  • How to remove trailing zeros 20353675.0000000

    All numeric decimal columns all are showing trailing zeros, how to remove them while processing within the query transform.
    20353675.0000000
    Thanks a lot for the helpful info

    You can use the trunc function to remove the decimal places.
    Syntax: trunc( number, [ decimal_places ] )
              <number> is the number to truncate.
             <decimal_places> is the number of decimal places to truncate to. This value must be an integer. If this parameter is omitted, the trunc function will truncate the number to 0 decimal places.
    Eg:     trunc(125.815)  would return 125
              trunc(125.815,0)  would return 125
              trunc(125.815,1)  would return 125.8
             trunc(125.815,2)  would return 125.81
             trunc(125.815,-1)  would return 120

Maybe you are looking for

  • How to define the query condition of Image Theme in MapBuilder?

    Hi, I'm trying to add an dynamic Image Theme in OracleMap, but there's a problem.I defined the query condition of Image Theme like this: select scanimage,shap from image where scanimgid=467 The shap column is the MBR column And the XML CODE: <?xml ve

  • Syncing multiple iPhones to new macbook pro

    My wife and I both have iPhones which we sync to our work computers. We have both purchased different apps, and music, but also have a lot of the same music in each of our iTunes. I just bought a new macbook pro – which we are both going to sync to f

  • NON VALUATED SALES ORDER STOCK

    Hi Could someone able to give me Business examples for Non valuted sales order stock..? Aravind

  • Running Windows On MacBook

    I just recently purchased a MacBook but will be needing to run Windows and Internet Explorer, how do I do this and do I need to download something?

  • Error in tomcat4.1 and JSTL

    sir now i am using tomcat 4.1 and jstl 1.0.6 and i have write on file in which i included ... <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> but when i compile it , it gives error that ,,, org.apache.jasper.JasperException: This absolut