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

TRDP file, whats the point?

21 Answers 5922 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 20 Feb 2017, 11:18 AM

How is the best way to use the report .trdp files.

All the best practice says to build reports in a class file, and reference that.

I ask because we currently design in a class, then serialise that to an XML file to deploy.

Our report viewer scans the reports folder for these xml files and provided the reports in a drop down.

We then de serialise the report and run. Would be nice to be able to do this with the native report files, and skip the serialise / de serialise process.

But I can t see a way to use the native files in this manner.

 

Andy

21 Answers, 1 is accepted

Sort by
1
Stef
Telerik team
answered on 20 Feb 2017, 02:54 PM
Hi Andy,

Telerik Reports are classes inheriting Telerik.Reporting.Report. Reports can be serialized in XML and stored in TRDX files which are recognizable by the Standalone Report Designer.
The newly introduced TRDP files contain the same XML as TRDX files, but in a compressed state - the content cannot be read directly with a text editor like TRDX files allow.

The purpose of TRDP files is to reduce the size of files, easing storing and transfer. TRDP files can be unpackaged into Telerik.Reporting.Report objects.


If you prefer to work with reports created in VS Report Designer, you can reference the reports' DLL in the project with the viewer. When you update the DLL, you will have to restart the application to load the new DLL.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andy Green
Top achievements
Rank 2
answered on 01 Mar 2017, 10:49 AM

Hi

Does this mean that TRDP files cannot be used directly in the report viewer.

I'm really struggling here to understand how the native reports can be used. I know I can create repots in a class fils and reference them, but that means a rebuild everytime I want to delpoy a new report.

All I want to do is create the report in either the stand alone report designer or in VS, and copy the trdp file to the repots folder. Looks like I cant.

Andy

0
Andy Green
Top achievements
Rank 2
answered on 01 Mar 2017, 11:09 AM

Also.....

http://www.telerik.com/products/reporting/creating-reports.aspx

I have found what I want to do on this demo page link. I appreciate the code is probably not to be used as its an image, however it doesn't work. I get the error message:

Value of type urireportsource cannot be converted to reportsource.

Dim reportSource = New UriReportSource()
reportSource.Uri = "Report1.trdp"
ReportViewer1.ReportSource = reportSource

Andy

0
Andy Green
Top achievements
Rank 2
answered on 01 Mar 2017, 11:11 AM

I have found what I think it is I'm trying to do at this demo page link, but the code is an image so probably isn't intended to be used.

http://www.telerik.com/products/reporting/creating-reports.aspx

My code:

Dim reportSource = New UriReportSource()
reportSource.Uri = "Report1.trdp"
ReportViewer1.ReportSource = reportSource

The reportSource on the last line is underlined in red with the following error:

UriReportSource cannot be converted to reportsource.

Andy

0
Stef
Telerik team
answered on 02 Mar 2017, 07:27 PM
Hello Andy,

Based on the error message, I guess you are using the HTML5 Viewer.
The HTML5 Viewer has a client-side report source, that is different from the server-side Telerik.Reporting.UriReportSource.

For more details and example per viewer, please go through How to: Set ReportSource for Report Viewers.


The code you need in case of using the HTML5 WebForms ReportViewer would be like:
var clientReportSource = new Telerik.ReportViewer.Html5.WebForms.ReportSource();
clientReportSource.IdentifierType = IdentifierType.UriReportSource;
clientReportSource.Identifier = "SampleReport.trdp"
clientReportSource.Parameters.Add("Parameter1", 123);
reportViewer1.ReportSource = clientReportSource;
Where SampleReport.trdp file must be available on the server, in the folder specified by the ReportFileResolver in the ReportsController.cs file (the file contains the implementation of the Reporting REST service).

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andy Green
Top achievements
Rank 2
answered on 13 Mar 2017, 10:04 AM

I followed the help (or thought I did) and dragged the report viewer from the toolbox. Wasn't aware I'd used the wrong one.

Are there any example of how to change the report dynamically, using a value from a dropdown?

Andy

 

0
Stef
Telerik team
answered on 13 Mar 2017, 10:13 AM
Hi Andy,

Once the HTML5 Viewer is created on the page, you can get the object in JavaScript and update its reportSource.

Please check the attached video in IE browser. It illustrates the approach to update the displayed report.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andy Green
Top achievements
Rank 2
answered on 07 Apr 2017, 11:45 AM

Hi

Seems I have a blind spot when it come to the new reporting.

All I want to do is upgrade from the old class based reporting method.

I'm getting the error: Error loading the report viewer's templates. (Template = /FlowManager/api/reports/resources/templates/telerikReportViewerTemplate-html).

And from fiddler this isn't being loaded, because there is nothing at that url.

Does this mean I have to install a report service to be able to render HTML5 reports.

All I need an a-z tutorial but cant find anything that covers everything.

Andy

# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
8 404 HTTP localhost /FlowManager/api/reports/resources/templates/telerikReportViewerTemplate-html 4,994 private text/html; charset=utf-8 iexplore:4640

0
Andy Green
Top achievements
Rank 2
answered on 07 Apr 2017, 11:48 AM

Also forgot to say the video you provided above doesn't match what happens in 2017 build. I only get the options for Rest Service or Report Viewer at the Configure Reporting Engine stage. There is no Embedded option.

Andy

0
Stef
Telerik team
answered on 11 Apr 2017, 04:35 PM
Hi Andy,

The error message points connectivity issue between the HTML5 Viewer and Reporting REST Service. The error is the response of the first viewer's request to the service. You may need to adjust the relative path used as HTML5 Viewer's ServiceUrl depending on the hosting of the application.

The previously provided video illustrates how to use the design-time support in Visual Studio, which handles the adding of the HTML5 Viewer in a page and creating a WebAPI controller representing the Reporting REST Service. You can find attached an updated video with the latest R1 2017 SP2 version  of Telerik Reporting. The video is in SWF format that can be opened in IE browser.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andy Green
Top achievements
Rank 2
answered on 26 Apr 2017, 12:51 PM

Thanks Stef

I now have my reports working as I need. Almost....

Is there a way to change the date format in the date parameter controls to UK (or any other format), and can the lists of other parameters be placed in Dropdown boxes, to save screen space?

Again thank you for helping me get as far as I have.

Andy

0
Stef
Telerik team
answered on 26 Apr 2017, 03:49 PM
Hi Andy,

The HTML5 Viewer provides mechanism for plugging custom widgets as parameters editors. The custom widgets should satisfy the requirements from How To: Create a Custom Parameter Editor(includes an example how to use a DropDown as editor).

In this forum thread you can find example how to format the DateTime editor - Report Parameter DateTime Picker Format on UI.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andy Green
Top achievements
Rank 2
answered on 11 May 2017, 10:02 AM

Hi

I'm having a real problem with this, Its me I know, just not as strong in the client side as I am serverside.

This example here : - http://docs.telerik.com/reporting/html5-webforms-report-viewer-customizing-custom-parameter-editor

The markup section at the bottom is different to what intellisense allows me to do.

I can't find a fully working example of using different template editors, and no matter how I try to follow the examples nothing works, usually the parameter area is missing.

Do I have to include the Kendo libraries? not of the example say I should but......

Any help or further examples would be very useful.

Andy

 

0
Stef
Telerik team
answered on 15 May 2017, 04:11 PM
Hi Andy,

If you use Telerik Kendo UI widgets, you will have to replace the Kendo UI subset provided by telerik Reporting with the full kendo.all.min.js functionality. You will have to also update Kendo UI CSS files - Requirements.

If the Parameters area does not appear in browser, it may be an issue with the way the custom editor is configured, or the requested report does not have visible parameters in its ReportParameters collection.


Please compare your settings to these of the attached demo project. The project uses Telerik Reporting R2 2017 v11.0.17.503.


If you need further help, please open a support ticket and send a project illustrating the settings of the project.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andy Green
Top achievements
Rank 2
answered on 22 May 2017, 09:46 AM

Thanks Stef.

Its not that I particularly wish to use Kendo, I have 2 simple (I'd have thought) requirements.

1. Change the date format from American to UK

2. Have dropdowns for the parameters

Thank you for the demo, but again this shows a KendoMultiSelect and if I change it to a kendoDropDownList it doesn't behave correctly.

Appreciate your help to date but for now I have asked on Experts Exchange to see if anyone has working code that for my requirements. If I cant get an answer I'll try to create a sample project to send. But its a lot of work when all I need are answers to my 2 requirements.

Andy

0
Stef
Telerik team
answered on 25 May 2017, 09:39 AM
Hello Andy,

Apologies for the caused inconvenience.

There was detected a problem with the WebForms wrapper of the HTML5 Viewer, where the wrapper kept requesting the Kendo UI subset provided by Telerik Reporting, even when you add a link to other version of kendo.all.min.js before creating the viewer object.
A fix will be provided in a consecutive internal build and the official R2 2017 SP1 releases.


For the time being, please switch to the JavaScript declaration of the HTML5 Viewer,w here you determine which files to be loaded on the page manually:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="CustomEditorDDL.WebForm1" %>
 
<!DOCTYPE html>
<head>
    <title>Telerik HTML5 Report Viewer</title>
 
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
 
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
 
 
    <!--kendo.all.min.js can be used as well instead of the following custom Kendo UI subset-->
 
    <script src="/ReportViewer/js/telerikReportViewer-11.1.17.503.min.js"></script>
 
    <style>
        #reportViewer1 {
            position: absolute;
            left: 5px;
            right: 5px;
            top: 5px;
            bottom: 5px;
            overflow: hidden;
            font-family: Verdana, Arial;
        }
    </style>
</head>
<body>
 
    <div id="reportViewer1">
        loading...
    </div>
 
    <script type="text/javascript">
        $(document).ready(function () {
            $("#reportViewer1")
                .telerik_ReportViewer({
 
                    // The URL of the service which will serve reports.
                    // The URL corresponds to the name of the controller class (ReportsController).
                    // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
                    serviceUrl: "/api/reports",
 
                    // The URL for custom report viewer template. The template can be edited -
                    // new functionalities can be added and unneeded ones can be removed.
                    // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
                    // templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-11.1.17.503.html',
 
                    //ReportSource - report description
                    reportSource: {
                        // The report can be set to a report file name (trdx report definition)
                        // or CLR type name (report class definition).
                        report: "SampleReport.trdp"
                    },
 
                    // 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,
 
                    // Sets the scale mode of the viewer.
                    // Three modes exist currently:
                    // FIT_PAGE - The whole report will fit on the page (will zoom in or out), regardless of its width and height.
                    // FIT_PAGE_WIDTH - The report will be zoomed in or out so that the width of the screen and the width of the report match.
                    // SPECIFIC - Uses the scale to zoom in and out the report.
                    scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
 
                    // Zoom in and out the report using the scale
                    // 1.0 is equal to 100%, i.e. the original size of the report
                    scale: 1.0,
 
                    ready: function () {
                        //this.refreshReport();
                    },
                    parameterEditors: [
                   {
                       match: function (parameter) {
                           return Boolean(parameter.availableValues) && !parameter.multivalue;
                       },
 
                       createEditor: function (placeholder, options) {
                           var dropDownElement = $(placeholder).html('<div></div>'),
                                     parameter,
                                     valueChangedCallback = options.parameterChanged,
                                     dropDownList;
 
                           function onChange() {
                               var val = dropDownList.value();
                               valueChangedCallback(parameter, val);
                           }
 
                           return {
                               beginEdit: function (param) {
 
                                   parameter = param;
 
                                   $(dropDownElement).kendoDropDownList({
                                       dataTextField: "name",
                                       dataValueField: "value",
                                       value: parameter.value,
                                       dataSource: parameter.availableValues,
                                       change: onChange
                                   });
 
                                   dropDownList = $(dropDownElement).data("kendoDropDownList");
                               }
                           };
                       }
                   }]
                });
        });
    </script>
 
</body>
</html>



Regards,
Stef
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Richard
Top achievements
Rank 1
answered on 13 Jun 2017, 03:18 PM
I am in the same boat as Andy, looking for a simple way of switching reports from Designer.cs to .trdp files. Are there any examples that show how to use the .trdp files in a simple c# report library?
0
Andy Green
Top achievements
Rank 2
answered on 14 Jun 2017, 09:12 AM

Hi Richard

Not sure if this is what you are after, but I used the following on a simple form with a button click to convert from the report .vb file to the new .trpt. With only 25 reports I just manually changed the report names and ran it.

 

Dim zReport = New **Report Class name**.vb()
Dim reportPackager = New Telerik.Reporting.ReportPackager()
Using targetStream = System.IO.File.Create("C:\ConvertedReports\**New report Name**.trdp")
reportPackager.Package(zReport, targetStream)
End Using

 

My biggest problem now is with the viewer control, there are no working examples of how to replace the paramerter selector to a dropdown, or change the date format on the calendars. Not sure why the default parameter selectors are lists as these can be very long.

We are looking to move back to the old viewer.

Andy

0
Stef
Telerik team
answered on 14 Jun 2017, 01:01 PM
Hello everyone,

Please check . The report source of the viewer specifies the type of the report for the Reporting engine, and you can use TRDP|TRDX files and reports created in Visual Studio. To update the displayed report of an existing HTML5 Viewer on the page, you can use the viewer's reportSource(rs) method.
The attached video can be previewed in IE browser and illustrates the above suggested settings.


About parameters editors, the example in How To: Create a Custom Parameter Editor illustrates how to use a kendoDropDownList, and the How to use kendoDateTimePicker as an editor in the HTML5 Viewer's Parameters Area KB article shows a kendoDateTimePicker. You can use any other widget that covers the requirements for plugging in the HTML5 Viewer.
If you need only to change the format of the existing kendoDatePicker widget, then you need to use Telerik Kendo UI Globalization mechanism - Kendo UI Globalization.

When you extend the functionality of the HTML5 Viewer with Kendo UI widgets, it is important to include the full Kendo UI functionality and consider the version of jQuery on the page - HTML5 Viewer Important Settings.

Regards,
Stef
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andy Green
Top achievements
Rank 2
answered on 15 Jun 2017, 01:32 PM

Hmmm a bit further forward. I still can't get my reports to use the KendoUI Dropdown, but if I load the sample report it works, so I do have all the files in the right place.

 

I have multiple parameters that get their data from SQL data sources, but the example uses a CSVdatasource.

 

Andy

0
Stef
Telerik team
answered on 16 Jun 2017, 07:29 AM
Hi Andy,

In case the settings in the attached demo project does not resolve the issue, please open a support ticket and send us a demo project that illustrates your settings and the problem.

Regards,
Stef
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Stef
Telerik team
Andy Green
Top achievements
Rank 2
Richard
Top achievements
Rank 1
Share this question
or