Telerik Forums
Reporting Forum
4 answers
196 views

I am implementing Telerik reporting in my already writen WPF Project. The Project has only microsoft WPF controls but when I make a report with telerik reporting and add resource dictionary sources from Telerik.ReportViewer.Wpf.Themes.dll in APP.XAML  file it effects all my Microsoft controls in entire project. I need solution that limit telerik themes to its report control only. Please guide me with detail I am newbie in Telerik reporting, Thanks

I am using telerik reporting R2 2019 version.

Code

 

APP.XAML

<Application x:Class="BMS.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Startup="Application_Startup" DispatcherUnhandledException="Application_DispatcherUnhandledException" 
        
             SessionEnding="Application_SessionEnding" Exit="Application_Exit" >
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/System.Windows.xaml" />
                <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.Windows.Controls.Input.xaml" />
                <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.Windows.Controls.Navigation.xaml" />
                <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.ReportViewer.Wpf.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

This Code effect all my micrsoft controls

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I am using alll references from this folder only.

C:\Program Files (x86)\Progress\Telerik Reporting R2 2019\Bin

 

 

 

 

muhammad
Top achievements
Rank 1
 answered on 27 Nov 2019
1 answer
255 views

Hi,

We have UWP app that contains WebView element to show Telerik report. The WebView has HTML5ReportViewer which communicates via Telerik Rest Service to show the report. There are two questions I have in UWP.

- First question is how to download report?

- Second question is how to print the report(with having some printer settings in UWP)?

Todor
Telerik team
 answered on 26 Nov 2019
14 answers
612 views
Hey

I have the Angular 7 report viewer running, and we can load single reports no problem, we can't see the selection pane to pick different reports.   How do I enable the selection pane.  According to page:  https://docs.telerik.com/reporting/angular-report-viewer-api-options  what option do I have to enable to get the selection pane enabled, it's not "parameters" or "parameterEditors" as we've tried settings them exactly as described and it doesn't work.

Thanks
Veronika
Telerik team
 answered on 26 Nov 2019
1 answer
357 views

Hi all,

I'm using Telerik Reporting Designer. I created 2 reports (ParentReport and ChildReport).i made a navigation from ParentReport to ChildReport using action property with some parameters. i need to know how to use these parameters in the ChildReport and also use this parameters to filter a datasource in the ChildReport.

thanks,

Mohamed

Neli
Telerik team
 answered on 26 Nov 2019
0 answers
104 views

I am using User Functions in Design and it is working perfectly.
But how do I work in the application?
I generate reports using ReportProcessor.

ASP.NET MVC

Rudá Cunha
Top achievements
Rank 2
 asked on 25 Nov 2019
3 answers
137 views

Hello,

I'm using Telerik.Reporting (13.2.19.1030) to programmably create a report book consisting of couple of reports. One of the reports contains toc and is set as TocReportSource and that report contains Toc section. I'm exporting the report book to pdf and docx. When exporting to docx the toc is not visible but when to pdf it is visible.

There's no mention about not supporting toc here: https://docs.telerik.com/reporting/designing-reports-considerations-word

Am I doing something wrong here?

            var contentsReport = new ContentsPageReport();
            contentsReport.DataSource = data;
            var contentsReportSource = new InstanceReportSource();
            contentsReportSource.ReportDocument = contentsReport;
            reportBook.TocReportSource = contentsReportSource;
            reportBook.TocPosition = ReportBookTocPosition.BeforeContent;

.NET Framework 4.7.1

DocumentFormat.OpenXml 2.9.1

Telerik.Reporting 13.2.19.1030

 

 

Br,

Sami

Sami
Top achievements
Rank 1
 answered on 25 Nov 2019
1 answer
242 views
Can't display UTF-8 encoding character in Report.
Thanh
Top achievements
Rank 1
 answered on 24 Nov 2019
2 answers
1.8K+ views

Hi,

I am having this error on my page when i try to display the report in the html5 report viewer

Error registering the viewer with the service.
An error has occurred.
Access to the path 'C:\windows\TEMP\Html5DemoApp\12.0.18.416\LCT\value.dat' is denied.

I have read that is because The error message "Access to the path X is denied" indicates that the Telerik Reporting REST service cannot access the configured file storage. By default, user temp folder will be used as a storage which is 'C:\Windows\TEMP' in this case.

I read this in the following article:

https://docs.telerik.com/reporting/knowledge-base/error-registering-the-viewer-with-the-service

It says that I need to assign default storage location using  ReportsController.cs file where the settings of the Reporting REST service are defined.

The question is I can not find that file in my solution. How do we do that?

Regards,

Omar

Omar
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 23 Nov 2019
1 answer
754 views

I am using MVC report viewer along with asp.net mvc ui and I want to generate a report after an ajax call

here is my ajax

<script>
    function generateAccountsPayableReports() {
        var ms = $("#msInvoicesAPV").data("kendoMultiSelect");
        var invoices = ms.dataItems();
        var invoiceIds = [];

        invoices.forEach(function (invoice) {
            invoiceIds.push(invoice.Id);
        });

        $.ajax({
            type: "POST",
            url: "/APV/GenerateData ",
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify({ 'invoiceIds': invoiceIds }),
            success: function (result) {
                if (result) {
                    console.log("Result: ", result);
                    var w = window.open();
                    $(w.document.body).html(result);
                }
            },
            failure: function (result) {
                console.error("result: ", result);
            },
            error: function (result) {
                console.error("result: ", result);
            }
        });
    }
</script>

and here is my controller action

        [HttpPost]
        public ActionResult GenerateReport(List<Guid> invoiceIds)
        {
            var apvReports = _reportsLogic.GenerateAccountPayableVouchers(invoiceIds);
            string json = JsonConvert.SerializeObject(apvReports);
            string reportSource = typeof(AccountsPayableVoucher).AssemblyQualifiedName + "--" + json;

            return View("CustomReportViewer", (object)reportSource);
        }

 

I tried initializing a new window and assigning the html to that window but if failed as you can see in my ajax call

                    var w = window.open();
                    $(w.document.body).html(result);

is there other way you could advise me to?

Neli
Telerik team
 answered on 22 Nov 2019
1 answer
808 views

I created a report library .dll to print reports ad-hoc with no previewing, so I can use it in a rest api. This has been working fine since installation over 4months ago.

I have just updated to v 13.2.19.1030, now when a report is trying to print is get the following error..

"The data area passed to a system call is too small"

I have copied and pasted my code below..

-------------------------------------------------------------------------------

public void printPalletLabel(string palletBarcode, string courier, string printerName, short copies)
        {
            string reportName = _basePath + "\\Reports\\";

            try
            {
                // CREATE A REPORT INSTANCE FROM THE REPORT FILE
                switch (courier.ToUpper())
                {
                    case "DPD":
                        reportName += "palletLabel_DPD.trdp";
                        break;

                    case "YODEL":
                        reportName += "palletLabel_Yodel.trdp";
                        break;

                    default:
                        reportName += "palletLabel_UKMail.trdp";
                        break;
                }

                // REMOVE URI START IS EXISTS
                if (reportName.StartsWith("file:\\"))
                    reportName = reportName.Substring(6);

                var reportInstance = UnpackageReport(reportName);

                if (reportInstance != null)
                { 
                    // MODIFY CONNECTIONSTRING AND PASS PARAMETER
                    var ds = reportInstance.DataSource;

                    var sqlDataSource = (SqlDataSource)ds;
                    sqlDataSource.ConnectionString = _connectionString;
                    sqlDataSource.ProviderName = "System.Data.SqlClient";
                    sqlDataSource.Parameters["@palletBarcode"].Value = palletBarcode;
                        
                    printReport(reportInstance, printerName, copies);
                }
            }
            catch (Exception ex)
            {
                error = "reporting.printPalletLabel(): " + ex.Message;
            }

            
        }

        private void printReport(Telerik.Reporting.Report report, string printerName, short copies)
        {
            try
            {
                InstanceReportSource reportSource = new InstanceReportSource
                {
                    ReportDocument = report
                };


                // SET PRINTER
                var printerSettings = new System.Drawing.Printing.PrinterSettings
                {
                    PrinterName = printerName,
                    Copies = copies
                };

                // PRINT REPORT
                var reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(reportSource, printerSettings);
            }
            catch (Exception ex)
            {
                error = "reporting.printReport(): " + ex.Message;
            }
        }
        private Telerik.Reporting.Report UnpackageReport(string reportName)
        {
            var reportPackager = new ReportPackager();

            try
            {
                using (var sourceStream = System.IO.File.OpenRead(reportName))
                {
                    var report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream);
                    return report;
                }
            }
            catch (Exception ex)
            {
                error = "reporting.UnpackageReport(): " + ex.Message;
                return null;
            }
        }

------------------------------------------------------------------------------------

The error occurs at the following line within printReport()

reportProcessor.PrintReport(reportSource, printerSettings); 

 

Any ideas?

 

Thanks 

Andy

 

Andrew
Top achievements
Rank 1
Iron
 answered on 22 Nov 2019
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?