cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports do not take parameters from .Net application

Former Member
0 Kudos

I'm working on a crystal report (ver.2016) reading an excel and generating the report from .Net (C#) application. It works fine in my local however gives error on server (win.2008 R2) - 'Login failed, incorrect logon parameters'. It does not accept the parameters passed from .Net app. Here is the .Net code

ConnectionInfo connectionInfo = newConnectionInfo();

connectionInfo.ServerName = this.MapPath(".") + "\\reports\\" + "Test\\Report1.xlsx";

connectionInfo.DatabaseName = this.MapPath(".") + "\\reports\\" + "Test\\Report1.xlsx";

connectionInfo.IntegratedSecurity = true;

rptDocument.Database.Tables[0].LogOnInfo.ConnectionInfo = connectionInfo;

rptDocument.SetParameterValue("@FY", lblFiscalYear.Text);

rptDocument.SetParameterValue("@Number", AccountCookie["AccountNumber"].ToString());

Stream oStream = rptDocument.ExportToStream(ExportFormatType.PortableDocFormat);

byte[] byteArray = newbyte[oStream.Length];

oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));

Can anyone please help me?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

What SDK are you using.

CR for VS si the SDK package for CR 2011 and above now.

You can get it from here:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Install the EXE into VS 2010 or above and the rest are for redist, don not install on DEV PC.

Don

Former Member
0 Kudos

Thanks for your reply Don. I've Installed CRforVS_13_0_20 from the same link in both local machine and on server. All my other crystal reports which reads from SQL Server tables work fine (taking parameters from C# code) in both local and server.

Problem is with the report that reads from Excel, which works fine in my local but NOT on server.

Thanks

Answers (1)

Answers (1)

0 Kudos

Use Process Monitor to see what the difference is/missing and/or use CRLogger to see what Crystal is doing.