Skip to Content
0
Former Member
Oct 16, 2011 at 01:31 AM

How to set LogonProperties on Crystal Reports 2008

161 Views

context: I'm currently designing a system on VS 2008 with Crystal Reports 2008 SP3. The database used is MySQL 5.2. I decided to implement the data connection to Crystal Reports through ADO. Xml Currently my system saves the information in xml files before printing and then are used by Crystal Reports. One of the most important issues is to try to address the files is set will at the time of execution.

This code allows you to access the connection properties:

string l;
for (int x =0; x< reportDocument.DataSourceConnections.Count; x++)
    {
       l = reportDocument.DataSourceConnections[x].LogonProperties[0].ToString();
    }

When inspecting the contents of this data are the following properties:

reportDocument.DataSourceConnections[0].LogonProperties Count =2
    {CrystalDecisions.Shared.NameValuePair2}
        Name  "File Path"
        Value "C:\xxxxxx\\xxxx\\xxxxxx.xml";

Reviewing the data I can get the connection through:

NameValuePair2 connectInfo = (NameValuePair2)reportDocument.DataSourceConnections[x].LogonProperties[0];
connectInfo.Value= "the new path of file";

How I can set the property with something like

reportDocument.DataSourceConnections[x].SetLogonProperties(connectInfo);

Edited by: debiagui on Oct 16, 2011 3:31 AM