Skip to Content
avatar image
Former Member

Setting LogonInfo to crystal report viewer

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.AppSettingssReportDataSource;

oConInfo.UserID = ConfigurationManager.AppSettingssReportUserId ;

oConInfo.Password = ConfigurationManager.AppSettingssReportPwd ;

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 17, 2008 at 10:33 AM

    Hello Suneetha,

    please post some more infos about your business need.

    What are trying to achieve ? Which SDK are you using ?

    Are you trying to read the user credentials from a BOE system to log on to Infoview or the CMC?

    Thanks for some more details

    Falk

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Falk,

      We are using BO XI R2 .net sdk.

      The requirement is:

      We have an intranet site to view the reports, for which we are using crystal reports and published them in CMC. Now I am trying to view the reports from our .net application through the crystal report viewer.

      I tried assigning the database login information (oracle) to the template programmatically, and which does not seem to work.

      Eg: I have report template A: while publishing I use "Connection A".

      When I pass "Connection B" programmatically, It is prompting me for databse login credentials .

      If I check "Use the same credentials while viewing the report" in CMC, it works fine. But, I want the connection info to be customized, so I want to pass it from web config file.

      As shown in the code(In orignial post), I get the connection info from config file, construct the tableLogonInfos and assign it to crystalreport viewer.

      Hope this is clear