Telerik Forums
Reporting Forum
6 answers
336 views

Hello,

I'm currently facing a problem with Telerik Reporting menus in Visual Studio 2019.

Last week I've created some reports, all was working well.

 

Today, I had to modify some of them but report files are not displaying icons of reports but of c# code.

When right clicking on my reports I don't have designer menu anymore (View designer menu).

 

What's really strange is that on other older reports, I still have this menu available and can view the designer.

 

I havent installed VS update

I tried to reinstall Telerik reporting package on my machine

Nothing changes.

 

The fact is that there is a difference between old reports and the one I created last week that make the first ones editable and the last ones not.

Do you know where I could search to find this difference that would make me able to edit them again please ? 

 

Thanks

Regards

Admin
Top achievements
Rank 1
 answered on 18 Dec 2020
1 answer
588 views

Hello, I am getting:

    "Unable to get report parameters.
    An error has occurred.
    Object reference not set to an instance of an object."

when trying to load a report into the HTML5 report viewer.

Code snippets below - resolve nevere gets called, but the payload of the POST looks correct.  Any ideas?

 

<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: "/reportdata/",
 
                    // The URL for the 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.html',
 
                    //ReportSource - report description
                    reportSource: {
 
                        // The report can be set to a report file name (.trdx or .trdp report definition)
                        // or CLR type name (report class definition).
                        report: { reportId: 89 },
 
                        // Parameters name value dictionary
                        parameters: { foo: 1}
                    },
 
 
 
                    //parameters: {
                    //    editors: {
                    //        singleSelect: telerikReportViewer.ParameterEditorTypes.COMBO_BOX,
                    //        multiSelect: telerikReportViewer.ParameterEditorTypes.COMBO_BOX,
                    //    }
                    //},
 
                    // 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,
 
                    //Enables or disables the accessibility features of the report viewer and its contents.
                    enableAccessibility: false,
 
                    //If set to true shows the Send Mail Message toolbar button
                    sendEmail: { enabled: true }
                });
 
    });
    </script>

 

public class ReportSourceResolver : IReportSourceResolver
    {
        private string _reportDbConnectionString;
 
 
        public ReportSourceResolver(string reportDbConnectionString)
        {
            _reportDbConnectionString = reportDbConnectionString;
        }
 
        public Telerik.Reporting.ReportSource Resolve(string reportId,OperationOrigin operationOrigin, IDictionary<string, object> currentParameterValues)
        {
 
            sproc_ReportDetailsXMLGet_Wrapper.In_Type inparams = new sproc_ReportDetailsXMLGet_Wrapper.In_Type()
            {
                ReportId = reportId.ToNullableInt(),
            };
 
            var sp = new sproc_ReportDetailsXMLGet_Wrapper(inparams);
            _ = ReportingDB.ExecOn(_reportDbConnectionString).SpCall(sp);
 
            var outrecord = sp.Out.Records[0];
            return new Telerik.Reporting.XmlReportSource { Xml = outrecord.SerializedReport };
        }
    }
}

 

Neli
Telerik team
 answered on 17 Dec 2020
1 answer
177 views
I am having a text box inside the details section of my report. Value for this text box is passed by the data source during runtime. This report is rendered as a pdf. I don't want the text box to wrap the content, so right now I am using the character count (to determine if it wraps) to show or hide the text box. I would like to know if there is a way to identify if the text inside the box is wrapped after rendered as a pdf?
Todor
Telerik team
 answered on 17 Dec 2020
1 answer
1.4K+ views
I have a .net core app in which I have a Telerik report which has two parameters and I have the code like so

$("#summaryReport").click(function () {
                var viewer = $("#reportViewer1").data("telerik_ReportViewer");
                viewer.reportSource({
                    report: "Sumaren.trdp",
                    parameters: {}
                });
                viewer.refreshReport();
            });
 
 
            $("#reportViewer1")
                .telerik_ReportViewer({
 
                    serviceUrl: "api/reports/",
 
                    //ReportSource - report description
                    reportSource: {
                        // The report can be set to a report file name (trdx report definition)
                        // or CLR type name (report class definition).
                    },
 
                    viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
 
                    scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
 
                    scale: 1.0,
                    enableAccessibility: true,
 
                    ready: function () {
                        this.refreshReport();
                    },
                });
I keep getting the error Unable to get report parameters. Report 'Sumared.trdp' cannot be resolved. Do I have to do something with the parameters in the reportSource? I think that when you add parameters via the Telerik Report Designer, do don't add anything in the reportSource besides the report name. The Telerik Designer previews the report just fine, works like it's supposed to but when I run the app it just keeps saying this - 'Unable to get report parameters. Report Sumaren.trdp cannot be resolved'
Eric R | Senior Technical Support Engineer
Telerik team
 answered on 16 Dec 2020
1 answer
9.1K+ views
I'm trying to show the data range selected as parameters in the header of the report. I added a text box and added {Parameters.StartDate.Value}. The problem is it shows the time and I just need the date. I tried this { Format('{0:d}',Parameters.StartDate.Value)} but it does not work. What is the proper way to accomplish my objective. Thanks in advanced. 
NPL IT
Top achievements
Rank 1
 answered on 16 Dec 2020
6 answers
867 views

Hey guys,

I want to change the Tooltip-Labels (and any other labels) of the ReportViewer in my C# WPF Application.

I don't want to localize anything in my report. ust these default buttons.

Is there any way I can do this? I tried to set the Language property to de-DE but it not affected anything.

 

I would be glad about any help.

 

Greetings

Benedikt

Eric R | Senior Technical Support Engineer
Telerik team
 answered on 16 Dec 2020
37 answers
2.0K+ views

Hi guys,

 

at the moment we are trying to figure out if we can use the Telerik Reporting to generate receipts on a thermo printer with endless paper.
We found the ContinuousPaper setting within the PageSettings but it doesn't seems to be working as expected. We are using the latest Version of Reporting (2018 R3)

When using the ContinuousPaper everything looks fine in the preview but after printing the paper gets cut after one DINA4 page. This happens when printing on the printer and when printing to a PDF file.

The only settings we have made is setting the ContinuousPaper property and adding a lot of textboxes to the report designer.

Any idea what we are doing wrong?

Todor
Telerik team
 answered on 15 Dec 2020
2 answers
307 views

I've been through the docs at least twice and obviously I'm missing quite a bit.

 

Created two simple, identical, reports with the wizard. One with the report designer, Report1, the other in VS2019, Report2.  They are calling a stored procedure in SQL Server 2016, with a parameter.  Both preview in the designers just fine. Both reports have a parameter set...@batchid Int32 6000

Stored procedure:    select * from batches where batchid=@batchid

I've added the NeedDataSource event to the reports

Telerik.Reporting.UriReportSource uriReportSource = new Telerik.Reporting.UriReportSource();
uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("@batchid", 7929));
uriReportSource.Uri = @"nunya\Report1.trdp";
reportViewer1.reportSource = uriReportSource;

reportViewer1.RefreshReport();

 

The trdp complains it can't find a connection string. IDK why. There is one in the app.config file which the rest of the application happily uses. When the connection string is embedded, it still does NOT use the Uri parameter.

 

 

Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource();
typeReportSource.Parameters.Add( new Telerik.Reporting.Parameter("@batchid", 7929));
typeReportSource.TypeName = typeof(Report2).AssemblyQualifiedName;
reportViewer.reportSource=typeReportSource;

reportViewer1.RefreshReport();

 

 

 

Here, an exception is thrown in the Report1_NeedDataSource event:.report.Parameters is empty.

Do you have a sample winforms app which uses either the northwind or adventure works databases?

 

TIA

Dave
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 12 Dec 2020
1 answer
1.8K+ views
I have a textbox with the following content: 
=Sum(LossOfDaysMen)/(Sum(LossOfDaysNotSet)+Sum(LossOfDaysMen)+Sum(LossOfDaysWomen))*100 + "%"

This is giving me numbers with way too many decimals, like '66.44295155..', i want to to have just 1 decimal. How can i do this within the textbox? I tried String.Format, but that does not work. Setting the format property on the entire textbox does not work either, due the '+ "%" at the end. 

I assume there's some function i can run but im unsure about what syntax works within the textbox.

Any ideas how to solve this?
Dimitar
Telerik team
 answered on 10 Dec 2020
1 answer
522 views
Hi,
How to remove borders inside a table when page break? (look attach file)
Dimitar
Telerik team
 answered on 09 Dec 2020
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?