|
-
Nov 11th, 2002, 11:33 AM
#1
Thread Starter
Lively Member
Save Crystal Report in VB
I get an error when I run the code below. Does anyone know what's wrong with my code. Thanks a lot!
Error message:
compile error
argument not optional
My code:
Dim Report As New CrystalReport1
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
Report.SaveAs ("C:\Documents and Settings\test.rpt")
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
-
Nov 11th, 2002, 11:36 AM
#2
Fanatic Member
you need to specify a file format:
VB Code:
Report.SaveAs ("C:\Documents and Settings\test.rpt", cr80FileFormat)
-
Nov 11th, 2002, 11:43 AM
#3
Thread Starter
Lively Member
new error message
Thanks! But another error message showed:
compile error
syntax error
Do you have any idea?
claire
-
Nov 11th, 2002, 11:44 AM
#4
Fanatic Member
-
Nov 11th, 2002, 11:45 AM
#5
Thread Starter
Lively Member
Report.SaveAs ("C:\Documents and Settings\test.rpt", cr80FileFormat)
Thanks!
-
Nov 11th, 2002, 11:46 AM
#6
Fanatic Member
VB Code:
Report.SaveAs "C:\Documents and Settings\test.rpt", cr80FileFormat
it was because of the paranthesis
-
Nov 11th, 2002, 11:50 AM
#7
Thread Starter
Lively Member
It works! Thanks a lot!!!
I am new in VB and Crystal Report. I am trying to write a vb program to auto run crystal report daily. I just start learning and testing but have no clear idea yet. Do you know how to do that?
Claire
-
Nov 11th, 2002, 11:54 AM
#8
Fanatic Member
you could do that with a timer on the form, and set up some code to make it run the report every day. i'm afraid i don't have time to write an example right now, but there's lots of other people here who could help.
-
Nov 11th, 2002, 12:14 PM
#9
Thread Starter
Lively Member
Thanks a lot anyway!
Claire
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|