Skip to Content
0
Former Member
Jun 04, 2009 at 03:56 PM

Update Report by .net SDK

71 Views

1) I am sucessfully add report by .net sdk by following method, When I try to upload the same report to the same folder, it will fail. Is that anyway to overwrite the report in Crysal enterprise?

ceInfoStore = LoginAndGetInfoStore();

InfoObjects infoObjects = ceInfoStore.NewInfoObjectCollection();

PluginManager pluginManager = ceInfoStore.PluginManager;

PluginInfo pluginInfo = pluginManager.GetPluginInfo("CrystalEnterprise.Report");

InfoObject infoObject = infoObjects.Add(pluginInfo);

Report report = new Report(infoObject.PluginInterface);

report.Files.Add(fileloc);

report.Properties.Add("SI_PARENTID", folderId);

report.EnableThumbnail = true;

report.NeedsLogon = true;

// report.KeepSavedData = true;

//Store the file name as Description

FileInfo fileinfo = new FileInfo(fileloc);

report.Description = fileinfo.Name;

for (int i = 1; i <= report.ReportLogons.Count; i++)

{

report.ReportLogons<i>.CustomUserName = "";

report.ReportLogons<i>.CustomPassword = "";

report.ReportLogons<i>.CustomDatabaseName = "";

report.ReportLogons<i>.UserName = "";

report.ReportLogons<i>.Password = "";

report.ReportLogons<i>.PromptOnDemandViewing = false;

}

ceInfoStore.Commit(infoObjects);

2) I have the other question about searching report by the Query as following, it return 0 record from Crystal Enterprise. However when I remove "SI_KIND='Folder' it will get the record I expect. so I think SI_KIND='Folder' is not working with Crystal Enterprise 10. anyone has idea to solve the problem? Because I may have same name for Folder and Report.

Select SI_ID FROM CI_INFOOBJECTS WHERE SI_KIND=u2019Folderu2019 and SI_Name=u2019Report Name'