Is there any way to print Igrid contents only in a page?
Regards,
Suresh A
Hi Suresh,
Can you specify what do you mean with igGrid Contents only? Do you want to print all the rows loaded on the page?
Thanks,
Yes i want to print all the rows in the grid. I have not enabled paging in my grid.
Hello Suresh A,
You can find attached the example html page.
In the example you can see that there are header and footer sections with some text.
When you print the page, by selecting "File->Print…" from the browser menu you can see that header and footer sections are not printed.
I hope this is the case you're trying to accomplish.
Best Regards,
Martin Pavlov,
Infragistics, Inc.
Hi Martin,
The page which you have attached still prints the header and footer.
See my issue is
1. Layout page (Master Page)
2. Page which inherits the layout page. (Ex UserInformation)
3. In the User Information page i have an igrid which displays user information also some other information on the page. Also the grid has both horizontal and vertical scroll bars.
4. User Information page has a print button. On click of print button i need to print Grid contents only.
With the way which you have suggested it will print the page if there are no scroll bars on the grid. It will just ignore the places where we have added the css class to the tags and will print the whole page.
You can verify the same by adding scrollbars to the grid and the try to print it out. It will just print the contents similar to what print screen does.
Kindly provide a solution for the issue which i have reported.
Here is my next guess :)
In the attached example you can see that the grid is with scroll bars on screen, but on print it prints the whole grid data.
Little explanation on the example:
1. I removed the "width" and "height" options of the igGrid
2. I defined "div" element in which I put the table placeholder tags for the igGrid
3. I defined css class named "gridContainer" which purpose is to show the scrollbars for the grid
4. I put "gridContainer" class in media screen rule, so this class will only be applied on the screen and not on print
5. Last I added print button which function is to make call to window.print() function
Looking forward for your feedback.
Hope this helps,
Martin Pavlov
I still have issues with the solution which you have suggested. I have some 15 columns with both horizontal and vertical scroll bars. When i click on print it is not printing the entire grid contents. Even with the file which you have attached it is not printing the entire contents. Is there any other way??? If so pls upload the sample.
Have you tried my approach on this? It should work for all the rows in the igGrid.
Thanks
Hi,
Thank you for solving my problem with paginated tables.If you want to have styles for the table I want to print, as it should?Thanks in advance.
Best Regards.
I have a solution which assumes that the whole data is available in the browser i.e. grid is not configured to use remote paging.
The idea is to get the data form the grid data source object and then use it to generate new table with the whole data in it. The original igGrid is not touched. CSS media rules are used to hide the original igGrid when in @media print and show the generated one and vice versa in @media screen mode. If you use a custom button for printing you can delay the generation of the print table until the button is clicked. If you want user to be able to use the browser "Print" button then you should generate the print table after you create the igGrid.
The downside of this method is that you should keep an extra TABLE element in the DOM. If there are too many records in the data source then this may degrade the performance of the page.
Attached you can find a reference implementation of the described method. I used custom button for printing in order to show you a workaround for Internet Explorer. Internet Explorer doesn't like generating the print table on demand before printing. That's why I use conditional comments for IE in order to workaround the problem.
P.S.: It doesn't make sense to use remote paging in case that you want to print the whole data. That's why I didn't cover that scenario.
I have a question similar to this post resolved.
How could we get all the data in the table if the grid is paged? If the grid is paged, we can only access the data of the displayed page. Will print only the current page data. Thanks in advance.
Best Regards
I have uploaded a sample code and the issue which i am facing. Kindly have a look at it and provide me a solution for the same.
Hello Suresh,
Thank you for your great interest in our jQuery grid.
I asked you for an isolated sample in purpose.
I was not able to reproduce the issue using the code snippet provided by Todor
http://community.infragistics.com/forums/t/64705.aspx?PageIndex=2#330000
and the instructions from Martin
http://community.infragistics.com/forums/t/64705.aspx?PageIndex=2#329378
I am attaching the sample I used, trying to replicate the behavior.
Hope hearing from you