cancel
Showing results for 
Search instead for 
Did you mean: 

Set Datasource Crystal

Former Member
0 Kudos

1. I am trying to update the Crystal Reports Data source from Universe to a command object. Set Data Source has u2018Add Commandu2019 option. But I am not able to save the new command object and update the source. Is this a tool limitation or a bug? I am able to update the source with tables, views etcu2026

2. Updating a command object source to another command Object also doesn't work. (FYI: Editing the command object works, But I am not interested in it)

3. Also, I am not able to switch between the servers in the u2018Repositoryu2019. We have Universes in one server and Business Views in other server. Universe server is Enterprise authentication and Business Views server is Windows NT authentication. After connecting to Universe server (System), I am not able to go back to another server which has Business Views.

What are the limitations to updating the data source in Crystal Reports? Some of our reports are also bult on stored procs. Users wants to change the report data source as per their preference and wants to map the fields i.e; eg: Command Object to Universe, Stored proc to Universe, Universe to stored proc, Universe to Command Object, Universe to a database views/tables, Command Objects to Tables/views etc...

Environment: BO XI R2, Busness View Manger, Crystal XI R2 and Oracle 10

Thanks,

SG

Edited by: Shamanthreddy on Jul 23, 2010 12:16 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Please post one question at a time.

CR will not allow you to set location from a direct connection to database tables to a command object. Because Commands can be complex it's too much mapping work for Cr to do this in current versions. We are working on this for some future release.

Using an application and RAS you can do it though. If you have a developer available here's how:

private void TableToCommand_Click(object sender, EventArgs e)

{

// uses report 4 - against Xtreme ODBC to SQL Server

CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

ISCDReportClientDocument rcd;

rcd = rptClientDoc;

rptClientDoc.DatabaseController.LogonEx("Dwilliams1 - VAN-W-13-DWILLI", "xtreme", "sa", "1Oem2000");

CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo oldConninfo;

CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo newConnInfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();

CrystalDecisions.ReportAppServer.DataDefModel.Table oldTbl;

CrystalDecisions.ReportAppServer.DataDefModel.CommandTable newTbl = new CommandTable();

oldTbl = (CrystalDecisions.ReportAppServer.DataDefModel.Table)rcd.Database.Tables[0];

oldConninfo = oldTbl.ConnectionInfo.Clone(true);

GroupPath gp = new GroupPath();

gp.FromString("");

string sql = String.Empty;

rptClientDoc.RowsetController.GetSQLStatement(gp, out sql);

PropertyBag QEProps = new PropertyBag();

PropertyBag logonProps = new PropertyBag();

//Set the attributes for the logonPropsBag

logonProps.Add("Database", "xtreme");

logonProps.Add("DSN", "Dwilliams1 - VAN-W-13-DWILLI");

logonProps.Add("UseDSNProperties", "False");

//Set the attributes

QEProps.Add("Database DLL", "crdb_odbc.dll");

QEProps.Add("QE_DatabaseName", "xtreme");

QEProps.Add("QE_DatabaseType", "ODBC (RDO)");

//Add the QE_LogonProperties we set in the logonProps Object

QEProps.Add("QE_LogonProperties", logonProps);

QEProps.Add("QE_ServerDescription", "Dwilliams1 - VAN-W-13-DWILLI");

QEProps.Add("QE_SQLDB", "True");

QEProps.Add("SSO Enabled", "False");

newConnInfo.Attributes = QEProps;

newConnInfo.UserName = "sa";

newConnInfo.Password = "password";

newConnInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;

newTbl.ConnectionInfo = newConnInfo;

newTbl.CommandText = sql;

newTbl.Name = "Command";

rcd.DatabaseController.SetTableLocationEx(oldTbl,newTbl);

oldTbl =(CrystalDecisions.ReportAppServer.DataDefModel.Table) rcd.Database.Tables[0].Clone(true);

rcd.DatabaseController.SetTableLocationEx(oldTbl, newTbl);

}

Thank you

Don

Former Member
0 Kudos

Thank you Don.