Note that there are some explanatory texts on larger screens.

plurals
  1. POCrystal Report convert to PDF (Error The logon to the database failed. ((0x8004100f)))
    primarykey
    data
    text
    <p>In my application I have some code to convert to PDF. In debug mode all is good and working but when I test it on then server I keep getting the logon to the database failed. I have no idea why I get the error becase the login and password are 100% ok. </p> <p>tried 2 ways for the server of sending the report</p> <pre><code>SetCrystalReportFilePath(Server.MapPath("~/MemberPages/Report.rpt")) SetPdfDestinationFilePath(Server.MapPath("~/MemberPages/Report_" &amp; Report &amp; ".pdf")) SetRecordSelectionFormula("{Report.Report_id} =" &amp; ID) Transfer() SetCrystalReportFilePath("C:\inetpub\wwwroot\Werkbon.rpt") SetPdfDestinationFilePath("C:\inetpub\wwwroot\Werkbon_" &amp; werkbonnr &amp; ".pdf") SetRecordSelectionFormula("{werkbon.werkbon_id} =" &amp; werkbonnr) Transfer() Dim ConInfo As New CrystalDecisions.Shared.TableLogOnInfo Dim oRDoc As New ReportDocument Dim expo As New ExportOptions Dim sRecSelFormula As String Dim oDfDopt As New DiskFileDestinationOptions Dim strCrystalReportFilePath As String Dim strPdfFileDestinationPath As String Public Function SetCrystalReportFilePath(ByVal CrystalReportFileNameFullPath As String) strCrystalReportFilePath = CrystalReportFileNameFullPath End Function Public Function SetPdfDestinationFilePath(ByVal pdfFileNameFullPath As String) strPdfFileDestinationPath = pdfFileNameFullPath End Function Public Function SetRecordSelectionFormula(ByVal recSelFormula As String) sRecSelFormula = recSelFormula End Function Public Function Transfer() oRDoc.Load(strCrystalReportFilePath) oRDoc.RecordSelectionFormula = sRecSelFormula oDfDopt.DiskFileName = strPdfFileDestinationPath expo = oRDoc.ExportOptions expo.ExportDestinationType = ExportDestinationType.DiskFile expo.ExportFormatType = ExportFormatType.PortableDocFormat expo.DestinationOptions = oDfDopt oRDoc.SetDatabaseLogon("databasename", "password") oRDoc.Export() End Function </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload