Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: ConnectionInfo change ... but data?? Post Reply Post New Topic
Author Message
_jhorion
Newbie
Newbie
Avatar

Joined: 13 Feb 2008
Location: Italy
Online Status: Offline
Posts: 1
Quote _jhorion Replybullet Topic: ConnectionInfo change ... but data??
    Posted: 13 Feb 2008 at 3:31am
HI GUYS
 
i have this problem ...
 
i'm designing report with crystal report 2008
at design time i connect to a db oracle 10
 
i have writed this code to change dbms in runtime
 

CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo rcConnectionInfo = rptcd.DatabaseController.GetConnectionInfos(null)[0].Clone(true);

CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag rcLogonInfo = (CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag)rcConnectionInfo.Attributes["QE_LogonProperties"];

rcConnectionInfo.UserName = _DBUser;

rcConnectionInfo.Password = _DBPwd;

rcConnectionInfo.Attributes["QE_ServerDescription"] = _DBServer;

/*

rcConnectionInfo.Attributes["QE_DatabaseName"] = "";

rcConnectionInfo.Attributes["Database DLL"]="crdb_oracle.dll";

rcConnectionInfo.Attributes["QE_DatabaseType"]="Server Oracle ";

rcConnectionInfo.Attributes["QE_SQLDB"]="1";

rcConnectionInfo.Attributes["SSO Enabled"] = "0";

*/

rcLogonInfo["Server"] = _DBServer;

/*

rcLogonInfo["Trusted_Connection"] = "false";

*/

rcConnectionInfo.Attributes["QE_LogonProperties"] = rcLogonInfo;

rcConnectionInfo.Kind = CrystalDecisions.ReportAppServer.DataDefModel.CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;

// metodo 1

foreach (CrystalDecisions.ReportAppServer.DataDefModel.Table tbl in rptcd.DatabaseController.Database.Tables)

{

rptcd.DatabaseController.ModifyTableConnectionInfo(tbl.Name,rcConnectionInfo);

}
 

rptcd.DatabaseController.GetConnectionInfos(null).Remove(0);

rptcd.DatabaseController.GetConnectionInfos(null).Insert(0, rcConnectionInfo);

but when i open report... the data don't change
for the out i use a pdf document with byte stream with the follow procedure
 

byte[] ExportReportTo(CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument reportClientDocument, FormatoReport formato)

{

CrReportExportFormatEnum rasReportExportFormat;

switch (formato)

{

case FormatoReport.PDF:

rasReportExportFormat = CrReportExportFormatEnum.crReportExportFormatPDF;

break;

default:

rasReportExportFormat = CrReportExportFormatEnum.crReportExportFormatPDF;

break;

}

PrintOutputController rasPrintOutputController = reportClientDocument.PrintOutputController;

CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray tempByteArray = rasPrintOutputController.Export(rasReportExportFormat, 0);

byte[] byteStreamOutput = tempByteArray.ByteArray;

return byteStreamOutput;

}

 
NB: in watch the rptcd and the relative tables ConnectionInfo is changed but in render the dbms is the same.. :(

there is some flag at design time that not allow change of dbms ?
 
what's the trouble ?
 
pls it's URGENT !!! CryCry
 


Edited by _jhorion - 13 Feb 2008 at 5:55am
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.