Question

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();
Was it helpful?

Solution

The answer is, Install the Another MySql Connector which compatible in XP, after that create the connection in MyODBC.

Change The code like here:

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();

Change the MySQL.Data reference with new MySQL connector same with installed in XP and Rebuil Program.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top