gerardo-lijs / CrystalReportsRunner

Runner to allow the use of Crystal Reports in .NET Core using external process (in .NET Framework 4.8) and named pipes for communication
MIT License
59 stars 19 forks source link

Intergrated Security False #5

Closed dpmangwiro closed 1 year ago

dpmangwiro commented 1 year ago

Thank you very much for sharing this project. I am somehow failing to get it to work for me. I need to have it work where integrated security is false but the report is failing to pick up the database, username and passwork. I am just not sure what i am doing wrong. Its most probably something im missing since even the sample is giving me the same problem. Sample Report Error

mhmd-azeez commented 1 year ago

Hi, can you show us how you're Configuring the report? If you use this method on the CrystalReportsConnectionFactory, it should work. Something like this:

var report = new Report("SampleReport.rpt", "Sample Report")
{
    Connection = CrystalReportsConnectionFactory.CreateSqlConnection(".\\SQLEXPRESS", "CrystalReportsSample", "database username", "database password")
};
dpmangwiro commented 1 year ago

I used this code in the sample

engine.LogLevel = LogLevel.Trace;

var report = new Report("C:\AccPro\Reports\rptzzz_drDebtorsListing.rpt", "Debtors Listing"); report.Connection = CrystalReportsConnectionFactory.CreateSqlConnection(server: "AccPro\AccPro", database: "lamdev", username: "sa", password: "mypass"); report.Parameters.Add("@startcode", "1"); report.Parameters.Add("@endcode", "z"); await engine.ShowReport(report);

Console.ReadKey();

was still getting the same problem until i removed these two properties: { "Use DSN Default Properties", "False" } { "Provider", "MSOLEDBSQL" } now it has improved to the point where it shows that it has taken the databasename, userid and password but its not proceeding to show the report. If i complete the information and press enter im getting log on failed error.

Sample Report Error

dpmangwiro commented 1 year ago

Oh Finally got it working Added these two lines in the Sql logon properties

{ "Database Type", "OLE DB (ADO)" }, { "Provider", "SQLNCLI11" },

Hope this can help someone in the future. Many thanks for your help.

gerardo-lijs commented 1 year ago

Thanks for sharing your connection properties solution! Crystal Reports uses very old and legacy database providers so it's hard to get one set of parameters that work for everyone. This two options that worked for you, might not work for others. Generally speaking the library allows to change every parameter and whatever parameters worked for you before should also work while using this library/wrapper.