Currently, after you print a report in pdf format in Oracle form, you cannot modify the data. Therefore, you plan to import the data in the report to an Excel table, however, make sure that the Excel format is exactly the same as the report format designed in the report. My strategy is as follows:
1. in Excel, design the document templates to be output in the future based on the reports. Pay attention to the strict consistency with the reports during the design process, including the Row Height, column width, number of columns, Title name, font size, and so on. 2. save the designed template as an XML file. 3. design a Java applet to read text files line by line, add some form code and write it into another text file, that is, quickly generate program code; form calls the built-in function text_io.putf to build XML files row by row. 4. Copy the generated program code in segments to the appropriate position in the program. Here, pay attention to the uncopied program text snippets and the location in the program. 5. the program will compress the generated xls file to Facilitate network transmission and download to the local, so that you can directly open the XML file in Excel, because the format is set in XML, therefore, a complete Excel file is displayed. 6. Considering that the report has the paging function, I set the print title in the Excel page settings and save it as an XML template. Note: because the number of rows in the final Excel table is changed and cannot be determined, you must delete the row attribute (SS: expandedrowcount) related to sheet in the XML template, otherwise, if the actual number of rows is greater than the number of rows set here, an error will be reported when you open the Excel file.