Skip to Content
0
Former Member
Aug 11, 2017 at 08:42 AM

Crystal Reports do not take parameters from .Net application

137 Views Last edit Aug 11, 2017 at 02:47 PM 2 rev

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?