Results 1 to 14 of 14

Thread: Crystal Report XI parameters and VB application

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    2

    Crystal Report XI parameters and VB application

    I am creating a report where the user can fill in the start and end date for 4 columns, and also a T/F for each of the columns visibility.

    So that alone creates 12 parameters, not including the other junk I need.

    It looks rediculous and long since everything is streamed downwards.

    My boss would like me to instead build a small VB application that asks for all the parameter, where the UI would look and work much more efficiently for the user.

    All the information i have came across so far is how to open a crystal report from a vb app, but not quite with the interaction Is there anyway to link a VB application so that it can pass the information into a Crystal report?

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

    Re: Crystal Report XI parameters and VB application

    This following is a sub that use on one of my apps that passes a variable to a parameter in CR XI.

    VB Code:
    1. Private Sub RunReport()
    2. Dim crxApp As New CRAXDDRT.Application
    3. Dim crxReport As CRAXDDRT.Report
    4. Dim crxDatabaseTables As CRAXDDRT.DatabaseTables
    5. Dim crxDatabaseTable  As CRAXDDRT.DatabaseTable
    6. Dim crxDatabase As CRAXDDRT.Database
    7. Dim crxParm As CRAXDDRT.ParameterValues
    8. Dim crxSubReport As CRAXDDRT.Report
    9.  
    10. Dim ReportName As String
    11.  
    12. ReportName = "\\SERVER\Other\Reports\PL.rpt"
    13.  
    14. Set crxReport = crxApp.OpenReport(ReportName)
    15. crxReport.ParameterFields.GetItemByName("Invoice").AddCurrentValue lInvoiceNo '<-- Variable
    16. crxReport.ParameterFields.GetItemByName("BO").AddCurrentValue iBO '<-- another variable
    17.  
    18. crxReport.PrintOut False, 1
    19.  
    20. With crView
    21.     .ReportSource = crxReport
    22.     .ViewReport
    23.     While .IsBusy
    24.         DoEvents
    25.     Wend
    26.     .Zoom "75"
    27.     .Visible = False
    28. End With
    29.  
    30.  
    31. End Sub

  3. #3
    Junior Member
    Join Date
    Nov 2006
    Posts
    22

    Re: Crystal Report XI parameters and VB application

    Do Not Ever Stop Study

  4. #4
    New Member
    Join Date
    Jan 2007
    Posts
    8

    Re: Crystal Report XI parameters and VB application

    Quote Originally Posted by Besoup
    crxReport.ParameterFields.GetItemByName("Invoice").AddCurrentValue lInvoiceNo '<-- Variable
    crxReport.ParameterFields.GetItemByName("BO").AddCurrentValue iBO '<-- another variable
    [/Highlight]
    sir, may i know "invoice" and "BO" is from Crystal reports or from VB?

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

    Re: Crystal Report XI parameters and VB application

    Quote Originally Posted by eureka8888
    sir, may i know "invoice" and "BO" is from Crystal reports or from VB?
    Yes that is the name of the parameter fields inside my report.

  6. #6
    New Member
    Join Date
    Jan 2007
    Posts
    8

    Re: Crystal Report XI parameters and VB application

    and sir lInvoiceNo and iBO are variables from VB where CR will gt the values?

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

    Re: Crystal Report XI parameters and VB application

    Quote Originally Posted by eureka8888
    and sir lInvoiceNo and iBO are variables from VB where CR will gt the values?
    exactly.

  8. #8

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    2

    Re: Crystal Report XI parameters and VB application

    thank you all for so much help


    unfortunatly i am still quite confused

    I am working in visual studio 2005

    and even when i type in

    Dim crxApp As New CRAXDDRT.Application


    i keep getting underlines under crxApp and CRAXDDRT.Application

    is there a library I am suppose to include?

  9. #9
    New Member
    Join Date
    Jan 2007
    Posts
    8

    Re: Crystal Report XI parameters and VB application

    i thonk you need crystal reports developers edition.

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

    Re: Crystal Report XI parameters and VB application

    Yes make sure you reference Crystal ActiveX Report Veiwer Library 11.0

  11. #11
    Addicted Member
    Join Date
    Aug 2004
    Posts
    154

    Re: Crystal Report XI parameters and VB application

    I have a question on the example given above. The "CRAXDDRT" ? Where does that come from. I have added the refernce given but do not have that as an option when creating the Dim statement.
    Thanks,
    Russ

  12. #12
    Addicted Member
    Join Date
    Aug 2004
    Posts
    154

    Re: Crystal Report XI parameters and VB application

    OK, I think I've found it. I needed a reference to another library. Also it's CRAXDRT and not CRAXDDRT.
    Thanks,
    Russ

  13. #13
    Addicted Member waelr's Avatar
    Join Date
    Nov 2004
    Posts
    168

    Re: Crystal Report XI parameters and VB application

    Please i would like to know if we can by code select some of the default values from the left to the right side.
    Attached Images Attached Images  

  14. #14
    Addicted Member waelr's Avatar
    Join Date
    Nov 2004
    Posts
    168

    Re: Crystal Report XI parameters and VB application

    Quote Originally Posted by waelr
    Please i would like to know if we can by code select some of the default values from the left to the right side.
    Please it's Ergent

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