I wrote a report using Crystal Reports XI linked to an Access database here C:\MyData.mdb.
The report has one field (simplified for this example) and no sub-reports.
I have used the Forms and WPF Cyrtsal Report Viewer using C# .NET 4.
The report views successfully on my development PC running Windows XP, and on other "tills", also running Windows XP.
However, on a till running WePOS (a sort of cut down Windows XP) the report "always" shows a dialog box asking for login details i.e. Username & Password.
This dialog box also shows the correct path to C:\MyData.mdb.
I have spent many days on this, testing in every way possible (I'm sure everyone remembers times like these!).
I use this code to ensure the database is correctly linked to:
TableLogOnInfo logonInfo;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in report.Database.Tables)
{
logonInfo = table.LogOnInfo;
logonInfo.ConnectionInfo.ServerName = string.Empty;
logonInfo.ConnectionInfo.DatabaseName = "C:\MyData.mdb";
logonInfo.ConnectionInfo.UserID = string.Empty;
logonInfo.ConnectionInfo.Password = string.Empty;
table.ApplyLogOnInfo(logonInfo);
}
... and it works on every PC with Windows XP, except the one with WePOS.
I've also played with:
report.SetDatabaseLogon(string.Empty, string.Empty, "C:\MyData.mdb", string.Empty);
... but It makes no difference.
I can only conclude WePOS is so "cut down" that Crystal is silently failing to pass authentication... please help!
Crystal Reports is a popular Windows-based report writer solution that allows a developer to create reports and dashboards from a variety of data sources with a minimum of code to write. Crystal Reports is owned and developed by SAP.
Just for future reference, if you ever switch to SQL Server you will want to use SQL OLEDB and NOT the native Sql Client or you will run into the same problem again as I also did when I was first integrating CR into our app. It will work fine on your development machine but not in production.
DOes this WePos thing have the correct right to read from to folder/location in your filesystem or do you need elevated rights or something to read from this location. Could be the same issue when you connect to a remote network folder. Then you also have to specify the credentials on that computer to get access to it. Does this make sense?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With