?
Solved

how to print Datatable Record from vb.net web page

Posted on 2010-08-29
2
Medium Priority
?
487 Views
Last Modified: 2012-05-10
I have asp.net page.
This page contains one Telerik Grid which has checkboxes in it.

User can select rows by checking the checkboxes.

I need to know how can I print the selected records.
I am done with the getting the records from the database and it is stored in a datatable.

how can I use this datatable and print the records in it.
0
Comment
Question by:ziorinfo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Expert Comment

by:Jini Jose
ID: 33554039
you can use a report like fyi rdl project report designer to create a report.
or you can use a xml and xslt combination to do that.

0
 
LVL 31

Accepted Solution

by:
MlandaT earned 500 total points
ID: 33559387
Give this Javascript a try let's see - am assuming that the checked rows are also 'selected' in the radgrid:
function PrintRadGrid() 
{ 
    var previewWnd = window.open('about:blank', '', '', false); 
    var sh = '<%= ClientScript.GetWebResourceUrl(RadGrid1.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",RadGrid1.Skin)) %>'; 
    var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>"; 
             
    var MasterTable = $find('<%= RadGrid1.ClientID %>').get_masterTableView(); 
    var selectedRows = MasterTable.get_selectedItems();   
     for (var i = 0; i < selectedRows.length; i++) 
      {   
            var row = selectedRows[i];   
            var  htmlcontent = htmlcontent + row.get_element().outerHTML;        
      }  
     
    htmlcontent = styleStr + "<body><div class='RadGrid RadGrid_Simple'>" +  htmlcontent + "</div></body></html>";      
    previewWnd.document.open(); 
    previewWnd.document.write(htmlcontent); 
    previewWnd.document.close(); 
    previewWnd.print(); 
}

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question