Suivez et participez au développement du nouvel OpenCellar : PLOC.co
> Open Cellar for Windows
> Help Center
> FAQ
> Download Center
> Enter the Forum
> Version history
> Developers resources
> Open Cellar for Mobile
> Help Center
> FAQ
> Download Center
> Enter the Forum
> Version history
> Open Cellar for Mac/Linux
> Help Center
> FAQ
> Download Center
> Enter the Forum
> Version history
> Developers resources
> My Account
> My Live services
> My pages
> My library
> My published wines
> My labels
> My posted messages
> Write a page
> Open Cellar Forum Index
> Windows Forum
> Mac/Linux Forum
> Mobile Forum
> Search for and import wines
> Search for labels
> Compare prices (Sniffer)
Search:
> Search with all engines
> Search in forums
> Search in personal pages
> Search on open-cellar.com
> Search in wine cards
> Search in labels
> Search in price comparison tool (Sniffer)
Welcome (
connect
-
create an account
)
Home
»
The forum
»
Open Cellar Home Edition (Windows)
Nuage de tags
Open Cellar
Scripts
Etiquette
PPP
Cellar book
Mac
Vista
Synchronisation
Excel export
vinoXml
usb
sniffer
backup
import
printing
chardonnet
palm
statistics
Linux
Rapport Personnalisé
22/11/2009
Reply
Rapport Personnalisé
zebuloni
51 posts
Bon Matthieu, j'utilise toujours avec bonheur votre logiciel.
je voudrais créer un rapport personnalisé me permettande trouver les vins bus entre deux dates précises.
Est ce que cela est possible ?
cordialement
Zeb
23/11/2009
Reply
Re : Rapport Personnalisé
Administrateur
3099 posts
Bonjour,
Voici un script qui vous affichera tous vos achats consos dans la fenetre de type Excel.
Cela vous permettra d'appliquer des filtres et tris puis de générer votre rapport.
if(App.ActiveCellar == null) { MessageBox.Show("Aucune cave n'est ouverte"); return; } TableManager manager = new TableManager(App); manager.BeginUpdate(); DataTable table = new DataTable("AfficherPAEx"); table.DefaultView.AllowDelete = false; table.CaseSensitive = false; table.DefaultView.AllowEdit = false; table.DefaultView.AllowNew = false; // SysId DataColumn col = new DataColumn("SysId", typeof(string)); col.Caption = "SysId"; table.Columns.Add(col); // Année col = new DataColumn("Year", typeof(ushort)); col.Caption = "Année"; table.Columns.Add(col); // Nom col = new DataColumn("Name", typeof(string)); col.Caption = "Vin"; table.Columns.Add(col); // Région col = new DataColumn("Area", typeof(string)); col.Caption = "Région"; table.Columns.Add(col); // Appellation col = new DataColumn("Appellation", typeof(string)); col.Caption = "Appellation"; table.Columns.Add(col); // Prix col = new DataColumn("Price", typeof(float)); col.Caption = "Prix unitaire "; table.Columns.Add(col); // Achat col = new DataColumn("Buy", typeof(ushort)); col.Caption = "Achat "; table.Columns.Add(col); // Consommation col = new DataColumn("Consume", typeof(ushort)); col.Caption = "Consommation "; table.Columns.Add(col); // Date col = new DataColumn("Date", typeof(DateTime)); col.Caption = "Date "; table.Columns.Add(col); // Commentaire fiche col = new DataColumn("Comment", typeof(string)); col.Caption = "Commentaire fiche"; table.Columns.Add(col); table.BeginLoadData(); // Liste des vins ObjectCollection oc = manager.Application.ActiveCellar.GetCollection((ushort)ObjectType.Wine); for(int i = 0; i < oc.Count; i++) { Wine w = (Wine)oc[i]; // Fiches achats consos for (int j = 0; j < w.Purchases.Count; j++) { PurchaseSales ps = (PurchaseSales)w.Purchases[j]; DataRow r = table.NewRow(); r["Name"] = w.Name.Trim(); r["Area"] = w.Area.Name.Trim(); r["Appellation"] = w.Appellation.Name.Trim(); r["SysId"] = w.SystemUID; r["Comment"] = ps.Comment.Replace("\n", " "); r["Year"] = w.Year; r["Price"] = ps.Price; r["Buy"] = ps.PurchaseBottles; r["Date"] = ps.Date; r["Consume"] = ps.ConsumeBottles; table.Rows.Add(r); } } table.EndLoadData(); manager.DataSource = table; manager.EndUpdate(); ITableWindow tableWindow = (ITableWindow)App.GetWindow(WindowType.Table, manager); if(tableWindow == null) { return; } tableWindow.Show();
Matthieu
28/11/2009
Reply
Re : Rapport Personnalisé
zebuloni
51 posts
Super ! merci
Zeb
© 2006-2014
Matthieu DUCROCQ
- All rights reserved - Last update: january 2014 |
|
Support Open Cellar
|
Contact
|
About