Telerik Forums
Reporting Forum
2 answers
970 views

What is wrong??? if the user select send to print first, show this error "Object reference not set as an instance of an object"
But if first sent to the screen, and then select send to the printer, there no problem ????

I Attach my code

JOSE
Top achievements
Rank 1
 answered on 27 Apr 2017
1 answer
505 views

I am using code Telerik provided to immediately send a report to the printer in my MVC app. Of course, the printer dialog still appears. When it does, I'd like the number of copies set to 2 for a particular report. I tried the code below, hoping it would work, but it didn't. Do you know how to preset the number of copies when the printer dialog appears?

            var deviceInfo = new System.Collections.Hashtable();
            deviceInfo["JavaScript"] = "this.print({bUI: true, bSilent: false, bShrinkToFit: true, Copies: 2});";

Katia
Telerik team
 answered on 27 Apr 2017
2 answers
118 views

We are in the process of porting our Silverlight application to WPF.  We have run into some minor issues with the Export dropdown and I want to see if I'm missing something.

For a little context, our Silverlight and WPF app live side-by-side and we are assuming our end users are likely to be using both applications.  So we want to keep the experience between SL and WPF as close as possible.  Also, because we already have an architecture in place for the SL app, we are reusing that for the WPF app.  For example, when reports are run by the WPF app, they don't actually execute in process.  Instead, we use the Web API REST service to run the reports.  This is necessary because users of the WPF app don't actually have direct access to the database.  Only the web server has the credentials to connect to the database.

The first issue I have is controlling the order of the Export formats in the dropdown.  In the Silverlight app, we are able to control the order of the formats because we have our own IReportService implementation and have coded up the specific order in IReportService.ListRenderingExtensions().  I couldn't find a similar way to define the extensions that way in the Web API REST service.  The only way I found to control the formats was via the app.config file for the WPF app.  That works for hiding/renaming extensions but I couldn't get the 'order' property to work that is documented here: http://docs.telerik.com/reporting/configuring-telerik-reporting-extensions.

Am I doing something wrong with the order property or is there some other way to control the order?  This may seem minor, but as I mentioned our users are going to be using both applications and having the dropdowns be different could lead to confusion.  Interestingly enough, the order of the export dropdown is something that was important to our customers over 8 years ago (http://www.telerik.com/forums/order-of-export-formats-in-dropdown).

The other issue that I'm having trouble with is that it seems I need the rendering DLLs to be included in the WPF app in order for them to show up in the export dropdown.  But all the exports I'm doing are being done by the web server, right so I don't even understand why the DLLs need to be on the client.  As an example, until I included the Telerik.Reporting.OpenXmlRendering.dll included, the Word export didn't show up.  It's not a big deal but I'd rather not have to include DLLs if they aren't being used.

Thanks!

Stephen McDaniel
Top achievements
Rank 1
 answered on 26 Apr 2017
2 answers
136 views

I have a Telerik report that is a sales receipt for a store. I attached a sample of the report (4 pages). The problem is the second and fourth pages. They are both blank. You can see on the first image there are a number of line items that extend beyond a single page. So instead of continuing the line items on the second page, a page break is generated and the sales items continue on the third page.

Then a fourth, blank, page is generated at the end of the report. For my report footer, I do not have a page break after set to true, so I don't know why the last blank page is being generated.

Randy
Top achievements
Rank 1
 answered on 26 Apr 2017
1 answer
428 views
I have a report with a group section and then a table on in the details, linked by a defined field.  I want to use values from the table in expressions in the Group Header.  For example in the table I have a count for the number of rows.  I want to then display this value in the group header.  I want to then also use this value to determine if a field appears in the header or not.  Is this possible?  Any other suggestions on how to achieve this?  Thanks
Stef
Telerik team
 answered on 25 Apr 2017
1 answer
35 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
102 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
358 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
178 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
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?