1656
Views
5
Comments
Solved
Server cannot set content type after HTTP headers have been sent - Excel

Doing recordlist to excel and trying to download but receiving this message:

Server cannot set content type after HTTP headers have been sent.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Vinicius,

You are probably trying a download in a Screen Action that is called from a Button or Link with Method Ajax Submit. This isn't possible (this is a limitation of HTTP). You need a Button with Method Submit (not Ajax).

UserImage.jpg
hanafi

Thanks @Kilian Hekhuis, i found the answer from my problem

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Hanafi,

Glad I could be of help :). Happy coding!

UserImage.jpg
Mitsunobu Matsuka

Kilian Hekhuis wrote:

Hi Hanafi,

Glad I could be of help :). Happy coding!

 Hi, sorry to interrupt you. You said "You need a Button with Method Submit (not Ajax) ". Is this applicable to a button in an Web Block?

I will appreciate your reply since I am a starter....

 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Mitsunoba,

If you want to download a file, you need to trigger it with a Button that's set to Submit, otherwise it won't work. Whether or not it's in a Web Block is of no concern, since ultimately, the Web Block is just part of the page.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.