.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How can I print a Details View?

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :ASP.Net

I have a page in my project that has data inside of a details view. I'd love to be able to have a print button that just prints out the details view and not the whole webpage. Is that possible and if so how do you do it? Or if it's easier it could be exported to excel?

View Complete Post

More Related Resource Links

Infopath 2007 print view in browser enabled form with Print button


Hi i create a  print view brower enabled form in Infopath 2007 with header and footer. In Infopath works fine. Margin was ok, header and footter to. But then i try to print this browser the margin, header and footer it changes to default setting of browser ? I try also create a print button in form with VS 2008 code, but method :

this.print(); not working.

It is possible to print the "print view" in browser as the same like in Infopath 2007? Does anyone have the code how to create a print button in C# on browser enabled form?

Details view

I am currently using a Grid view to list out some information about the products in my database. When selecting on Select button, a Details view with more information is shown at the bottom, Question is - how do I show the Details view in a new page instead of being at the bottom of the same page? Thanks for your help. 

Infopath 2007 not printing footer in browser print view

I have added a footer to the print view of a browser enabled form and it is not printing when printing the form. The footer is relatively sinmple, however when I click on print view on the browser form and use print preview, I cannot see the footer at all. I have set bottom margins to auto, however I am using an image in my header and therefore have a section at the top of each page where my page top margin is set to 0 and the margins lie within the bounds of the section at .25". The footer that is not displaying in print preview in the form is as follows;"Quote Number: &{/my:myFields/my:sqnumber&} &b&pof&P&b &b &{/my:myFields/my:group28/my:sqdate&}Revision: &{xdFormatting:FormatString("/my:myFields/my:sqquoterevision","number","numDigits:0;negativeOrder:1;")&} &b Prepared For: &{/my:myFields/my:sqclientname&}"The page setup in IE listed page number and url info when using print preview and I have set them to none because my footer is in the form. Please help, this is frustrating!

Trying to generate a view with Details.tt

I'm using Entity Framework and I have Mvc 1.0 installed.I keep getting weird errors when I try to generate a view for my details method. The first time I try to gen I get: error CS0234: Compiling transformation: The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?) I rebuild and then I get: CodeTemplates\AddView\Details.tt(-1,-1) : error : The host threw an exception while trying to resolve the assembly reference 'System.Data.Entity'. The transformation will not be run. The following Exception was thrown:System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)  Anyone have any ideas? I've searched google...I've searched the forums...I've moved the .tt templates into my solution. No luck.

Print Form View and expanding text fields?

The form i'm editing has a small text field with a scroll bar that users enter quite a bit of data.  I'm wondering how to create a print view for the form that will expand that field to match the size of the content text. Does that make sense?

Details View Biding Custom Object with Enum properties fields

Hello, I'm trying to bind custom object to details view. The problem is that enum property fields are not show.Is there any way to show enum property fields in details view ?I put some example code below (I do not specify any rows mappings, they are generated dynamically because different kind of objects are bound to details view):// My object public class OrderItem { public ItemKindEnum unitemizedItemKind { get { return (ItemKindEnum)this.unitemizedItemKindID; } } ... } // Details view configuration <asp:DetailsView ID="dvOperationDetails" runat="server" DefaultMode="ReadOnly" ... />

How do I drop a drop down box into a details view ?

SO I've got a Details View control which I can insert data into my database with OK.However, in one of the text fields I want to limit what the user can insert to a set of key words. So the obvious thing to do is to present the User with a drop down box to select a key word.So I have converted the text field into a template and I thought I could replace the <InsertItemTemplate> in the details view with the drop down box. Well it looks like what I want but when I INSERT the data that field is not inserted into the database.So I guess I need to Bind the Drop Down somehow to the Insert - How do I do that ?My code is below; <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" AutoGenerateRows="False" DataKeyNames="dateID" DataSourceID="SqlDataSource1" DefaultMode="Insert"> <Fields> <asp:BoundField DataField="dateID" HeaderText="dateID" InsertVisible="False" ReadOnly="True" SortExpression="dateID" /> <asp:TemplateField HeaderText="diaryDate" SortExpression="diaryDate"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<

want to get Data key value of details view and use in objectdatasource for data list ?



I have a details view and the primary key is CompanyId which retrieves data from a table called companies.


On the same page I have a datalist that is bound to another objectdatasource which has a select method



For the parameter for the OBJ seect method attached to data list, I want to use the DataKey Value for the company that is being displayed in

the details view.


thanks for any solutions to this







InfoPath Print View in web based InfoPath forms not printing


Hi All,

I am using InfoPath 2007 web based forms along with SharePoint 2007. I have set print views in all forms with proper formatting. But when I try to print a form, print view is not printed instead current view of infopath is printed. This behavior is happening in InfoPath Web based forms however in InfoPath client based forms I am successfully able to print a form with print view.

Can any body help me how to solve this problem ? 

Insert the date as a hidden field using details view


When adding a new record. I have a field that displays the current date using now(). I want to make that a hidden field and simply insert it into the database when the new record is submitted.

I tried making it a template field and then deleting the textbox and inserting a hidden field but I can only either bind it to the field in the database or use custom binding to add the date value 'now()'... I don't seam to be able to do both.

any ideas ?

How to diplay a data in Details view. Framework 3.5 ASP.Net



Am having a details view and grid view in a page. In details view I have one dropdown list with selected index changed.I have to take the values from database and bind it to the other fields in details view. I have Written the Query which is executing fine and fetching values(this one i have checked in SQLServer). But when i select any items in DDL, instead of binding it in DetailsView its getting binded to Grid view.... Can some one help me how to fix this issue??

Many Thanks

Showing User Details with List view


Hi All, 

        Here is my scenario.There is a users table and each user has multiple addresses(one to many) and I want to dispalay them like the image provided below

using listview only.I am really stuck with the deign of the page.There is a show and hide feature also.I can use only list view that is my requirement.

Waiting for your Suggestions.(List view only)

Some helpfull links.....

Any kind of help will be appreciated.





















Unable to add view with content of List or Details



I can successfully right click on a Controller to add views where Content is any one of Empty, Edit or Create but when I select List or Details I receive the following error "Template processing results in 1 error . . . the referencedAssemblies property cannot contain null or empty strings . . .". I tried it with both Entities and Linq to Sql with the same outcome.

Not sure whether this is a feature of beta code or if I'm missing something obvious.

print a view in mvc


hi i have one view and i want to allow user to print it . how can i do?

Details View - Change control rendering



i am currently using the CSSFriendly adapters and need to change their behavours.  I am currently using a detailsview control to generate a form based upon a table in a DB and that the detailsview generates the column automatically.

If a column in the DB is of type bool the adapter displays a check box but for all other types it displays a text box.  I want to be able to customize this and actually have some rendered as dropdowns.  Is this possible by updating the adapter?

Infopath browser form - Digital Signature resized in print view



I have an Infopath browser based form that I have a digital sig on.  When the user signs it (Valid Signature - Signed by) the font size is small and is acceptable for use in the form.  Howvever, when I go to "Print View" it resizes to a larger font.  I do not want this as I am trying to fit the form to one page.  I altered the font in the signing section in the Print View in Infopath to no avail.  Looking at the Manifest file, I cannot locate the code where it determines the font size.  Anyone have any ideas?


InfoPath - How to show multiline text box in print view with entire text i.e. text exceeds more than

I have created an Infopath form with a multiline text box, at times, there is more information entered into the text box, cause a user to scroll. 
That feature is ok but when a user prints the form, only the information displayed on the screen is printed, and not the entire contents of the text box.  How can I print the entire contents of the text box?
also i dont want to create an another view as we have around 100 from and each can be change time to time causing print view need to be changed.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend