473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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.pdf"
response.ContentType = "application/pdf"
response.AddHeader("Content-Type", "application/pdf")
response.AddHeader("Content-Disposition", "attachment; filename=" + FilePath)
response.WriteFile(FilePath)
response.end()
May 16 '08 #1
2 3100
debasisdas
8,127 Expert 4TB
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 Expert 4TB
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
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. ...
0
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++...
3
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...
4
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...
3
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...
3
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...
1
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...
3
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....
2
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.