Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Automate Report Export Post Reply Post New Topic
Author Message
harlylux
Newbie
Newbie


Joined: 08 Jan 2008
Online Status: Offline
Posts: 3
Quote harlylux Replybullet Topic: Automate Report Export
    Posted: 08 Jan 2008 at 8:39am

I am building a winform (vs 2005 w/vb) to automate report exports to both excel and pdf. I am running into some problems. What is the best type of report object to use for this purpose. I am currently using:

Private Report As New Report_n
Sub ...
        Report = New Report_n()
        Report.Load()
        CrystalReportViewer1.ReportSource = Report
 
end sub
 
My Problem is that when I try to automate the export, it won't work because the crystalreporviewer does not know when report is loaded so it tries exporting the report before it's loaded which causes an error. Any adivce? Thanks
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 08 Jan 2008 at 8:52am
I wouldn't use the viewer b/c you don't need to view anything. You just want to save the report to disk. I would do so using the ReportDocument object. However, I haven't heard of exporting the report before it's loaded. It should stay on the Load() method until finished and then move to the next line in your code. Try using the ReportDocument object and single stepping it if necessary to debug.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.