Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using Crystal Report 8.5 to Export PDF in Visual Basic 6

Status
Not open for further replies.

itbl

Programmer
Jan 8, 2002
6
0
0
HK
I'm trying to export a Crystal Report 8.5 to Adobe Acrobat, to create a PDF file in Visual Basic 6. I met the following problems:

Problem One - Using Crystl32.OCX, the control does not have export pdf format to select.

Report.ReportFileName ="c:\mytest.rpt"
Report.PrintFileName = "c:\pdf_report.pdf"
Report.Destination = crptToFile
Report.PrintFileType = <----- Cannot select PDF Format

Therefore, I'm using the following function to export PDF format.
Dim appl As New CRAXDRT.Application
Dim rep As CRAXDRT.Report
Set rep = appl.OpenReport(&quot;c:\mytest.rpt&quot;, 1)
rep.ExportOptions.DiskFileName = &quot;c:\pdf_report.pdf&quot;
rep.ExportOptions.DestinationType = crEDTDiskFile
rep.ExportOptions.FormatType = crEFTPortableDocFormat
rep.Export False

Can I use OCX Control to export PDF in Visual Basic?

Problem Two - After I used CRAXDRT object to export PDF, I found out the problem. That is:

In mytest.rpt, it is using UniversCondensed Fonts. So, I exported it to a PDF file in my PC (but my PC don't have this fonts).
It exported to a PDF successfully. When I opened it, the error message appears &quot;Unable to find or create the font 'UniversCondensed'. Some characters may not display or print correctly.&quot;
If I installed this fonts, it displays very well. But in some reasons, I do not want to install this fonts and I can see it well.

If I'm used a PDF Writer to print this report to a PDF, the PDF do not use UniversCondensed Fonts if my PC do not have this fonts. It used a Arial Fonts instead of this fonts. So, I can see it very well. In some reasons, I cannot use PDF writer to print report to PDF, I MUST use CRAXDRT object to export PDF.

Therefore, I have a question, how can I export to a PDF that the PDF file can use a Arial Fonts instead of UniverseCondensed Fonts?
Can I specify the fonts to export a PDF?

Thanks a lot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top