We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom report print

Thread ID:





141249 Dec 1,2018 03:33 PM UTC Dec 3,2018 09:03 AM UTC ASP.NET MVC - EJ 2 1
Tags: Grid
Asked On December 1, 2018 03:33 PM UTC

Hi guys,

I'm using VS2017, Syncfusion JS2 components, EF6, MVC5.
I tryed to follow your example "Sample1357381980" but it is for JS1, so it doesn't work in my environment. 

I need to print some reports wich will contain non tabular data. Please see bellow:
Scenario one is:
a - users will select a register in a child grid and press a print button

b - MVC5 web application has to print current order data and the selected related register (basic client/order/quotation relationship) to a report which should look like the following picture:

Question: Whatis the best way to achieve that?

Scenario two:
a - consider now the user selecting a register in the main grid which contains related orders registers (1:N relationship);
b - MVC5 web application has to print current order data and the selected related registers to a custom report as shown in the picture above.

Question 2: How to do it?

Thanks in advance!

Thavasianand Sankaranarayanan [Syncfusion]
Replied On December 3, 2018 09:03 AM UTC

Hi Vanderlei, 

Query #1 & #2: What is the best way to achieve that? How to do it? 

We have analyzed your query and we can achieve your requirement by enabling the grid internal event printGrid-Init to print the selected records and beforePrint to add custom content in the printing sheet. In the below sample, using grid.on method we have bind the printGrid-Init event in the grid and in the beforePrint event, we have prepend a custom div element to the grid. Please refer to the below sample for your reference, 

Code Example:  

var childGrid = new ej.grids.Grid({ 
            dataSource: new ej.data.DataManager({ 
                url: "/Home/UrlDatasource/", 
                insertUrl: "/Home/Insert/", 
                updateUrl: "/Home/Update/", 
                removeUrl: "/Home/Remove/", 
                adaptor: new CustomAdaptor() 
            load: function (args) { 
                this.query = new ej.data.Query().where("contatos.EmployeeID", "equal", rowData['EmployeeID']); 
                this.on('printGrid-Init', function (args) { args.printgrid.dataSource = this.getSelectedRecords(); }); 
           selectionSettings: { type: 'Multiple' }, 
            beforePrint: (args) => { 
                var customElem = document.createElement('div'); 
                customElem.innerHTML = "<h1>Required custom content here</h1>"; 

Please get back to us for further assistance. 

Thavasianand S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon