Export to PDF

V

vishal

Hello everybody,

I need to export a datalist to an pdf file. So basically i
want to create an pdf file and open it with the datalist
data. Any idea or suggestion is very very appreciated.


Thanks
 
E

Elton Wang

You may either use 3nd party component or create Crystal
Report to export to pdf file.

HTH

Elton Wang
 
V

Vishal

Thanks for the resoponse elton. Do i have to create a
report file when I want to export it via crystal reports?
We currently have a crystal report version and I would
like to use it, but I dont want to create each time a rpt
file for all of my reports. It needs to be dynamic.

Thanks
 
E

Elton Wang

Hi Vishal,

Crystal Reports for .NET is much more flexible than
Crystal Reports itself. If your queries have same schema
and require report to show same format, the report can be
dynamically bound to datatable(s) as its data source.

Actually, there are also many free (at least free trail
version) PDF components for exporting PDF file. You can
google many results.


HTH

Elton
 
V

Vishal

Hi Elton,

many thanks for the reponse. Do you have any example
code that describes what you say. If so it would help me a
lot. Please let me know about that asap.

Thanks
 
E

Elton Wang

Hi Vishal,

Following an embedded CR report export to pdf file sample
code (report name crReport):

Dim report As
CrystalDecisions.CrystalReports.Engine.ReportClass = New
crReport
Dim dap As New SqlDataAdapter(sql, reportString)
Dim table As New DataTable
dap.Fill(table)
report.Database.Tables(0).SetDataSource(table)

If System.IO.File.Exists(exportFileName) Then
System.IO.File.Delete(exportFileName)
End If

report.ExportToDisk
(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
, exportFileName)
Response.Clear()
Response.Charset = String.Empty
Response.ContentType = "Application/pdf"
Response.WriteFile(file)


HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,184
Latest member
ZNOChrista

Latest Threads

Top