Quantcast
Channel: SCN : Discussion List - Business Server Pages (BSP)
Viewing all articles
Browse latest Browse all 237

BSP - download xlsx(excel 2007) document - error

$
0
0

Hi all,

 

i have a requirement to download different types of documents saved in server. All MS office documents are downloading correctly. it is supporting .xls files but .xlsx files are beiong saved and opened but with empty data, when opened in text document, it shows unrecognized characters(corrupted data)

 

i am using the  below code.

 

1. FM to get the data in bianry format, file name and mome type.

 

2. then....

    concatenate 'attachment;filename=' <filename> into lv_content_disposition_value .

 

    loop at <binary data> into LT_CONTENT_BIN.   " LT_CONTENT_BIN is of RAW(1022) type

      CONCATENATE xstr LT_CONTENT_BIN-line INTO xstr IN BYTE MODE.

    endloop.

 

 

    me->response->set_data( data = xstr ).

    me->response->set_header_field( name = 'Content-Type' value = lv_mimetype ).

    me->response->set_header_field(

       NAME  = 'content-disposition'

       VALUE = lv_content_disposition_value ).

 

    navigation->response_complete( ).

 

the above code is written in Controller - do_request. no view is being called at the end. only the controller is available.

 

this is of high priority.. so please respond quickly.

 

thanks in advance.

 

Ajay.


Viewing all articles
Browse latest Browse all 237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>