Results 1 to 2 of 2
  1. #1
    gem1204 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    32

    Set Properties on Crystal reports viewer on ms Access form

    I’m using a Crystal ActiveX Report Viewer Control 10.0 on an MS Access form Crystal ActiveX Report Viewer Control 10.0. I’ve been able to set the report source and parameters and load the report and view it but I can’t set any properties except in code. The only property I’ve been able to really set is the height and width. Any properties that I set in the property sheet are not saved and when I view my form in form view the control shrinks right back up.
    If I change DisplayToolBar to no or any other similar property to no in design view it gets changed right back to yes when I view the form.
    When I view the report in form view the report displays a few inches to the left like it saving space for the group tree which always displays to the left. If I could get rid of the space to the left on the viewer I’d be happy.
    I’m really excited about having crystal reports with MS Access because I need to do a lot of charts and graphs and crystal reports is much better than Access.
    I’ve been looking for this for a long time and spent a lot of time searching and finally got something to work. I’m going to post my code in case someone else can use it.
    Anyone know how to set the properties? Please!!
    BTW I'm using Access 2010 and crystal reports 2011

    Code:
    Public crApp As CRAXDRT.Application
    Public MyPrm As String
    Private Sub cmdViewReport_Click()
    MyPrm = Me.txtPart
    Dim crReport As CRAXDRT.Report
    Set crReport = crApp.OpenReport("C:\EdMcNeill\Test2.rpt")
    Dim crTables      As CRAXDRT.DatabaseTables
    Set crTables = crReport.Database.Tables
    crReport.ParameterFields.GetItemByName("EnterPartNumber").AddCurrentValue MyPrm
    Me.Cr10.ReportSource = crReport
    Cr10.ViewReport
    End Sub
    Private Sub Form_Load()
    Me.Cr10.Height = 8008
    Me.Cr10.Width = 11280
    Set crApp = New CRAXDRT.Application
    'Me.Cr10.Width = 4
    'Me.Cr10.Height = 5
    End Sub
    I had to add one reference to my database


    C:\Program Files\Common Files\Crystal Decisions\2.5\bin\craxdrt.dll

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I do not have any experience with intefacing with Crystal reports, however I have messed with other external objects and I have always had to SAVE the changes made to the external object. I do not see in your code where the test2.rpt is getting saved after you've modified your controls. Could that be a possible solution?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Microsoft Access Viewer
    By Barryg in forum Access
    Replies: 4
    Last Post: 06-06-2014, 02:35 PM
  2. Replies: 1
    Last Post: 06-13-2012, 04:52 PM
  3. Crystal Reports
    By zephaneas in forum Reports
    Replies: 2
    Last Post: 10-05-2011, 05:15 PM
  4. Crystal Reports and Access 2000
    By JpSkyPilot in forum Access
    Replies: 0
    Last Post: 11-02-2010, 02:27 PM
  5. C#form-access db and crystal reports
    By tomClark in forum Access
    Replies: 2
    Last Post: 08-16-2010, 08:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums