Unable to view data of excel downloaded using JIRA API

Hi,

I am using jira application scope to download excel.
Excel is downloading but i am not able to see excel data.
some other information is showing.
check below screenshots
1
2

for csv,xlsx,xlx able to download.
for csv opening and showing data as per above image.
for xlsx and xls downloading but giving error while opening
@Cristian_Negulescu
Kindly help me with same

Hello Mathkar,
To be fair I have no idea.
Please try this approach

The raw code from the component is this one:
JQLclass emp = new JQLclass();
emp.jql = “key="”+ idDecision.Trim() + “"”;
emp.maxResults = 1;
List tmpx = new List();
tmpx.Add(“attachment”);
emp.fields = tmpx;

                    string json = JsonConvert.SerializeObject(emp);

                    restCallURL = serviceURL + "/rest/api/latest/search";
                    apirequest = new HttpRequestMessage(HttpMethod.Post, restCallURL);
                    apirequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    apirequest.Headers.Add("Authorization", authToken);
                    insertString = new StringContent(json, Encoding.UTF8, "application/json");
                    apirequest.Content = insertString;
                    apiCallResponse = await apiCallClient.SendAsync(apirequest);

                    requestresponse = await apiCallResponse.Content.ReadAsStringAsync();
                    Response = requestresponse;
                    ValidConnection = true;
                    if (apiCallResponse.IsSuccessStatusCode)
                    {
                        JToken tokens = JToken.Parse(requestresponse);
                        if (tokens.Children().Count() > 0)
                        {
                            JToken token2 = tokens["issues"];
                            foreach (JToken jk in token2.Children())
                            {
                                JToken token3 = jk["fields"];
                                JToken token4 = token3["attachment"];
                                foreach (JToken jt in token4.Children())
                                {
                                    String title = ""; String link = "";
                                    foreach (JProperty jp in jt)
                                    {
                                        if (jp.Name.ToString().Trim().Equals("filename"))
                                            title = jp.Value.ToString();
                                        else if (jp.Name.ToString().Trim().Equals("content"))
                                            link = jp.Value.ToString();
                                    }
                                        restCallURL = link;
                                        apirequest = new HttpRequestMessage(HttpMethod.Get, restCallURL);
                                        apirequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                                        apirequest.Headers.Add("Authorization", authToken);
                                        apiCallResponse = await apiCallClient.SendAsync(apirequest);

                                        Stream s = await apiCallResponse.Content.ReadAsStreamAsync();
                                        byte[] doc = null;
                                        MemoryStream ms = new MemoryStream();
                                        s.CopyTo(ms);
                                        doc = ms.ToArray();
                                        File.WriteAllBytes(nameDecision + "\\" + title, doc);                                        
                                }
                            }
                        }                        
                    }
                }

Thanks,
Cristian

yes i did the same as suggested in the video