ALWilliams
Programmer
I am currently writing an app in vb .net 2008 and as part of this I was trying to use crystal reports to populate a report and wanted to print and maybe export the report as PDF.
I have code that can connect to a SQL server and using a report and a query populate the viewer. However for this project the data supply is via Access. I have created the crystal report and got a link to the data that populates it from within Access (I have cheated a little as I'm new to crystal reports) - however.... The reason for this is that I receive a file which contains a number of 'orders' and for each of these 'orders' I obtain the data I require and deposit it into a temp table which is the table linked to the Crystal report and print/export it.
This works for the first instance but subsequent doesnt update.
This is the code I am using to update the report (with no success!):
frmCrystalForm.Show()
frmCrystalForm.Activate()
frmCrystalForm.CrystalReportViewer1.Update()
frmCrystalForm.CrystalReportViewer1.Refresh()
frmCrystalForm.CrystalReportViewer1.RefreshReport()
frmCrystalForm.CrystalReportViewer1.Update()
'frmCrystalForm.CrystalReportViewer1.ExportReport()
Application.DoEvents()
frmCrystalForm.CrystalReportViewer1.PrintReport()
frmCrystalForm.CrystalReportViewer1.Hide()
frmCrystalForm.CrystalReportViewer1.Dispose()
frmCrystalForm.Close()
I am also looking to get the printreport option to not prompt for what printer I want to send it to and similarly for the export option (i.e. I just want to tell it I want to export to PDF and the filename is <blah>) - I have done some searching and can see this possible in other versions of crystal but not the one with this.
Help!!!