Crystal Report

albertkhor

Well-known member
Joined
Jan 12, 2006
Messages
150
Programming Experience
Beginner
i have a database (microsoft access) which store all books information.

i'm trying to create a summary report on each book in my database by using crystal report. i will set up one report that will create individual .pdf files for each book selected by user. All books info is display in listview, the listview provide a checkbox for each row. if user want to print out the book full information then click on checkbox and system will auto create pdf for the particular book (e.g. VisualStudio.pdf, .NetCompactFramework.pdf) and save it.

can anyone provide me example?:p
 
I'm telling u how to programatically export one crystal report( As u want one .pdf file for each book).

1. Fill the crystal report with one book info.
2. Call ExportReportAsPDF(CrystalReportViewer1.ReportSource)
3. Following is function definition ExportReportAsPDF

Private Sub ExportReportAsPDF(ByVal Report As CrystalDecisions.CrystalReports.Engine.ReportClass)

Dim exportOpts As New ExportOptions
Dim diskOpts As New DiskFileDestinationOptions

exportOpts = Report.ExportOptions

' Set the export format.
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat

exportOpts.ExportDestinationType = ExportDestinationType.DiskFile

diskOpts.DiskFileName ="C:\books.pdf" 'give full filepath here

exportOpts.DestinationOptions = diskOpts

Report.Export()

End Sub

U have to import-> CrystalDecisions.Shared
 
komrul_alam said:
I'm telling u how to programatically export one crystal report( As u want one .pdf file for each book).

1. Fill the crystal report with one book info.
2. Call ExportReportAsPDF(CrystalReportViewer1.ReportSource)
3. Following is function definition ExportReportAsPDF

Private Sub ExportReportAsPDF(ByVal Report As CrystalDecisions.CrystalReports.Engine.ReportClass)

Dim exportOpts As New ExportOptions
Dim diskOpts As New DiskFileDestinationOptions

exportOpts = Report.ExportOptions

' Set the export format.
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat

exportOpts.ExportDestinationType = ExportDestinationType.DiskFile

diskOpts.DiskFileName ="C:\books.pdf" 'give full filepath here

exportOpts.DestinationOptions = diskOpts

Report.Export()

End Sub

U have to import-> CrystalDecisions.Shared

thanks komrul_alam.
do you have any ideal how to create a individual report? can you teach me?
My system is like that, all data is display in listview and each row will have a checkbox. User will clicked the checkbox if they want the particular book report (multiple selection will be allow).

is that possible? can i pass primary key to crystal report so crystal report will only show the data i select?
 
Back
Top