How to implement custom report definition storage which can receive report xml string definition

0 Answers 183 Views
General Discussions Report Designer - Web Rest Service
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
Tursunkhuja asked on 08 Sep 2023, 10:28 AM

Hi All,

We are implementing Web Report Designer in our project. There is Telerik Reporting service is running as a separate service (in Azure VM), our server-side project is also running in k8s which communicate to the Reporting service through gRPC. The Reporting service has custom implementation for IReportSourceResolver (for report preview) and IDefinitionStorage (for report design). We store xml content of a report file in the database that is beside of out server-side project. In the middleware of our project, we need to send report xml content. The problem we have is that xml string is too long and has unsupported characters to be used in Uri.

If you set just Telerik report file name (for report parameter in webReportDesigner.html), then it works. See CustomReportDefinitionStorage class in the picture below. That GetAsync() method works only when you send just report file name. But it doesn't work when you send entire report content as a XML string. Is there any solution or workaround to do this with report xml? Is there a way to do with POST query?

 

Thanks!

Dimitar
Telerik team
commented on 12 Sep 2023, 02:36 PM

Hi Tursunkhuja,

I may be misunderstanding parts of your scenario but why do you need to work with URIs when passing an XML string?

When the argument is an XML string rather than a path to a report file, you should be able to get the bytes with the Encoding.GetBytes method, for example:

return Encoding.UTF8.GetBytes(xmlString);

There should be no problems with this since internally, inside the TRDP package, the report definition is saved in an XML with UTF-8 encoding and if there were invalid characters, the report would not be able to be saved.

In your case, do you get some kind of error when you attempt this? I would appreciate it if you could share your CustomReportDefinitionStorage code since the provided image has only the unimplemented members of the interface.

I will be looking forward to receiving an update from you.

Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 12 Sep 2023, 03:58 PM

Hello Dimitar,

The reason of why I'm working with URIs when passing an XML string is my report files is not stored in around Reporting service project. That's why I'm creating CustomReportDefinitionStorage and also there is report customization in GetAsync() method. So, reporting service doesn't have access to report file itself.

The question is how can we send XML string as an argument? I'm going to send XML string from our project which knows Reporting service address and uses webReportDesigner.html by passing report parameter (as report XML string).

 

Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 15 Sep 2023, 05:57 AM

Any updates on this?
Dimitar
Telerik team
commented on 15 Sep 2023, 08:49 AM

Hi Tursunkhuja,

To send the XML string as an argument, you need to either use the report property of the Web Report Designer options - Web Report Designer Initialization Options - Telerik Reporting, or you need to override the GetReportAsync(String) method of the report designer service's controller.

Then, through the "reports/report" endpoint, you may send the XML in the request body, for example. If you have problems with invalid characters, you may try to convert the string to Base64 while sending it, and you may re-convert it on the server.

If you need further assistance, please share a sample code of what you are currently trying to do so that we can get a better idea of the requirement.

 

 

Muhammad
Top achievements
Rank 2
commented on 18 Oct 2023, 12:30 PM

I created support ticket and continue with this problem. I thknk it's fine to discuss more details and to know solution from there.
Dimitar
Telerik team
commented on 19 Oct 2023, 11:29 AM

Hello Muhammad,

I have just replied to the support ticket, let us please continue the discussion in one of the two threads in order to not duplicate the content.

Thank you for your understanding!

No answers yet. Maybe you can help?

Tags
General Discussions Report Designer - Web Rest Service
Asked by
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or