Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Crystal Report Basic Report in Vb.net 2008

Status
Not open for further replies.

ALWilliams

Programmer
Jun 29, 2007
21
0
0
GB

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!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top