473,549 Members | 2,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Export Gridview to pdf with out using third party tool

4 New Member
Hi,
How to Export Gridview to pdf in asp.net
I searched in many forums. but many of them said to use third party tools.
I don't want any third party tools.
Suggest me any sample for without using third party tool and export Gridview to pdf
The Below code is working, When I open the Pdf file the error is showing that " Adobe reader could not open test.pdf. because the file type hasbeen damaged"

How to Resolve this?
Thanks in advance

Dim FilePath As String = "c:\test.pd f"
response.Conten tType = "applicatio n/pdf"
response.AddHea der("Content-Type", "applicatio n/pdf")
response.AddHea der("Content-Disposition", "attachment ; filename=" + FilePath)
response.WriteF ile(FilePath)
response.end()
May 16 '08 #1
2 3121
debasisdas
8,127 Recognized Expert Expert
Hi,
How to Export Gridview to pdf in asp.net
I searched in many forums. but many of them said to use third party tools.
I don't want any third party tools.
Suggest me any sample for without using third party tool and export Gridview to pdf
develop your own component.
May 16 '08 #2
Plater
7,872 Recognized Expert Expert
Then you will have to learn the pdf format yourself and implement it.
As far as we're aware, there is no direct .NET implementation of the PDF format, so that makes everything a third party tool if you want to do it.

Also, these lines are redundant, as they do the same thing.
Expand|Select|Wrap|Line Numbers
  1. response.ContentType = "application/pdf"
  2. response.AddHeader("Content-Type", "application/pdf")
  3.  
May 16 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
6283
by: Chris Cox | last post by:
I'm trying to put together a simple access database that will allow a friend to maintain a simple database of products/pictures/prices, which he can then export to html and upload to a website. Problem is that access doesn't export the images when saving to HTML :( The export to PDF solution isn't appropriate in this instance, is their a...
0
1340
by: Pravin | last post by:
I have following architecture. c# code --> managed c++ code (wrapper) -> c wrapper code to third party tool --> third party tool written in c. c# code sends some data and a delegate to c++ code which is passed ahead to c code and c code gives it ahead to third party tool. I am able to pass integer, strings and structures to c code from...
3
3280
by: Simon Harvey | last post by:
Hi all, Can anyone tell me what the easiest way to achieve a collapsable panel area in a datagrid is? Do I need to find a third party panel control or does the datagrid/gridview somehow support this functionality inherently? Many thanks to anyone who can advise Simon
4
7592
by: Congero | last post by:
I'm trying to find a way to bind hierarchical data to a gridview control. I've been able to do this with some third party controls and was wondering if this functionality is available with the gridview control. Does anyone have a guidance on this? Thanks -- Live long, stay strong
3
1647
by: cmay | last post by:
I am trying to make the datalist work for me in presenting data in a "pivot table" manner, but it isn't exactly pretty. I have seen some complex code examples of people trying to re arrange a datagrid to do this. Is there no easier way to get this?
3
2011
by: Mark Leistner | last post by:
I am having problems getting a gridview to bind to custom objects under any non-full trust level. I created a test project to verify what I am seeing isn't a side effect of other code in my project and I get the same errors there: Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.
1
1812
by: elangovan | last post by:
Hi all, I'm exporting a datagrid to an excel file. I'm using the following source code to export. DataTable dt = new DataTable(); DataAccess.StoredProcedure sproc = new DataAccess.StoredProcedure("sproc_getdata"); sproc.Run(dt);
3
4044
by: ggupta78 | last post by:
Hi, Currently in our application we use the MHTML way of exporting to Excel i.e we render the datagrid HTML and set the MIME type to Excel. This works great but has the following limitation: 1. File size is extremely large in some cases 2. Our clients using older versions of Excel or OpenOffice 2.0 cannot open these files. So, we would...
2
1311
by: =?Utf-8?B?UGF1bA==?= | last post by:
HI I have two dropdown boxes that I am populating with results from the database. I can not seem to get them to show up as a row in the grid view control. In addition when the page first loads I need the headers to show up with all of the columns even though the only data that is bound to the grid at this point are the two dropdown boxes. I...
0
7526
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7457
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7965
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7483
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6051
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3504
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3487
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.