cypress1976
Member
- Joined
- Aug 18, 2009
- Messages
- 7
- Programming Experience
- 3-5
I am trying to export only the current record in my app into a PDF. My current code (shown below) is exporting into Crystal Report and then into PDF format but it is exporting ALL records in the database.
This program is used for entering in Purchase Requests. Each record in the database is one purchase request. Once the record is inputted, a button is clicked and the conversion occurs and saves the PDF file.
How can I tell the program to just export the current record I am viewing in my program....not all records in the database.
This is VB.net 2005 with an Access database.
Thanks for any help!!
Jason
This program is used for entering in Purchase Requests. Each record in the database is one purchase request. Once the record is inputted, a button is clicked and the conversion occurs and saves the PDF file.
How can I tell the program to just export the current record I am viewing in my program....not all records in the database.
This is VB.net 2005 with an Access database.
VB.NET:
Private Sub btnSubmitNewReq_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmitNewReq.Click
cryRpt.Load("H:\programs\PR_Requests\PR_Requests\rptPRRequests.rpt")
Try
Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions()
Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions()
CrDiskFileDestinationOptions.DiskFileName = "H:\PR_Request_" & lblRequestNum.Text & ".pdf"
CrExportOptions = cryRpt.ExportOptions
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
.DestinationOptions = CrDiskFileDestinationOptions
.FormatOptions = CrFormatTypeOptions
End With
cryRpt.Export()
Catch ex As System.Exception
MsgBox(ex.ToString)
End Try
End Sub
Thanks for any help!!
Jason