This is a migrated thread and some comments may be shown as answers.

Sending additional parameters from web designer

7 Answers 353 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mirzodaler
Top achievements
Rank 1
Veteran
Mirzodaler asked on 17 Jun 2020, 06:59 AM

Hi all,

I have a following default code in a html file for a web designer.

$(document).ready(function () {
            $("#webReportDesigner").telerik_WebReportDesigner({
                persistSession: false,
                toolboxArea: {
                    layout: "list"
                },
                serviceUrl: "some url",
                report: "some_report_name",
            }).data("telerik_WebDesigner");
        });

I have also a custom report storage implemented from IDefinitionStorage, where I have a GetDefinition("some_report_name") method implemented in a custom way. In order to do that, I need to send additional parameters from a web designer (html code provided previously) but don't know how to do that. 

For example, I need to open SalesInvoice.trdx file and I do a following: report: "SalesInvoice.trdx". If i need to send additional parameter, let's say some kind of token, there is no good place to send it. As a work around, i am doing report: "SalesInvoice.trdx&token=123". The problem with this, it is appearing in a title of a web designer and I don't want that. In an attachments, there is a screenshot where it looks good with a simple name and the one which has a token in it.

So, the question is, can I send other parameters as well from a client side of web designer to the server like parameters or so?

In a HTML5 ReportViewer we can send report file name and parameters as a reportSource like this:

                    serviceUrl: serviceUrl,
                    reportSource: {
                        report: reportUrl,
                        parameters: reportParams,

Can we do the same? Or how can I do that?

 

Thanks, 

Support
Top achievements
Rank 1
Iron
commented on 11 Jul 2022, 05:32 PM | edited

If you need a workaround you can override Jquery ReportViewer function and send your parameters

if($.fn['telerik_ReportViewer']){
const oldReportViewer = $.fn['telerik_ReportViewer'];
$.fn['telerik_ReportViewer'] = function (e) {
e.reportSource.parameters = {
Client_Name: "My Client Name"
, OrderNumber: "#1234567"
}

return oldReportViewer.apply(this, arguments);
}
}

7 Answers, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 22 Jun 2020, 07:30 AM

Hi Mirzodaler,

Currently, Web Report Designer does not expose any options for passing the parameter to the custom report storage. Could you let us know how exactly the parameter is used in your scenario? Does the parameter differ for each report or it is the same? This information will help us think about possible options and workarounds.

 

Regards,
Katia
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Mirzodaler
Top achievements
Rank 1
Veteran
answered on 22 Jun 2020, 08:26 AM

Hi Katia,

As my previous post states, I don't have exact report name. I am sending bunch of guids as a string and my custom report storage determine which report to get, it can be from a memory or database. I need to show a user friendly Title of the report in a web designer. If you see attached images in a previous post (title-with-token.png), you can see that it is not helpful title for a user.

Si if there will be a "report Title" property separated from reportUrl it can be helpful. Or report url with an array of parameters will be more elegenat.   

Thanks,

0
Katia
Telerik team
answered on 25 Jun 2020, 08:19 AM

Hi Mirzodaler,

So if I understood correctly the title of the report does not depend on the logic that retrieves the report in custom report storage? Do you know the title in advance?

 

Regards,
Katia
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Mirzodaler
Top achievements
Rank 1
Veteran
answered on 25 Jun 2020, 01:13 PM

Hi Katia,

Yes, the Title of the report is available in advance, only additional parameters needs to be sent without mixing it with title.

 

Thanks,

0
Katia
Telerik team
answered on 30 Jun 2020, 08:42 AM

Hello Mirzodaler,

Thank you for the additional clarifications. I logged your request into our Feedback portal - Provide a way to send additional parameters from web designer. This is the official process for processing new requests that allows us to measure the demand for features and plan them accordingly.

 

Regards,
Katia
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Support
Top achievements
Rank 1
Iron
answered on 11 Jul 2022, 05:33 PM

If you need a workaround you can override Jquery ReportViewer function and send your parameters

if($.fn['telerik_ReportViewer']){
const oldReportViewer = $.fn['telerik_ReportViewer'];
$.fn['telerik_ReportViewer'] = function (e) {
e.reportSource.parameters = {
Client_Name: "My Client Name"
, OrderNumber: "#1234567"
}

return oldReportViewer.apply(this, arguments);
}
}
Mirzodaler
Top achievements
Rank 1
Veteran
commented on 12 Jul 2022, 12:50 PM

Hi,

Thanks for letting us know. We are aware of using that with ReportViewer. We need that for

telerik_WebReportDesigner
Thanks,
0
Dimitar
Telerik team
answered on 14 Jul 2022, 10:35 AM

Hi Mirzodaler,

You may try to implement the approach from the Using PrintPreview as a Default ViewMode in the Web Report Designer KB article except that instead of using the viewMode method to set the view mode, you may call the reportSource(rs) method with the report source object.

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
General Discussions
Asked by
Mirzodaler
Top achievements
Rank 1
Veteran
Answers by
Katia
Telerik team
Mirzodaler
Top achievements
Rank 1
Veteran
Support
Top achievements
Rank 1
Iron
Dimitar
Telerik team
Share this question
or