Crystal Reports Login Fails on ExportToDiskRSS

3 replies

Last post Nov 12, 2018 01:56 AM by Brando Zhang

  • Crystal Reports Login Fails on ExportToDisk

    Nov 02, 2018 04:48 AM|sphar1970|LINK

    Hi Everyone,

    Using Web Deploy 3.6 I have imported a .Net framework 1.1 application from Windows Server 2003 x86 IISv6 to Windows Server 2016 using the following sources:

    https://stackoverflow.com/questions/18385286/windows-server-2012-with-asp-net-1-1

    http://www.uhleeka.com/blog/2009/08/how-to-install-asp-net-v1-1-with-iis7-on-windows-2008-x64/

    The 32-bit HTTP application is working with the exception being the Crystal Reports component (error below, ExportToDisk)

    The 32-bit code is writing to C:\windows\sysWOW64\inetsrv\Reports without issue (you can see if delete the file in question) but an error is returned as shown below rather than a "powered by crystal" window with "download this report as a Microsoft Word document"

    Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
    Source Error:
    Line 786: if(System.IO.File.Exists("Reports\\Report.doc"))
    Line 787: System.IO.File.Delete("Reports\\Report.doc");
    Line 788: oRptVar.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.WordForWindows, Server.MapPath(".\\Reports")+"\\Report.doc");
    Line 789: hlWordReport.NavigateUrl = "Reports\\Report.doc";
    Line 790: CrystalReportViewer1.ReportSource = oRptVar;

    Source File: c:\inetpub\wwwroot\APPsystem\Appreports.aspx.cs Line: 788

    Stack Trace:
    [LogOnException: Logon failed.]
    .I(String , EngineExceptionErrorID ) +506
    .D(Int16 , Int32 ) +537
    CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext) +469
    CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName) +188
    AppSystem.AppReports.GenerateVarsReport(String Var) in c:\inetpub\wwwroot\Appsystem\Appreports.aspx.cs:788
    AppSystem.AppReports.SLAReportB4_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\Appsystem\Appreports.aspx.cs:1196
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +58
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    System.Web.UI.Page.ProcessRequestMain() +1273

    Prior to the web deploy 3.6 import, I have configured Windows Server 2016 as follows:

    Installed .Net 1.1 framework and Security updates
    Configured DefaultAppPool, .NET CLR Version v1.1.4322, classic managed pipeline mode,Enabled 32-bit applications = true
    NTFS security on the folders c:\inetpub\wwwroot\<>
    Installed MS Visual Studio .Net Enterprise Architect 2003
    Crystal Reports runtime was installed during VS install

    If anyone has come across this issue, please let me know on how you resolved.

    Thanks.

  • Re: Crystal Reports Login Fails on ExportToDisk

    Nov 05, 2018 05:37 AM|Brando Zhang|LINK

    Hi sphar1970,

    Since the SDK works in 2016 it will be using the OLD DB access method, I suggest you could change the Crystal report to use an OLE DB datasource. Then it may work well.

    Besides, this issue is related with the Crystal Reports not IIS, I suggest you could try to post this issue on the Crystal report forum.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=vscrystalreports 

    Best Regards,

    Brando

  • Re: Crystal Reports Login Fails on ExportToDisk

    Nov 05, 2018 05:53 AM|sphar1970|LINK

    Hi Brando,

    What do you mean by "SDK works in 2016" ??? On my test Windows Server 2016 VM I have installed .Net Enterprise Architect 2003 which installs Crystal Reports runtime 9.1.5000.0 (same build as the Win2003 x86 VM)

    In C:\windows\Assembly folder the versions are 9.1.5000.0

    I have posted the issue on the Crystal Reports forum as you suggested.

  • Re: Crystal Reports Login Fails on ExportToDisk

    Nov 12, 2018 01:56 AM|Brando Zhang|LINK

    Hi sphar1970,

    I mean you should use oledb as the provider in the application.

    Like below codes:

            objReportDocument.Refresh()
     
            Dim objLogOnInfo As New CrystalDecisions.Shared.TableLogOnInfo
            Dim objConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
            Dim objDbConnectionAttributes As New DbConnectionAttributes
            Dim objEQ_LogonProperties As New DbConnectionAttributes
            Dim ServerName As String = "ServerName"     ' ENTER SERVER NAME HERE
            Dim DatabaseName As String = "DatabaseName"      ' ENTER DATABASE NAME HERE
     
            objEQ_LogonProperties.Collection.Add(New NameValuePair2("Data Source", ServerName))
            objEQ_LogonProperties.Collection.Add(New NameValuePair2("Initial Catalog", DatabaseName))
            objEQ_LogonProperties.Collection.Add(New NameValuePair2("Integrated Secruity", DbConnectionAttributes.LOGONPROP_INTEGRATED_SECURITY_SSPI))
            objEQ_LogonProperties.Collection.Add(New NameValuePair2("Provider", "SQLOLEDB"))
     
            objDbConnectionAttributes.Collection.Add(New NameValuePair2(DbConnectionAttributes.CONNINFO_DATABASE_DLL, DbConnectionAttributes.DATABASE_DLL_CRDB_ADO))
            objDbConnectionAttributes.Collection.Add(New NameValuePair2(DbConnectionAttributes.QE_DATABASE_NAME, DatabaseName))
            objDbConnectionAttributes.Collection.Add(New NameValuePair2("QE_DatabaseType", "OLE DB (ADO)"))
     

    Best Regards,

    Brando