2016-09-23 17 views
0

私はVS 2010用のCrystal Reports SP 13.0.17(VS 2015でも試しました)とSQL Server 2014用のODBCを使用しています。外部のレポート)、正しい資格情報が提供されていても、データベースのログインダイアログが表示されます。ダイアログボックスでユーザー名とパスワードを再入力すると、ユーザー名またはパスワードが正しくないというエラーが表示されます。VS用のCrystal ReportsがWindows 10上のSQLに接続しない

これはWindows 10でのみ発生します.Windows XPまたはWindows 7で実行すると正常に動作します。

レポートはCrystal Reportsで実行するとデータベースに接続します。 ODBC接続はCrystal以外のプログラムで動作します。

これはバグですか、何か不足していますか?

ReportDocument cryRpt = new ReportDocument(); 

cryRpt.Load(strFilename); 
cryRpt.PrintOptions.PrinterName = strPrinterName; 
this.Name = this.Text = Path.GetFileNameWithoutExtension(strFilename); 
cryRpt.SetDatabaseLogon(strDBUser, strDBPwd, strDBServer, strDBDatabase); 

cryRpt.RecordSelectionFormula = strSelForm; 

foreach (var pair in dctParams) 
try 
{ 
    cryRpt.SetParameterValue(pair.Key, pair.Value); 
} 
catch (Exception ex) 
{ 
    MessageBox.Show("Parameter: " + pair.Key + ", Value: " + pair.Value.ToString() + ", Type: " + pair.Value.GetType() + ", was not passed correctly", "Error"); 
} 

crystalReportViewer1.ViewTimeSelectionFormula = strSelForm; 
crystalReportViewer1.SelectionFormula = strSelForm; 
crystalReportViewer1.ShowExportButton = bShowExport; 
crystalReportViewer1.ShowPrintButton = bShowPrint; 
crystalReportViewer1.ShowParameterPanelButton = bShowParam; 
crystalReportViewer1.ShowGroupTreeButton = bShowGroup; 
if(!bShowParamPanel) 
    crystalReportViewer1.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None; 

crystalReportViewer1.ReportSource = cryRpt; 

if (bShowForm) 
{ 
    if (!this.ShowInTaskbar) 
     this.ShowInTaskbar = true; 

    if (this.WindowState == FormWindowState.Minimized) 
     this.WindowState = FormWindowState.Maximized; 
    crystalReportViewer1.Refresh(); 
    if (bPrint) cryRpt.PrintToPrinter(1, false, 0, 0); 
} 
else 
{ 
    cryRpt.PrintToPrinter(1, false, 0, 0); 
    this.Close(); 
} 

答えて

0

私はそれが新しいプロジェクトを作成することで動作するようになったとの私のコードをコピーした。

関連する問題