Telerik Forums
Reporting Forum
4 answers
374 views

Hi,

We have a web application stateless, to pass the lang, all of the url of application are in the format (/xx/api/controller (xx = fr | nl | ...) (and we have a "filter" to change the CurrentUICulture based on this).

We try to use the Html.TelerikReporting().ReportViewer() (Asp.net Mvc ReportViewer) but we can not pass the lang from the client to the server side, the url of your service is like /api/reports/** and we can not change this or alter this to add parameter), thus how to pass the language ?

<globalization culture="auto" uiCulture=auto” /> is not viable because the client can change at any time the language.

-----

I have even a badder case, for one report, the language is a report parameter for a pratical reason  ! But you can not change the language in NeedDataSource, because it is too late, but before  InitializeComponent, it is too early because no parameters ? How do to that ?

I googled, i searched on the forum, but nothing ?!. I was so easy with web form because we can intercept the creation of the report but here i do not find the way to intercept the creation and alter the culture ?

 

Thanks for any help.

Stef
Telerik team
 answered on 20 Apr 2017
16 answers
1.0K+ views
I create a web report using win2003 using locale OS date format yyyy/mm/dd HH:mm:ss and the display format on the filter parameters section is yyyy/mm/dd with debug locally on the development machine as shown 1.jpg. However, I publish the web to Win2008R2 SP2 using the same locale OS date format yyyy/mm/dd HH:mm:ss and the display format on the filter parameters section is mm/dd/yyyy as shown on the attached 2.jpg. Please advise what I should do on the win2008R2 SP2 machine to display the same as 1.jpg. What is affecting the date time display format. The development and production machines are having the same date time format setting.

Thanks in advance.

Stef
Telerik team
 answered on 20 Apr 2017
2 answers
161 views

 

 I am working with telerik reporting in pdf there is something I do not want to use is the page to print the pdf .. I just want the page where the pdf is displayed there is the image

var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();

            var typeReportSource = new Telerik.Reporting.TypeReportSource();

            // reportToExport is the Assembly Qualified Name of the report
            typeReportSource.TypeName = typeof(Reports.Report1).AssemblyQualifiedName;
            var deviceInfo = new System.Collections.Hashtable();
            deviceInfo["JavaScript"] = "this.print({bUI: true, bSilent: false, bShrinkToFit: true});";
            var result = reportProcessor.RenderReport("PDF", typeReportSource, deviceInfo);

            HttpContext.Response.AddHeader("content-disposition", "inline; filename=Ciudadano.pdf");
            return File(result.DocumentBytes, "application/pdf");

 

 


I am working with telerik reporting in pdf there is something I do not want to use is the page to print the pdf .. I just want the page where the pdf is displayed there is the image

I am working with telerik reporting in pdf there is something I do not want to use is the page to print the pdf .. I just want the page where the pdf is displayed there is the image

I am working with telerik reporting in pdf there is something I do not want to use is the page to print the pdf .. I just want the page where the pdf is displayed there is the image

I am working with telerik reporting in pdf there is something I do not want to use is the page to print the pdf .. I just want the page where the pdf is displayed there is the image

I am working with telerik reporting in pdf there is something I do not want to use is the page to print the pdf .. I just want the page where the pdf is displayed there is the image

I am working with telerik reporting in pdf there is something I do not want to use is the page to print the pdf .. I just want the page where the pdf is displayed there is the image

Daniel
Top achievements
Rank 1
 answered on 19 Apr 2017
1 answer
129 views

Hi Guys,

I have a report with two Lists. One for text fields, other for images. These lists are displayed side by side. The problem ocurrs with the Text List. It create spaces between texts to make the size equals to Image List. Then, if the image list, have only 2 images, the text list not have space. If I have more than 3 images, the texts will increase spaces between text fields.

Atacched files can explain more.

How can I keep the text List with the same height,regardless of how many images have in Images List ?

Katia
Telerik team
 answered on 19 Apr 2017
1 answer
287 views

Hello,

I'm completely new in Telerik reporting, I'm trying it now :)

I'd like do something basic (I think). I have an ASP.NET MVC 5 application. A button on a page, I'd like with a complex object created in an action use it as report data source. I read the documentation, around the web and the sample in the demo folder but it's still not clear to me.

How link report designer to the complex object at design time and at runtime ? Do you have a real example ?  A clear doc ? or a good explanation ? ;-)

Thanks,

 

 

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

Hi guys,

 

There is a way to display these warning messages when creating a report in runtime?

I´m building a report layout 100% at runtime. Some times, some elements are not displayed and I´m not sure if the problem is related to layout or other things.

Stef
Telerik team
 answered on 18 Apr 2017
1 answer
260 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
717 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
158 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
813 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
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?