Results 1 to 7 of 7

Thread: [RESOLVED] To pass parameter from vb6 to crystal report

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Posts
    94

    Resolved [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:
    1. With crStudList
    2.         .Connect = strConn
    3.         .ReportFileName = App.Path & "\reports\StudentList.rpt"
    4.         .ReportTitle = "Student List"
    5.         .WindowTitle = "Student List"
    6.         '.SelectionFormula = "{tblStudent.RegistrationDate}>= DateValue (" & dtpFrom.Value & ") and {tblStudent.RegistrationDate}<= DateValue(" & dtpTo.Value & ")"
    7.         .SelectionFormula = "{tblStudent.RegistrationDate}>=#" & Format(dStartDate, "dd/MM/yyyy") & "# and {tblStudent.RegistrationDate}<=#" & dEndDate & "#"
    8.                 .Destination = crptToPrinter
    9.         .PrintReport
    10.  
    11.     End With

    where crStudList the name of ocx control of crystal report

    thanks

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: To pass parameter from vb6 to crystal report

    Moved to reporting section

  3. #3
    Frenzied Member oh1mie's Avatar
    Join Date
    Sep 2001
    Location
    Finland
    Posts
    1,043

    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:
    1. .Formulas(0) = "Myformula=' " & "my information line" & "'"
    oh1mie/Vic


  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Posts
    94

    Re: To pass parameter from vb6 to crystal report

    Hi oh1mie

    Thax a lot. It solved my problem

    thax again

  5. #5
    Junior Member
    Join Date
    Feb 2006
    Posts
    27

    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.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Posts
    94

    Re: To pass parameter from vb6 to crystal report

    I've not used vb 2005 express edition and cr 11

  7. #7
    Junior Member
    Join Date
    Feb 2006
    Posts
    27

    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
  •  



Click Here to Expand Forum to Full Width