Solved

how to print Datatable Record from vb.net web page

Posted on 2010-08-29
2
471 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 30

Accepted Solution

by:
MlandaT earned 125 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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