Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    202

    Unanswered: How to make the dll syntax work in ASP

    Hi there,

    I have one problem which already take me a while to find the solution.
    I hope anybody out there can assist me.
    i got this code to print out data in crystal report direct from ASP but the medium is in VB.
    The code looks like this:

    Public Function printCR() As String
    Dim cr As Object

    Set cr = CreateObject("Crystal.CrystalReport")

    If cr Is Nothing Then
    MsgBox "error"
    End If

    With cr
    .Connect = "dsn=System;uid=mic;pwd=michael"
    .ReportFileName = App.Path & "\Report\budding.rpt"
    .Destination = crptToPrinter
    .ParameterFields(0) = "@mto;RT123454;TRUE"
    .DiscardSavedData = 0
    .Action = 1
    End With
    printCR = App.Path & "\Report\GOLDWIRE ISSUING REPORT.rpt"
    End Function

    This code is in .dll file
    When my asp code call this dll, the printing syntax can't seem to work.
    What should i do to make it works?
    It can definately return the value App.Path & "\Report\GOLDWIRE ISSUING REPORT.rpt"

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    I haven't tried this but I would expect your syntax to be something like...
    Code:
    Public Function printCR() 
      Dim cr 
      Set cr = Server.CreateObject("Crystal.CrystalReport")
    
      If cr Is Nothing Then
        MsgBox "error - could not create report object"
      End If
    
      With cr
        .Connect = "dsn=System;uid=mic;pwd=michael"
        .ReportFileName = Server.MapPath("\Report\budding.rpt")
        .Destination = crptToPrinter
        .ParameterFields(0) = "@mto;RT123454;TRUE"
        .DiscardSavedData = 0
        .Action = 1
      End With
      printCR = Server.MapPath("\Report\GOLDWIRE ISSUING REPORT.rpt")
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •