Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

My code to load a .rpt file (crystal report) from an exe file (C#):
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(strRptPath);

cryRpt.DataSourceConnections.Clear();
cryRpt.DataSourceConnections[0].SetConnection(m_strServerName, m_strDBName, false);
cryRpt.DataSourceConnections[0].IntegratedSecurity = true;
for (int i = 0; i < arrFields.Count(); i++)
{
    cryRpt.SetParameterValue(arrFields[i], arrValues[i]);
}
cryRpt.RecordSelectionFormula = m_strFormula;

rptViwer_epd.ReportSource = m_cryRpt;
rptViwer_epd.SelectionFormula = m_Report.RecordSelectionFormula;
rptViwer_epd.Refresh();


Why the "Database login" dialog is shown, with empty and disabled Database and server name fields?
I do not want the "loing datatbase dialog" is be shown, because i set the "database server and database" names dynamically, in code.

Please help me.

What I have tried:

Connect dynamically to DataBase, without showing "login dialog"
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900