on 11-23-2005 11:24 AM
Hi,
I followed the example in <b>Creating a BSP Extension for Downloading a Table</b> to get data from an internal table into excel.
weblog address ==> /people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table
My client really wants to have all value exported as text. That way the format is the same for all cells, because i have a column that contains code that can sometimes be 6B or 7. The 6B gets formatted as text, but the 7 as a number.
is there a way to overcome this formatting as number?
Greets
Luk
What you are describing is pretty much on the Excel side. If you save the file to your disk instead of opening it directly you can open it with a text editor. You will see that inside the file there is no difference between these two value cells. What we are outputting is simply a tab delimited text file.
The automatic import into Excel makes certain assumptions about the column and cell formats based upon the data that it finds in them. If you want to override this behavior, save the file locally and then open Excel. Once you have Excel running, do a file->open operation on the file (don't just double click the downloaded text file either). You then should get an import wizard that allows the user to override the default import settings and chose the column types.
I know this isn't optimal, but is really an "Excel thing". The only other solution I know of is to go a different route with your download. You can try and open Excel as an ActiveX control via Office Web Controls or by hosting the Excel control directly. These options require you to populate Excel through frontend scripting calls and to support ActiveX in the browser for your applciation.
Another interesting approach is to output an XML file. This is what WebDynpro ABAP does for its Excel Export. They use an XSLT program to convert the ABAP data to Excel's XML Schema. This XML format is well documented in Microsoft's knowledge base. This way you can set all the cell formats yourself. However this produces a significantly larger file!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Luk,
Concerning your specific Excel problem, this workaround solution (as "<b>ugly</b>" as it is) might help you.
Just put the following around the data you want to be <b>displayed</b> as text by Excel : ="xxx" , where xxx is the data.
Obviously, it means <i>mass-modifying</i> your table before export to Excel.
Best regards,
Guillaume
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.