Results 1 to 8 of 8

Thread: [RESOLVED] Issue about passing parameter to Crystal Report 11..

  1. #1

    Thread Starter
    Member intellogo's Avatar
    Join Date
    Nov 2006
    Location
    India
    Posts
    61

    Resolved [RESOLVED] Issue about passing parameter to Crystal Report 11..

    Hi..

    I have a table: PROFESSOR in ms access, that has 2 fields: "Name" and "Location". The table has 10 records.
    And i have made a vb form with a combo box that will show a list of available locations from the database table, when it is dropped down.

    So, the end user will select a location from the cbo on the form and i want that to be used as the basis of the report to be generated.

    QUESTION:
    ========
    1. How do i pass the value (i.e the location selected by the user) to the report designed ?

    2. If i want the report to be generated based on the user's selection of "Location", then do i use the standard wizard which is popped up when the Crystal Report 11 designer module is added from the project exploere in vb6 ??

    Pls answer the questions in order of them stated above.
    Help will be surely appreciated...

    ----
    Regards,
    Gautam Naidu

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Issue about passing parameter to Crystal Report 11..

    Look at my post in this thread. http://www.vbforums.com/showthread.php?t=448235

  3. #3

    Thread Starter
    Member intellogo's Avatar
    Join Date
    Nov 2006
    Location
    India
    Posts
    61

    Question Re: Issue about passing parameter to Crystal Report 11..

    Hi ..Besoup, i appreciate ur willingness to assist me....thanks.

    But

    I cannot undersatnd that code. I am noticing that the code used for programing the Crystal Report v11, is somewhat different compared to a normal VB6 code snippet.

    Maybe, if you could kindly explain most of those lines in ur post, then i will definately be able to understandand this would be helpful for others, too. I cannot even figure out what the variables r for and many other things in ur code snippet.
    An explanation could be more valuable & helpful to a novice like me and others, especially in integrating my report with the VB6's output control such as a text box or a cbo dropdown list.

    Awaiting ur response....

    ----
    Regards,
    Gautam Naidu.

  4. #4
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Issue about passing parameter to Crystal Report 11..

    Please post the code that you are currently using to view your report and I will try to help you from there.

  5. #5

    Thread Starter
    Member intellogo's Avatar
    Join Date
    Nov 2006
    Location
    India
    Posts
    61

    Exclamation Re: Issue about passing parameter to Crystal Report 11..

    Besoup pal,
    I am very sorry to say that i dont have any code written to view the report.
    I dont know what code to write..

    I have a button on that vb form, which is empty. I know that the code for viewing the report has to be in that button's click event. ..but i dont know any code to write for CR 11 report...thats why i requested u to explain urs so that i can start writing appropriate code for the button on the form to generate a report.

    Please do not mind...and how do i go about it ??
    Regards,
    intellogo

  6. #6
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Issue about passing parameter to Crystal Report 11..

    You will need to add a CrystalActiveXReportVeiwer control on your form. In this example I named my control CRView.

    Code:
          Private Sub RunReport()
          Dim crxApp As New CRAXDDRT.Application
          Dim crxReport As CRAXDDRT.Report
          Dim crxDatabaseTable  As CRAXDDRT.DatabaseTable
    
          Dim crxSubReport As CRAXDDRT.Report
    
          Dim ReportName As String
    
          ReportName = "\\SERVER\Other\Reports\PL.rpt"
    
    
          Set crxReport = crxApp.OpenReport(ReportName)
    
          crxReport.ParameterFields.GetItemByName("Invoice").AddCurrentValue lInvoiceNo '<-- Variable
    
          crxReport.ParameterFields.GetItemByName("BO").AddCurrentValue iBO '<-- another variable
    
          crxReport.PrintOut False, 1
    
          With crView '<- CR Control Name
              .ReportSource = crxReport
              .ViewReport
              While .IsBusy
                  DoEvents
              Wend
              .Zoom "75"
              .Visible = False
          End With
    
          End Sub

  7. #7

    Thread Starter
    Member intellogo's Avatar
    Join Date
    Nov 2006
    Location
    India
    Posts
    61

    Exclamation Re: Issue about passing parameter to Crystal Report 11..

    besoup ..i have some really vital questions to ask u
    Please ans them in the order of questions:

    1. If i want to allow the facility where the end user can provide a input and upon that the report will be generated, then should i use the standard wizard for designing the reports ?? or should i do it manually (i.e place the column headers and objects on the report via hand and not use the wizard)

    2. In my first post i have already stated the components and references that have been added to the VB6 IDE. With respect to this, I am still unable to understand what many of ur post's code lines mean ....??

    I wish this forum had a LIVE chat program, so that programmer's like us could really get down to work A.S.A.P. by analyzing the suggestions provided by the experienced....This is going to take ages like this to solve all my doubts ..oh my lord...

    Lets see what u got 4 me this time.....
    Regards,
    intellogo

  8. #8

    Thread Starter
    Member intellogo's Avatar
    Join Date
    Nov 2006
    Location
    India
    Posts
    61

    Question Re: Issue about passing parameter to Crystal Report 11..

    someone ans my doubts please...
    Its the post before this one.
    Regards,
    intellogo

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