public RsReportCollection CreateCollection(string aCollectionName, string aFile) { // TODO Create a method to handle more than one collection with the same name RsReportCollection lResult; RsReportCollection lCollection = GetCollection(aCollectionName); if (lCollection != null) throw new Exception("Collection named \"" + aCollectionName + "\" already linked."); else { lResult = new RsReportCollection(); lResult.CollectionName = aCollectionName; lResult.SaveToXML(aFile); AddCollection(lResult); } return lResult; }
public static bool SaveCollection(RsReportCollection aCollection) { if (aCollection.FileName == "") { bool lNoSave = false; while (RsViewEngine._dlgSaveCollection.ShowDialog() != DialogResult.OK) { if (CRSMessageBox.ShowBox( RsViewEngine.Locale.GetMessage("collectionmustsave"), RsViewEngine.Locale.GetMessageTitle("collectionmustsave"), MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk ) == DialogResult.Cancel) { lNoSave = true; break; } } if (!lNoSave) aCollection.SaveToXML(RsViewEngine._dlgSaveCollection.FileName); else { RsViewEngine.CloseCollection(aCollection); return false; } } else aCollection.QuickSave(); return true; }
protected void InitializeCollections() { RsCollectionConfig lFavCfg = new RsCollectionConfig(); lFavCfg.Type = RsCollectionType.Favorites; lFavCfg.Path = FavoritesFile; lFavCfg.Name = "favorites"; Profile.Collections.Add(lFavCfg); if (!lFavCfg.IsCollectionExists()) { RsReportCollection lCollection = new RsReportCollection(); lCollection.CollectionName = "favorites"; lCollection.SaveToXML(lFavCfg.Path); } }