Also tried running it using the jsreport studio and it worked but not from the hosted version of the jsreport i have could it be a version issue? version on the site is version: 2.11.0
T
techteamava4u
@techteamava4u
0
Reputation
3
Posts
485
Profile views
0
Followers
0
Following
Posts made by techteamava4u
-
RE: Unable to render xlsx template in .net c#
-
RE: Unable to render xlsx template in .net c#
So i created a helper method to handle the template and make the request
public async Task<byte[]> RenderExcelAsync(string exceltemplate, object exceldata, string excelhelperFunctions = null) { try { Template excelt = new Template() { Engine = Engine.Handlebars, Recipe = Recipe.Xlsx, Content = "{{{xlsxPrint}}}", Xlsx = new Xlsx() { TemplateAsset = new Asset() { Encoding = "base64", Content = exceltemplate } } }; if (!string.IsNullOrEmpty(excelhelperFunctions)) excelt.Helpers = excelhelperFunctions; RenderRequest req = new RenderRequest() { Template = excelt, Data = exceldata }; var result = await _service.RenderAsync(req); if (result.Content != null) { using (var memoryStream = new MemoryStream()) { result.Content.CopyTo(memoryStream); return memoryStream.ToArray(); } } else throw new ApplicationException("There was an error generating the PDF file."); } catch (Exception) { throw; } } }
it runs but instead of returning the rendered document it returns the template basically
-
Unable to render xlsx template in .net c#
I need some help when i try to render an xlsx template using the c# sdk it keeps returning the template instead of the rendered document