Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Export A Crystal Report to report.html

Posted on 2003-03-23
4
Medium Priority
?
458 Views
Last Modified: 2012-05-04
Hi there friends,
Please help me with this if posible

Using:Crystal rep 8.5
VB6 SP5

I have a application that usses a Crystal report called (sales.rpt)
I need to have a sample or coding how to export this when i click the button to a report.html.

Private Sub Command1_Click()
 --->>>> I need the coding here plz.....
end sub

thanks to all
0
Comment
Question by:pvisser1
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Sethi
ID: 8192308
Design a report and save it in .rpt format.

In you VB code write the following:

Dim rptApplication As CRAXDRT.Application
Dim WithEvents rptReport As CRAXDRT.Report

With rptReport
  .ExportOptions.DestinationType = crEDTDiskFile
  .ExportOptions.HTMLFileName = strPathAndReportName & ".html"
  .ExportOptions.FormatType = crEFTHTML40
  .Export (False)
End With
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 240 total points
ID: 8192457
That is part of the answer.  You need to create the CR application and the report instance first

Dim rptApplication As CRAXDRT.Application
Dim WithEvents rptReport As CRAXDRT.Report

Private Sub Command1_Click()

'
'   Check if report is already in use
'
    If IsObject(crRpt) Then
       Set rptReport = Nothing
    End If

'
'   Open report
'
    Set rptApplication = New CRAXDRT.Application

    Set rptReport = rptApplication.OpenReport(FullPathandFileName.rpt, 1)

    With rptReport
      .ExportOptions.DestinationType = crEDTDiskFile
      .ExportOptions.HTMLFileName = strPathAndReportName & ".html"
      .ExportOptions.FormatType = crEFTHTML40
      .Export (False)
End With

end

mlmcc
0
 

Author Comment

by:pvisser1
ID: 8194062
Thanks 2 all.

mlmcc the answer you give me did  what i need.
Also a want to thank the other guys how helped me out..

Thanks...
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8194783
Glad I could help

mlmcc
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question