|
-
Feb 16th, 2006, 06:07 AM
#1
Thread Starter
Lively Member
[RESOLVED] To pass parameter from vb6 to crystal report
Hello Friends,
My problem is I want to accept value from user which I am nt storing in databasse. I am using inputbox to get value from user and then I want to print the same value in the crystal report. I am not using crystal report viewer, but I've used crstyal report's ocx and from there i am opening report by using printreport method of the crystal report's ocx control. plz help me.
below is my code which i m using to print report
VB Code:
With crStudList
.Connect = strConn
.ReportFileName = App.Path & "\reports\StudentList.rpt"
.ReportTitle = "Student List"
.WindowTitle = "Student List"
'.SelectionFormula = "{tblStudent.RegistrationDate}>= DateValue (" & dtpFrom.Value & ") and {tblStudent.RegistrationDate}<= DateValue(" & dtpTo.Value & ")"
.SelectionFormula = "{tblStudent.RegistrationDate}>=#" & Format(dStartDate, "dd/MM/yyyy") & "# and {tblStudent.RegistrationDate}<=#" & dEndDate & "#"
.Destination = crptToPrinter
.PrintReport
End With
where crStudList the name of ocx control of crystal report
thanks
-
Feb 16th, 2006, 07:42 AM
#2
Re: To pass parameter from vb6 to crystal report
Moved to reporting section
-
Feb 16th, 2006, 07:52 AM
#3
Frenzied Member
Re: To pass parameter from vb6 to crystal report
Selection formula is like SQL clause.
If you like to pass argument to the report, you must build formula for it.
VB Code:
.Formulas(0) = "Myformula=' " & "my information line" & "'"
oh1mie/Vic

-
Feb 16th, 2006, 08:04 AM
#4
Thread Starter
Lively Member
Re: To pass parameter from vb6 to crystal report
Hi oh1mie
Thax a lot. It solved my problem
thax again
-
Feb 16th, 2006, 05:43 PM
#5
Junior Member
Re: To pass parameter from vb6 to crystal report
I wanted to do something similar to what youre doing, but I dont know how to use vb with crystal. What do I need to get started? I dont have a crystl32.ocx file. Im using VB 2005 Express edition and CR 11.
-
Feb 17th, 2006, 04:54 AM
#6
Thread Starter
Lively Member
Re: To pass parameter from vb6 to crystal report
I've not used vb 2005 express edition and cr 11
-
Feb 19th, 2006, 10:11 PM
#7
Junior Member
Re: To pass parameter from vb6 to crystal report
I recommend vs.net 2003 with cr 9.
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
|