If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > How to make the dll syntax work in ASP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-16-04, 01:33
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
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"
Reply With Quote
  #2 (permalink)  
Old 09-22-04, 19:39
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On