CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2000
    Posts
    24

    Crystal Reports - CRViewer1

    HI,

    I am loading my crystal reports through my vb6 app using CRViewer1.ocx. Everything is working fine except I need to set the date field on my report to equal the date displayed on my VB form. Does anyone know how to access unbound fields on crystal reports via VB.

    Please Help.
    Thanks, Patrick.


  2. #2
    Join Date
    Apr 1999
    Location
    VA BEACH
    Posts
    467

    Re: Crystal Reports - CRViewer1

    It depends on what your date field is in crystal. If it is a formula or a parameter( crystal reports parameter ) there are collection objects in the Report object you pass to the viewer that enable you to set/chagne values in parameters and formulas.

    Jim Hewitt
    Software Developer
    Liberty Tax Service
    www.LibertyTax.com

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Crystal Reports - CRViewer1

    I tried the parameter field, but was unable to make it work. May you provide some code example? Thanks in advance

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #4
    Join Date
    Apr 1999
    Location
    VA BEACH
    Posts
    467

    Re: Crystal Reports - CRViewer1

    post your code and I will look at it.

    Jim Hewitt
    Software Developer
    Liberty Tax Service
    www.LibertyTax.com

  5. #5
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Crystal Reports - CRViewer1

    Thanks a lot. I will do it as soon as I can (I think maybe tomorrow)

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Crystal Reports - CRViewer1

    'Here is the code:
    'A simply report with one parameter field
    'called SelectMe in a omit formula for a section.
    'Matter is not to make the selection (I can workaround using
    'formulas). Matter is to pass a parameter value to a rpt file
    'through Ocx - or: to make parameter fields to be filled
    'via code form VB.
    Cr1.Reset
    Cr1.ReportFileName = "D:\Condivisa\Cesarevb\Crystol\cryweb\Report1.rpt"
    Cr1.ReportSource = 0
    Cr1.DiscardSavedData = True
    Cr1.ParameterFields(0) = "1" 'parameter field name={?SelectMe}

    'executing this following line I get the error 20553 "Name of parameter field not valid"

    Cr1.Action = 1 'make it print

    'I tried with:
    'Cr1.ParameterFields(1) = "1"
    'Cr1.ParameterFields("{?SelectMe}") = "1"
    'with no goals. Hope you can help
    'Best Regards,
    'Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  7. #7
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Crystal Reports - CRViewer1

    Have a look at this:
    http://codeguru.earthweb.com/cgi-bin...collapsed&sb=5

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  8. #8
    Join Date
    Feb 2002
    Posts
    2

    Re: Crystal Reports - CRViewer1

    If your problem is not yet solved, tell me. I think, I've got a solution !-)

    regards
    Dieter


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

Featured