http://www.cnblogs.com/lzsu1989/archive/2012/10/17/2728528.htmlOracle EBS provides various forms of development and output of reports, and because of the obvious advantages of MS excel in processing data, report output is a common development item to open in Excel. but because Excel is "too smart to be smart", it sometimes causes output fields to be processed automatically by Excel, resulting in data errors. For example: The System internal field, the material Code/order label and so on the field stored in the database the format is varchar, in certain business or the demand, the encoding method is the full number form, like "100230001", "100230002",... Such a field is not a problem in the system, the report output to Excel also no problem, and the case may be, the number is "000031001", "000031002", "000031003",.... In this case, a 9-digit character is stored in the system, and after the report is output to Excel, Excel thinks that he is a number, not a string, so that the "0" before the string appears to be intercepted, becoming "31001", "31002", "31003",.... Such errors are not easy to detect, but they are a very unfriendly mistake. Workaround:
1. Concurrent Program output HTML reportThis type of report output is an HTML tag (or XML tag), this kind of report is truncated in the time of the output, the field is placed in the = "", for example, the Plsql code fragment is:fnd_file.put_line (fnd_file.output, ' <div>000031001</div> '); into:fnd_file.put_line (fnd_file.output, ' <div>= ' 000031001 ' </div> ');orfnd_file.put_line (fnd_file.output, ' <div> ' 000031001</div> ');
Explanation:The previous method, in Excel, = represents a formula, and in double quotation marks is the meaning of the string, that is, to set the current cell to be equal to the current value converted to a string meaning, similar to Oracle's TO_CHAR (); the latter method, in Excel, The cell value is preceded by a single quotation mark indicating that the cell is "bad formula", that is, the meaning of not automatically calculated, Excel cell to display the formula is also this method.
2. XML Publisher ReportXML Publisher reports In addition to the two methods above, you can also set the XML Publisher properties to solve this problem, directly look at the properties:
The <fo:bidi-override property is set to force LTR, is coerced to data format, and is not converted to a number in Excel, and the corresponding XML Publisher script code is: direction= "ltr" unicode-bidi= " Bidi-override "><? Assembly?></fo:bidi-override>
ORACLE EBS XML Publisher report output character field the front "0" is automatically removed by Excel.