0

I have build an Report application using C# and Crystal Report I build program with Formula Selection to Change Query when User need to Filter the report. The program build in Windows 7. In the windows 7 program is running well as I needed, data and anything is shown like I needed. But I need to run in Windows XP. I try to filter date into to day.

The problem is on CrystalReportViewer RefreshReport(); If I don't use that function data on report doesn't refresh, but if I use that function The connection failed to logon Here is the code:

skr = DateTime.Now.ToString("yyyy/MM/dd");
dp = new DailyParking();
dp.SetDatabaseLogon("user", "passwd", "host", "dbname");
repotviewer.ReportSource = dp;            
repotviewer.SelectionFormula = "Date({transaksi1.masuk})=Date('" +skr+ "') ";
repotviewer.RefreshReport();
repotviewer.Refresh();
4

1 回答 1

0

答案是,安装另一个与 XP 兼容的 MySql 连接器,然后在 MyODBC 中创建连接。

更改代码如下:

skr = DateTime.Now.ToString("yyyy/MM/dd");
dp = new DailyParking();
dp.SetDatabaseLogon("user", "passwd", "host", "dbname");
dp.RecordSelectionFormula = "Date({transaksi1.masuk}) = Date('" + skr + "') ";
repotviewer.ReportSource = dp;
repotviewer.Refresh();

使用安装在 XP 和 Rebuil 程序中的新 MySQL 连接器更改 MySQL.Data 引用。

于 2013-09-16T23:07:19.940 回答