EDN Admin
Well-known member
Hi,
In a VB.NET project we export a CR report to pdf.
On the developing PC this works perfectly. On our server it doesnt.<br/>
On both the server and the PC the same version of CR is installed.
In the project we have (among others) these references:
<table border="0" cellspacing="0" cellpadding="0" width="848" style="width:636pt; border-collapse:collapse
<colgroup span="1 <col span="1" width="87" style="width:65pt <col span="1" width="761" style="width:571pt </colgroup>
<tbody>
<tr height="15" style="height:11.25pt
<td width="87" height="15" style="background-color:transparent; width:65pt; height:11.25pt; border-color:#f0f0f0
(Name)</td>
<td width="761" style="background-color:transparent; width:571pt; border-color:#f0f0f0
CrystalDecisions.CrystalReports.Engine</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Copy Local<span> </td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Culture</td>
<td style="background-color:transparent; border-color:#f0f0f0 </td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Description</td>
<td style="background-color:transparent; border-color:#f0f0f0 Crystal Reports for .NET</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
File Type</td>
<td style="background-color:transparent; border-color:#f0f0f0 Assembly</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Identity</td>
<td style="background-color:transparent; border-color:#f0f0f0 CrystalDecisions.CrystalReports.Engine</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Path</td>
<td style="background-color:transparent; border-color:#f0f0f0 C:WindowsassemblyGAC_MSILCrystalDecisions.CrystalReports.Engine12.0.2000.0__692fbea5521e1304CrystalDecisions.CrystalReports.Engine.dll</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Resolved</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Runtime Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 v2.0.50727</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Specific Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Strong Name</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 12.0.2000.0</td>
</tr>
</tbody>
</table>
and
<table border="0" cellspacing="0" cellpadding="0" width="848" style="width:636pt; border-collapse:collapse
<colgroup span="1 <col span="1" width="87" style="width:65pt <col span="1" width="761" style="width:571pt </colgroup>
<tbody>
<tr height="15" style="height:11.25pt
<td width="87" height="15" style="background-color:transparent; width:65pt; height:11.25pt; border-color:#f0f0f0
(Name)</td>
<td width="761" style="background-color:transparent; width:571pt; border-color:#f0f0f0
CrystalDecisions.Shared</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Copy Local<span> </td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Culture</td>
<td style="background-color:transparent; border-color:#f0f0f0 </td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Description</td>
<td style="background-color:transparent; border-color:#f0f0f0 Crystal Reports for .NET</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
File Type</td>
<td style="background-color:transparent; border-color:#f0f0f0 Assembly</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Identity</td>
<td style="background-color:transparent; border-color:#f0f0f0 CrystalDecisions.Shared</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Path</td>
<td style="background-color:transparent; border-color:#f0f0f0 C:WindowsassemblyGAC_MSILCrystalDecisions.Shared12.0.2000.0__692fbea5521e1304CrystalDecisions.Shared.dll</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Resolved</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Runtime Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 v2.0.50727</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Specific Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Strong Name</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 12.0.2000.0</td>
</tr>
</tbody>
</table>
So the CR dll files are copied along the exe file in the Release folder.
The error we get is: "Loading report failed". The error message is generated by Crystal Reports itself, not by an exception in our code.
We could pinpoint the exact code line that triggered the error: crExportOptions = rpt.ExportOptions
Imports CrystalDecisions.CrystalReports.Engine<br/>
Imports CrystalDecisions.Shared
Dim rpt As New rptRegistration<br/>
Dim crViewer As New CrystalDecisions.Windows.Forms.CrystalReportViewer
crViewer.ReportSource = rpt<br/>
crViewer.SelectionFormula = "{VW_RegistrationPdf.OrderNumber}=1"<br/>
crViewer.RefreshReport()
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As New DiskFileDestinationOptions()<br/>
Dim crFormatTypeOptions As New PdfRtfWordFormatOptions()<br/>
crDiskFileDestinationOptions.DiskFileName = " file://server/PdfDirectory/Registration0000001.pdf <span style="color:#0066dd \serverPdfDirectoryRegistration0000001.pdf "
crExportOptions = rpt.ExportOptions
With crExportOptions<br/>
.ExportDestinationType = ExportDestinationType.DiskFile<br/>
.ExportFormatType = ExportFormatType.PortableDocFormat<br/>
.DestinationOptions = crDiskFileDestinationOptions<br/>
.FormatOptions = crFormatTypeOptions<br/>
End With
rpt.Export()<br/>
crViewer.Dispose()<br/>
rpt.Dispose()
To complete the picture.<br/>
We have an other vb.NET application running on the same server. The same Crystal Report references are used.<br/>
The same report object is used (via a reference to our errorous project - the two projects are actualy part of the same sollution), and also a Crystal Report Report Viewer is used (CrystalDecisions.Windows.Forms.CrystalReportViewer).<br/>
In the project that works we dont do an export, we show the report to the user via the report viewer. When we do an export there, using the export button on the report viewer and export it as a pdf, it works perfectly.
We have no more clues how to solve this problem.
Anybody has an idea or a clue?
Thanks
<br/>
<br/>
<br/>
<br/>
View the full article
In a VB.NET project we export a CR report to pdf.
On the developing PC this works perfectly. On our server it doesnt.<br/>
On both the server and the PC the same version of CR is installed.
In the project we have (among others) these references:
<table border="0" cellspacing="0" cellpadding="0" width="848" style="width:636pt; border-collapse:collapse
<colgroup span="1 <col span="1" width="87" style="width:65pt <col span="1" width="761" style="width:571pt </colgroup>
<tbody>
<tr height="15" style="height:11.25pt
<td width="87" height="15" style="background-color:transparent; width:65pt; height:11.25pt; border-color:#f0f0f0
(Name)</td>
<td width="761" style="background-color:transparent; width:571pt; border-color:#f0f0f0
CrystalDecisions.CrystalReports.Engine</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Copy Local<span> </td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Culture</td>
<td style="background-color:transparent; border-color:#f0f0f0 </td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Description</td>
<td style="background-color:transparent; border-color:#f0f0f0 Crystal Reports for .NET</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
File Type</td>
<td style="background-color:transparent; border-color:#f0f0f0 Assembly</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Identity</td>
<td style="background-color:transparent; border-color:#f0f0f0 CrystalDecisions.CrystalReports.Engine</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Path</td>
<td style="background-color:transparent; border-color:#f0f0f0 C:WindowsassemblyGAC_MSILCrystalDecisions.CrystalReports.Engine12.0.2000.0__692fbea5521e1304CrystalDecisions.CrystalReports.Engine.dll</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Resolved</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Runtime Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 v2.0.50727</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Specific Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Strong Name</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 12.0.2000.0</td>
</tr>
</tbody>
</table>
and
<table border="0" cellspacing="0" cellpadding="0" width="848" style="width:636pt; border-collapse:collapse
<colgroup span="1 <col span="1" width="87" style="width:65pt <col span="1" width="761" style="width:571pt </colgroup>
<tbody>
<tr height="15" style="height:11.25pt
<td width="87" height="15" style="background-color:transparent; width:65pt; height:11.25pt; border-color:#f0f0f0
(Name)</td>
<td width="761" style="background-color:transparent; width:571pt; border-color:#f0f0f0
CrystalDecisions.Shared</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Copy Local<span> </td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Culture</td>
<td style="background-color:transparent; border-color:#f0f0f0 </td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Description</td>
<td style="background-color:transparent; border-color:#f0f0f0 Crystal Reports for .NET</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
File Type</td>
<td style="background-color:transparent; border-color:#f0f0f0 Assembly</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Identity</td>
<td style="background-color:transparent; border-color:#f0f0f0 CrystalDecisions.Shared</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Path</td>
<td style="background-color:transparent; border-color:#f0f0f0 C:WindowsassemblyGAC_MSILCrystalDecisions.Shared12.0.2000.0__692fbea5521e1304CrystalDecisions.Shared.dll</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Resolved</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Runtime Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 v2.0.50727</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Specific Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Strong Name</td>
<td style="background-color:transparent; border-color:#f0f0f0 TRUE</td>
</tr>
<tr height="15" style="height:11.25pt
<td height="15" style="background-color:transparent; height:11.25pt; border-color:#f0f0f0
Version</td>
<td style="background-color:transparent; border-color:#f0f0f0 12.0.2000.0</td>
</tr>
</tbody>
</table>
So the CR dll files are copied along the exe file in the Release folder.
The error we get is: "Loading report failed". The error message is generated by Crystal Reports itself, not by an exception in our code.
We could pinpoint the exact code line that triggered the error: crExportOptions = rpt.ExportOptions
Imports CrystalDecisions.CrystalReports.Engine<br/>
Imports CrystalDecisions.Shared
Dim rpt As New rptRegistration<br/>
Dim crViewer As New CrystalDecisions.Windows.Forms.CrystalReportViewer
crViewer.ReportSource = rpt<br/>
crViewer.SelectionFormula = "{VW_RegistrationPdf.OrderNumber}=1"<br/>
crViewer.RefreshReport()
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As New DiskFileDestinationOptions()<br/>
Dim crFormatTypeOptions As New PdfRtfWordFormatOptions()<br/>
crDiskFileDestinationOptions.DiskFileName = " file://server/PdfDirectory/Registration0000001.pdf <span style="color:#0066dd \serverPdfDirectoryRegistration0000001.pdf "
crExportOptions = rpt.ExportOptions
With crExportOptions<br/>
.ExportDestinationType = ExportDestinationType.DiskFile<br/>
.ExportFormatType = ExportFormatType.PortableDocFormat<br/>
.DestinationOptions = crDiskFileDestinationOptions<br/>
.FormatOptions = crFormatTypeOptions<br/>
End With
rpt.Export()<br/>
crViewer.Dispose()<br/>
rpt.Dispose()
To complete the picture.<br/>
We have an other vb.NET application running on the same server. The same Crystal Report references are used.<br/>
The same report object is used (via a reference to our errorous project - the two projects are actualy part of the same sollution), and also a Crystal Report Report Viewer is used (CrystalDecisions.Windows.Forms.CrystalReportViewer).<br/>
In the project that works we dont do an export, we show the report to the user via the report viewer. When we do an export there, using the export button on the report viewer and export it as a pdf, it works perfectly.
We have no more clues how to solve this problem.
Anybody has an idea or a clue?
Thanks
<br/>
<br/>
<br/>
<br/>
View the full article