Skip to Content
0
Former Member
Jun 30, 2007 at 04:14 PM

Image not inserted correctly in Crystal Reports when exported to PDF

312 Views

Post Author: dipakpatadia

CA Forum: Older Products

Hello,

We are facing one issue in Crystal Reports exporting to PDF. An image (.BMP) is being inserted in a crystal report section at runtime. In exported PDF file, the image does not print correctly (prints some dots within a rectangle) and also prints image filename under the image in big font size

At runtime, one image file is being created temporary in one folder and this image file is set in one of the Crystal Reports Section and exported to PDF format.

.Net version: The application is a Web application developed in .Net 1.1 framework SP1

Crystal Reports version: RDC component version 9.0 i.e. craxdrt9.dll

Hot Fix File Installed: CR11NETWIN_EN_200403.exe

The code snippet is as below. Attached the PDF being generated using this code.

-


Private WithEvents crReport As CRAXDRT.ReportClassPrivate WithEvents crChartSection As CRAXDRT.SectionPrivate crApplication As CRAXDRT.Application

crReport = New CRAXDRT.ReportClasscrApplication = New CRAXDRT.ApplicationcrReport = crApplication.OpenReport(strAppPath + "\TestImage.rpt", CRAXDRT.CROpenReportMethod.crOpenReportByTempCopy)crChartSection = crReport.Sections(3)

With crReport.ExportOptions .DestinationType = CRAXDRT.CRExportDestinationType.crEDTDiskFile .DiskFileName = strAppPath + "\Test.pdf" .FormatType = CRAXDRT.CRExportFormatType.crEFTPortableDocFormatEnd With

crReport.PaperOrientation = CRAXDRT.CRPaperOrientation.crLandscape

' Export the reportcrReport.Export(False)

' Following section format event code is being executed at runtime when crReport.Export(False) command is run

Private Sub crChartSection_Format(ByVal pFormattingInfo As Object) Handles crChartSection.Format Try 'bind the chart to report crChartSection.ReportObjects.Item(1).SetOleLocation(strAppPath & "\" & txtBMPPath.Text.Trim()) Catch ex As Exception MessageBox.Show(ex.Message) End TryEnd Sub

-


NOTE: On some other machine, the same code generates correct PDF with image file (.BMP) shown correctly.

What could be the possible reasons? Though, we have verified that Crystal versions and fixes installed on the machine, could it be any permission or CR fixes issues? Please let me know if I will provide more details.

We really appreciate all of your help. you can reach me at dipak@avanicimcon.com

Regards, Dipak