cancel
Showing results for 
Search instead for 
Did you mean: 

Setting LogonInfo to crystal report viewer

Former Member
0 Kudos

Hello All,

I have a problem setting up the Logon info to the crystal report viewer.

Here is my code.

// this is how I will be searching the InfoStore for the specified report template id..

objects = infoStore.Query("Select SI_ID from ci_infoobjects where SI_NAME='" + objectName + "' and SI_PARENT_FOLDER=" + parentID.ToString() + " and SI_Instance=0");

if (objects.Count != 1) return (-1);

// GLTxnReportViewer is the crystalreportviewer control

this.GLTxnReportViewer.ReportSource = objects[1].ID;

this.GLTxnReportViewer.EnterpriseLogon = reportObject.BOEnterpriseSession;

// this code is for getting the report datasource, user id and pwd..

TableLogOnInfos oTblLogOnInfos = new TableLogOnInfos();

TableLogOnInfo oTblLogOnInfo = new TableLogOnInfo();

ConnectionInfo oConInfo = new ConnectionInfo();

oConInfo.ServerName = ConfigurationManager.AppSettings[sReportDataSource];

oConInfo.UserID = ConfigurationManager.AppSettings[sReportUserId ];

oConInfo.Password = ConfigurationManager.AppSettings[sReportPwd ];

oTblLogOnInfo.ConnectionInfo = oConInfo;

oTblLogOnInfos.Add(oTblLogOnInfo);

// end of the login code..

this.GLTxnReportViewer.LogOnInfo = oTblLogOnInfos;

So as shown in the above code, i will be getting the d/b datasource, userid and pwd from the config file, construct the tableloginInfos and set it to the crystal report viewer logoninfo.

My ultimate purpose is, i should be able to change the logon info dynamically when i change it in config file. i should not go to the cmc and modify the d/b parameters for that report.

The report works when the d/b info which i used while publishing the report matches with the config d/b info. If the d/b info differs, then it is throwing the logon screen for the report. Which i dont want.

So, I think the setting of the logon info to the viewer is not working..

I have gone thru the forums, where they will instantiate the report document object, loop thru the tables and set the logon for each of them. but in my case, i dont load the report, but i get the infoobject from the query....

Please help

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Suneetha,

Post this message in .NET Development - Crystal Reports forums as this forum is answered by developers.

Link is [here|https://www.sdn.sap.com/irj/sdn/businessobjects-sdk-forum]

Hope this helps!!

Regards,

Shweta