Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Setting LogonInfo to crystal report viewer Post Reply Post New Topic
Author Message
Sunhere
Newbie
Newbie


Joined: 11 Sep 2008
Online Status: Offline
Posts: 1
Quote Sunhere Replybullet Topic: Setting LogonInfo to crystal report viewer
    Posted: 11 Sep 2008 at 12:50pm
Hello All,
I have a problem setting up the Logon info to the crystal report viewer.
Here is my code.

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 am thinking the setting 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....Dead
 
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.