Telerik Forums
Reporting Forum
1 answer
39 views

Hi,

I am trying to set the datasource for the report using the NeedDataSource event of the report. I am able to do so as

private void BasicReport_NeedDataSource(object sender, EventArgs e)
{
Telerik.Reporting.Processing.Report mainReport = (Telerik.Reporting.Processing.Report)sender;
mainReport.DataSource = new List<string> { "test1", "test2", "test3", "test4" };
//The below commented statement leave the fields blank on the report UI
//this.DataSource = new List<string> { "test1", "test2", "test3", "test4" };
var subReportOne = new Report1();
subReportOne.DataSource = new List<string> { "item1One", "item2One", "item3One", "item4One" };
var subReportTwo = new Report2();
subReportTwo.DataSource = new List<string> { "item1Two", "item2Two", "item3Two", "item4Two" };
var subReportItemOne = this.Items.Find(this.subReportOne.GetType(), true)[0] as Telerik.Reporting.SubReport;
subReportItemOne.ReportSource = new InstanceReportSource() { ReportDocument = subReportOne };
var subReportItemTwo = this.Items.Find(this.subReportTwo.GetType(), true)[0] as Telerik.Reporting.SubReport;
subReportItemTwo.ReportSource = new InstanceReportSource() { ReportDocument = subReportTwo };
}

As you can see above, i can set the datasource for the subreports easily by getting its object but not for the report using the "this" keyword. Please can someone explain why do I need to get it explicitly from the sender instead?

Many thanks!! 

Katia
Telerik team
 answered on 24 Apr 2017
4 answers
108 views

Dear Team,

I have requirement to export to Collection data in Pdf format,with multiple page and format.

Kindly provide any solution or sample example in telerik.

 

Thank You .

Kind Regards,

Arvind Kumar Singh

Stef
Telerik team
 answered on 24 Apr 2017
5 answers
379 views
I'm trying to export spreadsheet to PDF, It appears to have some problems. When you save as PDF it comes as blank page.
Stef
Telerik team
 answered on 24 Apr 2017
9 answers
1.5K+ views

By following the instructions on this page: How To: Use HTML5 ASP.NET Report Viewer, I've been able to incorporate a Telerlik sample report into my app.The code it created is below. But now I'd like to have it reference my own Telerik report I've created. The report is in a different project (named MyApp.Reporting) and the name of the report is RentReceipt.cs. The report also takes a single parameter (named ClientID). How can I change the code below to reference my own report and pass it the required parameter?

 

<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.0.17.222.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();
                    },
                });
        });
    </script>

Stef
Telerik team
 answered on 21 Apr 2017
2 answers
188 views

Hello All,

I am new to Telerik, please excuse me if I'm asking anything obvious.

I am trying to test if localization is working for PDF exported programatically from Telerik Report template created through Visual Studio Report Designer. I set browser's language to Marathi (culture code - mr). Below is my code through which PDF is exported.

public ActionResult DownloadSamplePDFReport ()
{
    Telerik.Reporting.Processing.ReportProcessor reportProcessor =
                    new Telerik.Reporting.Processing.ReportProcessor();
    System.Collections.Hashtable deviceInfo =
        new System.Collections.Hashtable();
    Telerik.Reporting.TypeReportSource typeReportSource =
                 new Telerik.Reporting.TypeReportSource();
    typeReportSource.TypeName = typeof(SampleReport).AssemblyQualifiedName;
    Telerik.Reporting.Processing.RenderingResult result =
        reportProcessor.RenderReport("PDF", typeReportSource, deviceInfo);

    byte[] fileBytes = result.DocumentBytes;
    string fileName = "Output.pdf";

    return File(fileBytes, MediaTypeNames.Application.Octet, fileName);
}

I have created resource file named SampleReport.mr.resx which contains localized strings for Marathi language. Still output PDF contains default strings instead of localized one. Please help me resolved this issue.

Thanks,

Tejas Sutar

Tejas
Top achievements
Rank 1
 answered on 20 Apr 2017
4 answers
390 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
175 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
140 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
299 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
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?