PDA

View Full Version : Preview a Crystal report file



Artificial_Intelligence
August 1, 2006, 12:02 AM
Hi all i have servral crystal report files that i would like to view . using the crystal report viewer in vs2005. i have the viewer on the form and simply need to know which properties/functions to manipulate to view the reports i have a dilog to select the files.

thanks in advance.

Artificial_Intelligence
August 1, 2006, 02:43 PM
Ok with some help i managed to get the report viewing , how do i set the username and password for the connection in code,

i have tried working with the logoninfo options but, no success.

Artificial_Intelligence
August 2, 2006, 01:08 AM
It's all good , no need to rush. Thanks for watching!

crosswire
August 2, 2006, 08:39 AM
Did you get through? Answer with the code that you used.

If not. I will check it out on the wekend if I have the time. Its my only available time these days.

Artificial_Intelligence
August 2, 2006, 04:55 PM
I did ! ill post the code later tonight.

Artificial_Intelligence
August 3, 2006, 12:33 AM
I did ! ill post the code later tonight.


ok hers the code:


try
{
flDlg.ShowDialog();
rpDocument.FileName = flDlg.FileName; rpDocument.Database.Tables[0].LogOnInfo.ConnectionInfo.Password = "ThePassword";
rpDocument.Database.Tables[0].ApplyLogOnInfo(rpDocument.Database.Tables[0].LogOnInfo);
rpViewer.ReportSource = rpDocument;
rpViewer.RefreshReport();
}
catch (SystemException ex) { MessageBox.Show("Error Occured"+ " "+ex.Message); }


In this situation the reports were made using Crystal report applicatin ---> not vs2003 or vs2005.