?
Solved

how to print Datatable Record from vb.net web page

Posted on 2010-08-29
2
Medium Priority
?
490 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

649 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