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

How to set trbp DocumentName from Javascript Report Viewer

2 Answers 183 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
prisma
Top achievements
Rank 1
prisma asked on 21 Oct 2020, 10:36 AM

Hello everybody, 

I'm triyng to define a custom DocumentName for my Report Book (trbp) from Javascript for TelerikViewer. Here my code example for your reference. 

First I initialize telerik Report Viewer:

 $scope.loadTelerikViewer = function () {
            $("#reportViewer").telerik_ReportViewer({
                serviceUrl: "/api/reports",

                reportSource: {
                    report: null,
                    parameters: {
                    }
                },

                // Specifies whether the viewer is in interactive or print preview mode.
                // PRINT_PREVIEW - Displays the paginated report as if it is printed on paper. Interactivity is not enabled.
                // INTERACTIVE - Displays the report in its original width and height without paging. Additionally interactivity is enabled.
                viewMode: telerikReportViewer.ViewModes.INTERACTIVE,

}

Than based on required report Id i change the report source as follow:

var viewer = $("#reportViewer").data("telerik_ReportViewer");
            if ($scope.reportId == 1) {
                viewer.reportSource({
                    report: $scope.fileReportName,
                    parameters: {
                        ReportTitle: $scope.reportTitle,
                        DownloadFileName: $scope.downloadFileName,
                        ConnectionString: $scope.dbStringConn,
                        Client: $scope.JobObject.Client,
                        ManufacturingPlant: $scope.JobObject.PlantClient + ' ' + $scope.JobObject.StateClient,
                        Plant: $scope.JobObject.JobDescription,
                        JobId: $scope.JobObject.JobId,
                        ShowAllDoc: $scope.allDocument
                    }
                });
            }

 

Is there a way to define a custom Document Name for my given TRBP file? 

Thanks

Bruno

2 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 26 Oct 2020, 09:45 AM

Hello Bruno,

You can test using a report parameter for the DocumentName property of the report book. Telerik Reporting can merge parameters in a Report Book if the Name and Type of two or more parameters are the same. This means that if each Report in a Report Book contains a Parameter named DocumentName, each is of Type string and the mergeable property is set to true, then the Report Book will contain a single parameter of the same name and Type. 

For additional reference, see the Report Book Parameters documentation.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
prisma
Top achievements
Rank 1
answered on 19 Nov 2020, 03:28 PM

Hello Neli, 

Thank you so much for your detailed reply. 

Finally I solved my issue adding = Parameters("DownloadFileName") in DocumentName Section of my ReportBook. 

 

 

Regards

Bruno

Tags
General Discussions
Asked by
prisma
Top achievements
Rank 1
Answers by
Neli
Telerik team
prisma
Top achievements
Rank 1
Share this question
or