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
Script
31/12/2007
Reply
Script
sarpro
8 posts
Attention je me lance dans les scripts mais pour un non informaticien c'est pas evident...même après deux verre ou trois..;-).
Je souhaite adapter le script suivant et intégrer la cellule référence et boire de ..à...
Qui peux maider?
Merci d'avance
App.Animate(AnimationType.Work, true);
App.SetCursor(true);
//
// Modifiez ici le titre du report
//
string reportName = "Liste des vins WA";
//
// Creation entete report
//
ReportTable rt = new ReportTable(reportName);
//
// Région
//
ReportColumn rcArea = rt.NewColumn("Région");
rcArea.Size = 80;
//
// Appellation
//
ReportColumn rcApp = rt.NewColumn("Appellation");
rcApp.Size = 120;
//
// Nom
//
ReportColumn rcName = rt.NewColumn("Nom");
rcName.Size = 180;
//
// Classement
//
ReportColumn rcCl = rt.NewColumn("Classement");
rcCl.Size = 100;
//
// Couleur
//
ReportColumn rcColor = rt.NewColumn("Couleur");
rcColor.Size = 75;
//
// Année
//
ReportColumn rcYear = rt.NewColumn("Année");
rcYear.Size = 40;
rcYear.ContentAlignment = ReportContentAlignment.Right;
rcYear.DataType = ReportColumnType.Numeric;
//
// Nombre bouteilles
//
ReportColumn rcBottles = rt.NewColumn("Btles");
rcBottles.Size = 40;
rcBottles.ContentAlignment = ReportContentAlignment.Right;
rcBottles.DataType = ReportColumnType.Numeric;
//
// Format
//
ReportColumn rcFormat = rt.NewColumn("Format");
rcFormat.Size = 70;
//
// A boire de
//
ReportColumn rc????? = rt.NewColumn("A boire de");
rcFormat.Size = 70;
//
// A boire à
//
ReportColumn rc????? = rt.NewColumn("à");
rcFormat.Size = 70;
//
// Référence
//
ReportColumn rc????? = rt.NewColumn("Référence");
rcFormat.Size = 70;
//
// Alimentation de la source
//
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.Name;
row[3] = wine.Classification.Name;
row[4] = "Champagne";
if(wine.WineColor == ColorType.Red)
{
row[4] = "Rouge";
}
else if(wine.WineColor == ColorType.White)
{
row[4] = "Blanc";
}
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] = "Autre";
}
if(wine.Year != 0)
{
row[5] = wine.Year.ToString();
}
//
// Gestion manuelle
//
if(wine.ManualManagement)
{
row[6] = wine.Bottles.ToString();
}
else
{
row[6] = wine.RackItems.Count.ToString();
}
row[7] = wine.BottleType.Name;
}
row[8] = wine.??boire de
row[9] = wine.??boire à
row[10] = wine.??référence
//
// Tri des elements
//
rt.Sort("0-0;1-0;4-0;5-1");
//
// Génération
//
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("Erreur (1)");
}
//
// Affichage du report
//
if(success)
{
IShellWindow shellWindow = (IShellWindow)App.GetWindow(WindowType.Shell, null);
if(shellWindow != null)
{
shellWindow.Start(destFileName);
}
}
App.SetCursor(false);
App.StopAnimate();
31/12/2007
Reply
Re : Script
Administrateur
3099 posts
Vous etiez pas loin ;-)
La nouvelle du site apportera une aide dédiée au developpement sous OC (patience
)
App.Animate(AnimationType.Work, true); App.SetCursor(true); // // Modifiez ici le titre du report // string reportName = "Liste des vins WA"; // // Creation entete report // ReportTable rt = new ReportTable(reportName); // // Région // ReportColumn rcArea = rt.NewColumn("Région"); rcArea.Size = 80; // // Appellation // ReportColumn rcApp = rt.NewColumn("Appellation"); rcApp.Size = 100; // // Nom // ReportColumn rcName = rt.NewColumn("Nom"); rcName.Size = 180; // // Classement // ReportColumn rcCl = rt.NewColumn("Classement"); rcCl.Size = 100; // // Couleur // ReportColumn rcColor = rt.NewColumn("Couleur"); rcColor.Size = 75; // // Année // ReportColumn rcYear = rt.NewColumn("Année"); rcYear.Size = 40; rcYear.ContentAlignment = ReportContentAlignment.Right; rcYear.DataType = ReportColumnType.Numeric; // // Nombre bouteilles // ReportColumn rcBottles = rt.NewColumn("Btles"); rcBottles.Size = 20; rcBottles.ContentAlignment = ReportContentAlignment.Right; rcBottles.DataType = ReportColumnType.Numeric; // // Format // ReportColumn rcFormat = rt.NewColumn("Format"); rcFormat.Size = 50; // // A boire de // ReportColumn rcConsumeMin = rt.NewColumn("A boire de"); rcConsumeMin.Size = 40; // // A boire à // ReportColumn rcConsumeMax = rt.NewColumn("à"); rcConsumeMax.Size = 40; // // Référence // ReportColumn rcRef = rt.NewColumn("Référence"); rcRef.Size = 70; // // Alimentation de la source // 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.Name; row[3] = wine.Classification.Name; row[4] = "Champagne"; if(wine.WineColor == ColorType.Red) { row[4] = "Rouge"; } else if(wine.WineColor == ColorType.White) { row[4] = "Blanc"; } 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] = "Autre"; } if(wine.Year != 0) { row[5] = wine.Year.ToString(); } // // Gestion manuelle // if(wine.ManualManagement) { row[6] = wine.Bottles.ToString(); } else { row[6] = wine.RackItems.Count.ToString(); } row[7] = wine.BottleType.Name; row[8] = wine.ConsumeMin.ToString(); row[9] = wine.ConsumeMax.ToString(); row[10] = wine.Reference; } // // Tri des elements // rt.Sort("0-0;1-0;4-0;5-1"); // // Génération // 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("Erreur (1)"); } // // Affichage du report // if(success) { IShellWindow shellWindow = (IShellWindow)App.GetWindow(WindowType.Shell, null); if(shellWindow != null) { shellWindow.Start(destFileName); } } App.SetCursor(false); App.StopAnimate();
Matthieu
31/12/2007
Reply
Re : Script
sarpro
8 posts
excélent merci beaucoup. Passez un bon réveillon. Denis
© 2006-2014
Matthieu DUCROCQ
- All rights reserved - Last update: january 2014 |
|
Support Open Cellar
|
Contact
|
About