SkipBlankPages set to false but report still displays nothing at all when dataset is empty

2 Answers 304 Views
Report Viewer - Blazor
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Daniel asked on 08 Dec 2021, 02:18 PM

My report has a header, footer, and 3 group sections. When I choose parameter values that result in data to display the report has everything as it should be. When I pick parameter values that result in no data rows returned to the report it shows nothing whatsoever; no headers/trailers/labels of any kind, even with SkipBlankPages set to false. 

For what it's worth the debug window is displaying an error message both when the report is successful with data and when it is not. Maybe that error is affecting the report's behavior only when it has no data to display? Here's the text of the debug messages. Is there anything else I can provide that would be useful for this issue?

Telerik Reporting Assembly Information
======================================
Name: Telerik.Reporting, Version=15.2.21.1125, Culture=neutral, PublicKeyToken=a9d7983dfcc261be; Location: C:\inetpub\wwwroot\TimeEntry\bin\Debug\net5.0\Telerik.Reporting.dll; TargetFramework: .NETStandard,Version=v2.0
Error: Could not deserialize object of type ReportInstanceKey. Exception: System.Text.Json.JsonException: Cannot resolve type by type discriminator 'Int64'
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.ResolveDerivedType(String typeDiscriminator)
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.ObjectJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.DictionaryDefaultConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.TryRead[TArg](ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo, TArg& arg)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.ReadAndCacheConstructorArgument(ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo)
   at System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](ReadOnlySpan`1 utf8Json, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.SerializationUtils.Deserialize[T](Byte[] bytes, JsonSerializerOptions options).
Error: Could not deserialize object of type ReportInstanceKey. Exception: System.Text.Json.JsonException: Cannot resolve type by type discriminator 'Int64'
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.ResolveDerivedType(String typeDiscriminator)
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.ObjectJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.DictionaryDefaultConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.TryRead[TArg](ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo, TArg& arg)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.ReadAndCacheConstructorArgument(ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo)
   at System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](ReadOnlySpan`1 utf8Json, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.SerializationUtils.Deserialize[T](Byte[] bytes, JsonSerializerOptions options).
Error: Could not deserialize object of type ReportInstanceKey. Exception: System.Text.Json.JsonException: Cannot resolve type by type discriminator 'Int64'
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.ResolveDerivedType(String typeDiscriminator)
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.ObjectJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.DictionaryDefaultConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.TryRead[TArg](ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo, TArg& arg)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.ReadAndCacheConstructorArgument(ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo)
   at System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](ReadOnlySpan`1 utf8Json, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.SerializationUtils.Deserialize[T](Byte[] bytes, JsonSerializerOptions options).
Rendering thread 23 starts work.

*** ReportProcessor.ProcessReport STARTED ***

*** ProcessReport #0 STARTED ***
*** ProcessReport #0 DONE in 00:00:00.7179006 ***

*** ReportProcessor.ProcessReport DONE in 00:00:00.7811229 ***

Runtime OS information: X64, Microsoft Windows 10.0.19042

*** Render Report #0 STARTED ***
ReportName: AllowanceDetail; DocumentName: AllowanceDetailReport; Extension: HTML5Interactive
DeviceInfo Contents
===================
BasePath: "api/reports"
ContentOnly: "True"
CurrentCulture: "en-CA"
CurrentUICulture: "en-US"
DocumentID: "97e11534741f3feed83f99"
enableSearch: "True"
EndPage: "0"
internal_format: "HTML5Interactive"
key: "en-US"
ProcessItemActions: "True"
ResourceFormat: "api/reports/clients/b3e7bedaebd/instances/1b8ae2279a0/documents/97e11534741f3feed83f99/resources/{0}/"
StartPage: "0"
SupportsMargins: "False"
SupportsVerticalTextAlignment: "False"
UseSVG: "True"
Page generated: page1
Page generated: page2
*** Render Report #0 DONE in 00:00:00.1830840 ***

Page generated: page3
Rendering thread 23 finishes work.
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Private.CoreLib.dll

2 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 13 Dec 2021, 10:22 AM

Hello Daniel,

The Stack Trace has logged a successful rendering of a report with 3 pages. Is this log from an empty report rendering?

The particular errors before the rendering seem related to the serialization when reading the REST Service cache. I don't think they are related to the rendering.

Do you use only Report Group Headers/Footers? Without Page Header/Footer and without Report Header/Footer?

If so, the observed behavior is expected, as there would be no groups generated when there is no data coming to the report. However, the Report Header/Footer and the Page sections will still exist. The reason is that all the report group and detail sections are generated based on the Report data when it has DataSource assigned. When this data is empty/null, these sections are not generated. If the report doesn't have DataSource assigned, each of these sections is generated once.

With the above in mind, I suggest including all the static data you need to display in the Report Header/Footer and/or Page Header/Footer of the Report so that it can be displayed even when the data is missing.

Regards,
Todor
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
0
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
answered on 13 Dec 2021, 12:44 PM

Thanks for your reply. To answer your questions, that log was from a successful report. This log here is from an unsuccessful report (completely blank page) but it also has the same error message mentioned as the successful one:


Telerik Reporting Assembly Information
======================================
Name: Telerik.Reporting, Version=15.2.21.1125, Culture=neutral, PublicKeyToken=a9d7983dfcc261be; Location: C:\inetpub\wwwroot\TimeEntry\bin\Debug\net5.0\Telerik.Reporting.dll; TargetFramework: .NETStandard,Version=v2.0
Error: Could not deserialize object of type ReportInstanceKey. Exception: System.Text.Json.JsonException: Cannot resolve type by type discriminator 'Int64'
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.ResolveDerivedType(String typeDiscriminator)
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.ObjectJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.DictionaryDefaultConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.TryRead[TArg](ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo, TArg& arg)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.ReadAndCacheConstructorArgument(ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo)
   at System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](ReadOnlySpan`1 utf8Json, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.SerializationUtils.Deserialize[T](Byte[] bytes, JsonSerializerOptions options).
Error: Could not deserialize object of type ReportInstanceKey. Exception: System.Text.Json.JsonException: Cannot resolve type by type discriminator 'Int64'
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.ResolveDerivedType(String typeDiscriminator)
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.ObjectJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.DictionaryDefaultConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.TryRead[TArg](ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo, TArg& arg)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.ReadAndCacheConstructorArgument(ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo)
   at System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](ReadOnlySpan`1 utf8Json, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.SerializationUtils.Deserialize[T](Byte[] bytes, JsonSerializerOptions options).
Error: Could not deserialize object of type ReportInstanceKey. Exception: System.Text.Json.JsonException: Cannot resolve type by type discriminator 'Int64'
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.ResolveDerivedType(String typeDiscriminator)
   at Telerik.Reporting.Cache.DerivedTypesJsonConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.ObjectJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.DictionaryDefaultConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.TryRead[TArg](ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo, TArg& arg)
   at System.Text.Json.Serialization.Converters.SmallObjectWithParameterizedConstructorConverter`5.ReadAndCacheConstructorArgument(ReadStack& state, Utf8JsonReader& reader, JsonParameterInfo jsonParameterInfo)
   at System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](ReadOnlySpan`1 utf8Json, JsonSerializerOptions options)
   at Telerik.Reporting.Cache.SerializationUtils.Deserialize[T](Byte[] bytes, JsonSerializerOptions options).
Rendering thread 29 starts work.

*** ReportProcessor.ProcessReport STARTED ***

*** ProcessReport #0 STARTED ***
*** ProcessReport #0 DONE in 00:00:00.7039404 ***

*** ReportProcessor.ProcessReport DONE in 00:00:00.7682985 ***

Runtime OS information: X64, Microsoft Windows 10.0.19042

*** Render Report #0 STARTED ***
ReportName: AllowanceDetail; DocumentName: AllowanceDetailReport; Extension: HTML5Interactive
DeviceInfo Contents
===================
BasePath: "api/reports"
ContentOnly: "True"
CurrentCulture: "en-CA"
CurrentUICulture: "en-US"
DocumentID: "8993bd459f1e63fae7394f"
enableSearch: "True"
EndPage: "0"
internal_format: "HTML5Interactive"
key: "en-US"
ProcessItemActions: "True"
ResourceFormat: "api/reports/clients/bc20b61396e/instances/67ece8d5d94/documents/8993bd459f1e63fae7394f/resources/{0}/"
StartPage: "0"
SupportsMargins: "False"
SupportsVerticalTextAlignment: "False"
UseSVG: "True"
*** Render Report #0 DONE in 00:00:00.0897693 ***

Page generated: page1
Rendering thread 29 finishes work.

This report has a PageHeaderSection that has static labels, the page number, current date/time, and displays a parameter value. Attached are some pictures of the report in design time, the initial results of the report when the dataset has data, and the results of the report when it doesn't have data.

Todor
Telerik team
commented on 16 Dec 2021, 08:45 AM

Indeed, the error is the same as when the report is rendered with content. The log shows that there is one page generated, as well as the viewer. The rendering format is "HTML5Interactive".

Indeed, in this format, the page header/footer was not displayed also in my local tests. I suspect that this was due to the missing detail section. If I introduced a detail section, the page section was shown.

If you switch to Print Preview mode, the report will be rendered with physical pages and the Page Header/Footer will appear and you may use this as a workaround. The pagination in this format is hard as explained in the article Interactive vs. Print Layout. In Interactive View, the pagination is soft, which is probably related to the problem.

I have logged the issue as a bug in our public feedback portal - In Interactive View, when there is no Detail section rendered in the Report, the Page Sections also don't appear. As a token of gratitude for sharing the issue with us, we have updated your Telerik points.

Tags
Report Viewer - Blazor
Asked by
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Todor
Telerik team
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or