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
Additional reports
21/09/2007
Reply
Additional reports
Victor Bastos
24 posts
Firts of all, congratulations for this amazing app and thanks for making it available for the wine lovers community. My question is: is it possible for us to create our own customized reports? If so, how can this be done?
Regards
Victor
21/09/2007
Reply
Re : Additional reports
Administrateur
3099 posts
Thanks victor
Yes, you can personalize (or extend) the reports, but there is not wysiwyg editor.
All stuff must be developed.
Here's an example of code :
App.Animate(AnimationType.Work, true); App.SetCursor(true); // Report title string reportName = "Wines list"; // Columns header ReportTable rt = new ReportTable(reportName); // Area ReportColumn rcArea = rt.NewColumn("Area"); rcArea.Size = 100; // Appellation ReportColumn rcApp = rt.NewColumn("Appellation"); rcApp.Size = 140; // Classification ReportColumn rcCl = rt.NewColumn("Classification"); rcCl.Size = 100; // Name ReportColumn rcName = rt.NewColumn("Name"); rcName.Size = 215; // wine color ReportColumn rcColor = rt.NewColumn("Color"); rcColor.Size = 75; // Year ReportColumn rcYear = rt.NewColumn("Year"); rcYear.Size = 40; rcYear.ContentAlignment = ReportContentAlignment.Right; rcYear.DataType = ReportColumnType.Numeric; // Bottles ReportColumn rcBottles = rt.NewColumn("Bottles"); rcBottles.Size = 40; rcBottles.ContentAlignment = ReportContentAlignment.Right; rcBottles.DataType = ReportColumnType.Numeric; // Bottle (type) ReportColumn rcFormat = rt.NewColumn("Bottle"); rcFormat.Size = 70; // Create datasource ObjectCollection wines = App.ActiveCellar.GetCollection((ushort)ObjectType.Wine); for (int i = 0; i < wines.Count; i++) { Wine wine = (Wine)wines[i]; ReportRow row = rt.NewRow(); row[0] = wine.Area.Name; row[1] = wine.Appellation.Name; row[2] = wine.Classification.Name; row[3] = wine.Name; row[4] = "Champagne"; if(wine.WineColor == ColorType.Red) { row[4] = "Red"; } else if(wine.WineColor == ColorType.White) { row[4] = "White"; } else if(wine.WineColor == ColorType.Rosy) { row[4] = "Rosé"; } else if(wine.WineColor == ColorType.Yellow) { row[4] = "Champagne"; } else if(wine.WineColor == ColorType.LiqueurLike) { row[4] = "Liquoreux"; } else if(wine.WineColor == ColorType.Misc) { row[4] = "Misc"; } if(wine.Year != 0) { row[5] = wine.Year.ToString(); } // if(wine.ManualManagement) { row[6] = wine.Bottles.ToString(); } else { row[6] = wine.RackItems.Count.ToString(); } row[7] = wine.BottleType.Name; } // sort items rt.Sort("0-0;1-0;3-0;4-0;5-1"); // GoOo System.Collections.ArrayList list = new System.Collections.ArrayList(); list.Add(rt); IReport report = App.ReportEngine.GetSystemReport(PredefinedReport.Grid); string destFileName = App.Path + "Cache\\UserWinesGrid.pdf"; bool success = false; try { report.Create(list, destFileName); success = true; } catch(Exception ex) { MessageBox.Show("Error (1)"); } // Show report if(success) { IShellWindow shellWindow = (IShellWindow)App.GetWindow(WindowType.Shell, null); if(shellWindow != null) { shellWindow.Start(destFileName); } } App.SetCursor(false); App.StopAnimate();
To open script window --> On the "Preferences" menu, click "Script editor"
Matthieu
© 2006-2014
Matthieu DUCROCQ
- All rights reserved - Last update: january 2014 |
|
Support Open Cellar
|
Contact
|
About