Getting error on the execution of "RenderAsync".

  • Hi,

    Getting error when executed "RenderAsync".

                var rs = new ReportingService(url, username, password);
                var report = rs.RenderAsync(reportcode, " ").Result;

    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
    at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()

    Thanks In Advance.

  • administrators

    hi! i think you are missing the usage of await keyword in your code (since RenderAsync is a .net async function).

    the usage is something like the following:

    var rs = new ReportingService(url, username, password);
    var report = await rs.RenderByNameAsync("NameOfYourTemplate");

    if you want to render with other options or you want to see more examples check the .net client docs

  • Please catch the exception and check out the inner exception. There should be mentioned the actual error.

    Not sure if you intentionally omitted the second parameter in rs.RenderAsync(reportcode, " ").Result;. But it should be a serializable object or a json string. The string with space may not be valid.

  • Thanks

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.