Telerik Forums
Reporting Forum
1 answer
270 views

Hi Guys,

 

It´s possible to make the height property of PageHeaderSection to adjust to the height of your content panels?

And, I can´t adjust the height manual, because when I create a panel, I don´t know the height of this panel.

 

Regards,

Stef
Telerik team
 answered on 18 Apr 2017
3 answers
749 views

I have a ASP.NET application that uses a report viewer to generate a multi page page single report. The client wants each page to show in a separate tab when they select export to Excel. I have been doing some research and it seems like the Report Book is the way to go but I am finding the examples and documentation very lacking. I am looking to see if this is even possible with the current configuration.

My Setup:
I have a page with a grid control and allow multi select.
The user can select multiple rows and then click a "print" button
I open a RadWindow with a ReportViewer passing the string of ID's selected from the grid via querystring
On the Page_Load event of the RadWindow I pass the string of ID's to the report parameter
This pulls the selected records from the database and the ReportViewer shows one or more pages depending on the row selection.

This all works perfectly when printing the report. However, exporting to excel from the ReportViewer control results in a single sheet. 

Can I move this to a ReportBook? I only have one report (as a class) and it seems like the ReportBook is designed to combine different reports together. 

If the ReportBook is not possible is there another solution?

Thanks,
Craig

Stef
Telerik team
 answered on 18 Apr 2017
3 answers
167 views
I'm trying to add margins to reports in our WPF report viewer when viewing them in print preview and also printing the report itself. We build our reports programmatically. I've set the PageSettings.Margins on the report to what I'd like them to be and I've set the report.Width to what I believe it should be but these fields have no effect on what is displayed in the report viewer itself or what happens when it is printed. Everything is shifted to the top left of the page. Is there a setting that I am missing?
Stef
Telerik team
 answered on 18 Apr 2017
5 answers
822 views
Hi Guys,
 
I am new to telerik controls. I went through various post regarding telerik reporting but I am unable to find anything which suits my need. I am using MVC 5
with razor engine.I have UI from where user can select various options and on the basis of the options selected I fetch the data from the database using stored procedure. Now the problem I am facing is in binding the data with the report. Can anyone help me with the same.I created a small POC where I binded the report with the sqldatasource and also added 1 parameter which user can input from UI. It works perfectly but it is done using the wizard. I want to do the same thing programatically.
I have tried 2 approach for this. In first approach i tried to set the datasource from code behind but i am unable to get the reportviewer on code behind neither I am able to bind it using Viewbag.
var instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = new TrackingReport();
instanceReportSource.Parameters.Add("ReceiptId", ReceiptId);
this.ReportViewer1.ReportSource = instanceReportSource;

In second approach i did a ajax call and tried to bind the result with the report in javascript but nothing worked. My page is as follows:
@using Telerik.Reporting.Examples.CSharp
@{
    ViewBag.Title = "Tracking Report";
    Layout = null;
}
 
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link href="~/Content/css/font-awesome/css/font-awesome.css" rel="stylesheet" />
<link href="~/Content/kendo/kendo.common.min.css" rel="stylesheet" />
<link href="~/Content/kendo/kendo.blueopal.min.css" rel="stylesheet" />
<!--kendo.all.min.js can be used as well instead of kendo.web.min.js and kendo.mobile.min.js-->
 
<script src="~/Scripts/kendo/kendo.web.min.js"></script>
 
<style>
    #reportViewer1 {
       
        left: 5px;
        right: 5px;
        top: 40px;
        bottom: 5px;
        overflow: hidden;
        font-family: Verdana, Arial;
    }
</style>
 
<link href="~/ReportViewer/styles/telerikReportViewer-8.2.14.1204.css" rel="stylesheet" />
<script src="~/ReportViewer/js/telerikReportViewer-8.2.14.1204.js"></script>
 
<div class="panel panel-default">
    <div class="panel-body">
        <div class="form-horizontal">
            <div id="invoiceIdSelector">
                <label for="invoiceId">Invoices</label>
                <select id="invoiceId" title="Select the Invoice ID">
                    <option value="IN-0015">Invoice 1</option>
                    <option value="IN-1015">Invoice 2</option>
                    <option value="IN-2015">Invoice 3</option>
                </select>
            </div>
 
            <div id="ReceiptNumber">
                <label for="receiptNumber">ReceiptNumber</label>
                <select id="receiptNumber" title="Select the receipt number">
                    <option value="RC-9022015" selected="selected">Receipt Number 1</option>
                    <option value="RC-9022016">Receipt Number 2</option>
                    <option value="RC-9022017">Receipt Number 3</option>
                </select>
            </div>
            <div class="row padding">              
                <div class="row">
                    <div class="col-md-12">                    
                    </div>
                </div>
                <div class="row padding">
                    <div class="col-md-12 text-center ">
                        <button class="primary-button" type="button" onclick="GenerateReport()">Generate Report</button>                       
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="reportViewer1">
    loading...
</div>
 
<script>
    $(document).ready(function () {
        $("#reportViewer1").telerik_ReportViewer({
            serviceUrl: "../api/reports/",
            templateUrl: '../ReportViewer/templates/telerikReportViewerTemplate-8.2.14.1204.html',
            reportSource: {
                report: "Telerik.Reporting.Examples.CSharp.TrackingReport, FITS.Web.Reports",
                parameters: { ReceiptNumber: $('#receiptNumber option:selected').val() }
            },
            viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
            scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
            scale: 1.0,
            ready: function () {
                this.refreshReport();
            }
        });
    });
 
    function GenerateReport()
    {  
        var receiptNumber = $("#receiptNumber option:selected").val();
        var viewer = $("#reportViewer1").data("telerik_ReportViewer");
        $.ajax({
            type: "POST",
            url: '/Common/GetReport',
            content: "application/json; charset=utf-8",
            dataType: "json",
            data: { ReceiptNumber: receiptNumber },
            traditional: true,
            success: function (data) {
                if (data.Result == "SUCCESS") {
                    viewer.reportSource(data);
                    viewer.refreshReport();
                }
            },
            error: function (xhr, textStatus, errorThrown) {               
            }
        });
         
    }
</script>
<script src="~/ReportViewer/js/telerikReportViewer-8.2.14.1204.js"></script>
<script src="~/Scripts/kendo/kendo.web.min.js"></script>

I am getting an error on page which is as follows:
Error creating report instance (Report = Telerik.Reporting.Examples.CSharp.TrackingReport, FITS.Web.Reports):
Report 'Telerik.Reporting.Examples.CSharp.TrackingReport, FITS.Web.Reports' cannot be resolved.

Can anyone help me with the same.

Stef
Telerik team
 answered on 18 Apr 2017
1 answer
496 views

Hi,
I'm having some trouble with the kendo report configuration.

My reports run perfectly on localhost, but when i deploy my application the reports fail to load. After some investigation i realised that it is an issue related with permissions asi get the following exception : "Access to the path 'C:\Windows\TEMP\Html5App\10.2.16.1025\LCT\value.dat' is denied."

I have looked at the documentation and at similar questions such as this one (http://www.telerik.com/forums/cache-file-error-not-fixed-with-config-entry), and  tried different configurations but unfortunately still did not manage to overcome the issue. 

I know this issue is related to cache configuration, i read the documentation carefully, and this page (http://docs.telerik.com/reporting/using-telerik-reporting-in-applications-rest-service-cache-management-overview) sugests that cache management is mandatory.  However on the documentation its not clear why?  Also is not clear  what is actually being cached?? Is it a compiled version of the report template which recieves parameters and dysplay the data,  or is it  the actual final report which is displayed? 

Because if it is the later then is s there a way i can publish my reports without caching? Because i cannot have a cached instance of each invoice which is displayed and printed only once. And is not really advantageous for me as most of the reports will rarely will be called twice with the same parameters

Stef
Telerik team
 answered on 18 Apr 2017
0 answers
3.3K+ views

We are using Telerik Reports 10.2.16.914

In the attachment you will see errors we are getting. 

here is the content of Output(Debug)

An exception has occurred while processing 'graph1' item:
System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at Telerik.Reporting.Processing.Data.SqlDataEnumerable.<GetEnumerator>d__0.MoveNext()
   at Telerik.Reporting.Processing.Data.SeedDataAdapter.GroupData(IEnumerable`1 rawData)
   at Telerik.Reporting.Processing.Data.SeedDataAdapter.Execute(IEnumerable`1 data)
   at Telerik.Reporting.Processing.Data.ResultSetAdapter.Execute(IEnumerable`1 data)
   at Telerik.Reporting.Processing.Data.MultidimentionalDataProvider.Execute(MultidimensionalQuery query)
   at Telerik.Reporting.Processing.DataItemResolveDataAlgorithm.GetDataCore(IDataSource dataSource, MultidimensionalQuery query, IServiceProvider serviceProvider, EvalObject expressionContext, IProcessingContext processingContext)
   at Telerik.Reporting.Processing.DataItem.GetDataCore(IDataSource dataSource, MultidimensionalQuery query)
   at Telerik.Reporting.Processing.DataItemResolveDataAlgorithm.ResolveData(String processingId, InMemoryState inMemoryState, MultidimensionalQuery query, Func`1 getDataCore, EvalObject expressionContext)
   at Telerik.Reporting.Processing.DataItem.ResolveData()
   at Telerik.Reporting.Processing.DataItem.ProcessItem()
   at Telerik.Reporting.Processing.ReportItemBase.ProcessElement()
   at Telerik.Reporting.Processing.ProcessingElement.Process(IDataMember dataContext)

We use web report viewer, it is telerikReportViewer-10.2.16.914.js

This is a part where we believe that timeout was increased. 

 public partial class LeastActiveDispatchers_Avg : Telerik.Reporting.Report
    {
        public LeastActiveDispatchers_Avg( )
        {
            InitializeComponent( );
            endpointSummaryDataSource.CommandTimeout = 600;
        }
    }

 

It is fills that the real that report is using timeout from 15 to 30 seconds instead of 10 minutes. 

The break point is not being hit when running in debug mode. So I have two questions I need help. 

1. How to debug a report? 

2. How to set timeout?

David
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 13 Apr 2017
3 answers
1.2K+ views
Hi,
   i am using standalone telerik report viewer so i am not using c#, everything with stored procedure and report viewer,trdp files.currently having a problem with picture box that was binding with stored procedure.it showing error like 
An error has occurred while processing PictureBox 'pictureBox1':
Invalid image data.
------------- InnerException -------------
Parameter is not valid.
please update the answer as soon as possible
Thank you,
Stef
Telerik team
 answered on 13 Apr 2017
3 answers
507 views

Hello,

I have created a report in Telerik report designer R3 2016, and to make my report multilingual i have created a parameter named pCulture to which user is passing culture name(eg. French(fr-FR), portuguese (pt-PT), English(en-EN)) which is working fine.

How my function is working :

TelerikReportResources.MultilanguageTelerikReport.GetCultureSpecificString(Parameters.pCulture.Value,"Key") //It is User defined function

The "key" will be translated from .net side in any language which has been entered by user in pCulture parameter.

Now the problem is :

I have Pie chart in my report which is showing weekdays, so here i have to compare pCulture parameter first, either it is french, Portuguese or English and again in particular language have to compare for the weekdays.as given below:

 

if the Parameters.pCulture.Value="fr-FR" and dayNameOfweek="Monday" then Monday="Lundi"

if the Parameters.pCulture.Value="fr-FR" and dayNameOfweek="Tuesday" then Monday="Mardi"

elseif the Parameters.pCulture.Value="fr-FR" and dayNameOfweek="Wednesday" then Monday="Mercredi"

elseif the Parameters.pCulture.Value="fr-FR" and dayNameOfweek="Thursday" then Monday="Jeudi"

elseif the Parameters.pCulture.Value="fr-FR" and dayNameOfweek="Friday" then Monday="Vendredi"

elseif the Parameters.pCulture.Value="fr-FR" and dayNameOfweek="Saturday" then Monday="samedi"

elseif the Parameters.pCulture.Value="fr-FR" and dayNameOfweek="Sunday" then Monday="dimanche"

 

same for Portuguese and English.so according to my logic i will have to create 21 elseif for this.

please guide me.

 

 

Vendredi
Vendredi
Vendredi
Vendredi
Vendredi
Vendredi
Vendredi
Vendredi
Vendredi
Vendredi
Vendredi
dimanche
dimanche
dimanche
dimanche
dimanche
Stef
Telerik team
 answered on 13 Apr 2017
1 answer
603 views

Hello,

 

I have a website project that prints reports fine running locally but once loaded to a webserver it starts to throw exception "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application."

Code I'm using to print report is:

 

    public void PrintReport(Report report, string printerName)
    {
        Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
        InstanceReportSource instanceReportSource = new InstanceReportSource();
        PrinterSettings psettings = new PrinterSettings {
            PrinterName = printerName
        };

        instanceReportSource.ReportDocument = report;
        reportProcessor.PrintReport(instanceReportSource, psettings);
    }

 

I do need to signify exact printer to print to as well as it needs to be silent.  How come this only works locally?

Stef
Telerik team
 answered on 13 Apr 2017
13 answers
264 views

I purchased DevCraft Complete and I'd like to get started with reporting. Does Telerik provide any tutorials for getting started with Reporting? I was able to find one tutorial but that was from 4 years ago. I'm sure a lot has changed since then.

Stef
Telerik team
 answered on 11 Apr 2017
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?