Hi,
I'm getting an error trying to inspect Meta Logs from a gererated report (using the .NET client).
I'm accessing the logs as such:
var report = await reportingService.RenderAsync(request);
var logs = report.Meta.Logs.ToList();
Doing so results in the following error (Windows 64bit, Asp.NET Core 3.1 Console application):
Invalid cast from 'Int64' to 'DateTime'.
at System.Int64.System.IConvertible.ToDateTime(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Newtonsoft.Json.Linq.Extensions.Convert[T,U](T token)
at Newtonsoft.Json.Linq.Extensions.Value[T,U](IEnumerable`1 value)
at Newtonsoft.Json.Linq.Extensions.Value[U](IEnumerable`1 value)
at jsreport.Shared.SerializerHelper.<>c.<ParseReportMeta>b__0_0(JToken s)
I have traced the error to this Repository in ParseReportMeta:
Timestamp = s["timestamp"].Value<DateTime>()
In context:
public static ReportMeta ParseReportMeta(IDictionary<string, string> meta)
{
IEnumerable<LogEntry> logs = null;
if (meta.MetaValue("debugLogs") != null)
{
var joLogs = JArray.Parse(meta.MetaValue("debugLogs"));
logs = joLogs.Select(s => new LogEntry()
{
Message = s["message"].Value<string>(),
Level = (LogEntryLevel)Enum.Parse(typeof(LogEntryLevel), s["level"].Value<string>(), true),
Timestamp = s["timestamp"].Value<DateTime>()
});
}
...
}
I extracted the parsing logic into my application and changed the line to the following which seemingly works:
Timestamp = DateTimeOffset.FromUnixTimeMilliseconds(s["timestamp"].Value<long>()).UtcDateTime
Is it a bug or perhaps something with my setup?
Hi,
I'm getting an error trying to inspect Meta Logs from a gererated report (using the .NET client).
I'm accessing the logs as such:
Doing so results in the following error (Windows 64bit, Asp.NET Core 3.1 Console application):
I have traced the error to this Repository in
ParseReportMeta:In context:
I extracted the parsing logic into my application and changed the line to the following which seemingly works:
Is it a bug or perhaps something with my setup?