Disable TRDP in dropdown new report

2 Answers 34 Views
.NET 5 .NET Core Actions Events Report Designer - Web
Tristan
Top achievements
Rank 1
Iron
Tristan asked on 22 Apr 2022, 11:48 AM
Hello,

Im trying to disable the TRDP option when creating a new report. i want to only keep TRDX extention.
If possible i want to remove the whole dropdown section in New report and always add the TRDX extention to new files.

Ive also been searching if it is possible to edit/style/add attributes to the GUI views in the web app since the whole reporter is initialized with only a few lines of JS. Is it possible to see the code which generates these views or is this all API based?

Kind regards,

Ueskia

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 27 Apr 2022, 08:48 AM

Hello Ueskia,

You may use the following piece of code which will select the TRDX option and disable the dropdown in the create report menu:

<script type="text/javascript">
    function setListener() {
        $('li[data-action="documentNew"]').click(function () {
            setTimeout(function () {
                var dropdownlist = $(".k-window").find("input.editor__dropdown").data('kendoDropDownList');
                dropdownlist.select(1);
                dropdownlist.readonly();
                setSqlDsListener();
            }, 200)
        })
    }
</script>

<script type="text/javascript">
    $(document).ready(function () {
        $("#webReportDesigner").telerik_WebReportDesigner({
            toolboxArea: {
                layout: "list" //Change to "grid" to display the contents of the Components area in a flow grid layout.
            },
            serviceUrl: "api/reportdesigner/",
            report: "Product Catalog.trdp"
        }).data("telerik_WebDesigner");
        setTimeout(function () {
            $('li[class^="main-menu__item"]').click(function () {
                setTimeout(function () {
                    setListener();
                }, 400)
            })
        }, 500)
    });
</script>

Regarding the Web Designer styles' attributes, it is currently not possible to edit the templates, they are indeed coming from the APIs behind the scenes. With that being said, we have a feature request about allowing more customization in the Web Report Designer that I recommend voting for - Make Web Report Designer UI customizable.

For now, you can use JS and CSS to apply styling changes to the Web Designer.

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/.
Ues
Top achievements
Rank 1
commented on 03 May 2022, 08:42 AM

Hello Dimitar,

Thanks for this solution!
My reports are indeed only showing TRDX with the dropdown being disabled.
Creating a new report indeed saves the report as TRDX


When i save the report is saved locally as TRDX but here is the problem:

Here it says TRDP, do you know why this is? If i reload the page i get the following error:


This is being triggered since its saved as "here its TRDX.trdx"

Do you know the solution for this problem?
Thanks in advance!

Ueskia

0
Tristan
Top achievements
Rank 1
Iron
answered on 06 May 2022, 08:00 AM

Hello Dimitar,

Thanks for this solution!
My reports are indeed only showing TRDX with the dropdown being disabled.
Creating a new report indeed saves the report as TRDX


When i save the report is saved locally as TRDX but here is the problem:

Here it says TRDP, do you know why this is? If i reload the page i get the following error:


This is being triggered since its saved as "here its TRDX.trdx"

Do you know the solution for this problem?
Thanks in advance!

Ueskia

Todor
Telerik team
commented on 09 May 2022, 08:12 AM

Hi Ueskia,

Indeed, it seems that the 'change' is not triggered when the report extension gets selected with code. For that reason, you need to trigger the event in the code. Here is the relevant part of the updated sample :

...
var dropdownlist = $(".k-window").find("input.editor__dropdown").data('kendoDropDownList');
dropdownlist.select(1);
dropdownlist.trigger("change");
dropdownlist.readonly();
...

Note that this workaround can be easily broken by the user of the web designer by just unchanging the dropdownlist's 'readonly' property.

If you need a more stable solution, you need to handle the IDefinitionStorage of the web designer and make sure you save all the files as TRDX.

Generally, the TRDP is zipped TRDX. Can you specify why you need to create only TRDX files? What is the scenario that requires this? We may consider implementing the filtering of report extensions in the designer.

Tags
.NET 5 .NET Core Actions Events Report Designer - Web
Asked by
Tristan
Top achievements
Rank 1
Iron
Answers by
Dimitar
Telerik team
Tristan
Top achievements
Rank 1
Iron
Share this question
or