Web Report Designer throws exception when trying to create a trdp report

1 Answer 38 Views
.NET Framework Report Designer - Web Rest Service
Arthur
Top achievements
Rank 1
Veteran
Iron
Arthur asked on 11 Oct 2022, 09:36 AM | edited on 11 Oct 2022, 09:36 AM

Hi,

I am trying to implement the Web Report Designer using version 16.2.22.914 under .NET Framework 4.8.

When I try to create a report (both trdx and trdp), the following method gets called

Task<byte[]> GetAsync(string resourceName)

It either returns some bytes or null whether or not the report already exists. The following method then gets called in 3 out of 4 different scenarios (defined below)

Task<ResourceFileModel> SaveAsync(SaveResourceModel model, byte[] resource)

- Scenario 1: Creating a trdx that already exists
- Scenario 2: Creating a trdx that doesn't exist
- Scenario 3: Creating a trdp that already exists
- Scenario 4: Creating a trdp that doesn't exist

When dealing with scneario 4, the SaveAsync method is never called and I get the exception shown in 1_error.png

I have no idea what the difference is and what could cause this issue.

Thanks in advance,

Arthur

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 11 Oct 2022, 02:58 PM

Hello Arthur,

Thank you for the provided information!

In R3 2022, we started working on supporting the localization of the report content in the Web Report Designer. There are some checks that are performed after the creation of the report, whether it is localizable or not which end up causing this exception when GetAsync returns now.

We have improved the error handling and in the next release(R3 SP1 2022), it will be fine even when GetAsync returns null but in the meantime, you need to throw a ReportNotFoundException instead of returning a null value.

For example:

        public async Task<byte[]> GetAsync(string definitionId)
        {
           // some method that will return the bytes from the DB or null if there is no such  
            //existing definition id
            var bytes = GetReportBytes(definitionId);

            if(bytes == null)
            {
               //handled internally
                throw new ReportNotFoundException();
            }
  
            return bytes;
        }

Please let me know if you have any further questions.

Regards,
Dimitar
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/.
Tags
.NET Framework Report Designer - Web Rest Service
Asked by
Arthur
Top achievements
Rank 1
Veteran
Iron
Answers by
Dimitar
Telerik team
Share this question
or