Suivez et participez au développement du nouvel OpenCellar : PLOC.co
Home Page
 
Français  English  
Open Cellar Home Edition - 1.2 - Windows 98, Me, 2000, XP and Vista. The free Windows wine cellar management software. Open Cellar Mobile Edition - Beta 2 (French version) - Pocket PC. The free Pocket PC wine cellar management software. Open Cellar Cross Platform - Beta 1 (French version) - Mac OSX and Linux. The free MacOS/Linux wine cellar management software. My Open Cellar Open Cellar Forums Place des vins
Search: Welcome (connect - create an account )
Nuage de tags
Rapport - Livre de cave
18/04/2006
Reply
Rapport - Livre de cave
AdministrateurView your blog
3099 posts
// Envoi l'animation
App.Animate(AnimationType.Work, true);
// Affiche le curseur d'attente
App.SetCursor(true);

ArrayList wines = new ArrayList();
OpenCellar.Framework.Core.ObjectCollection winesCol = App.ActiveCellar.GetCollection((ushort)OpenCellar.Framework.Core.ObjectType.Wine);

// Alimente la source de données du report
for (int i = 0; i < winesCol.Count; i++)
{
wines.Add(winesCol[i]);
}

if(wines.Count > 0)
{
// Recupere une reference vers le report
IReport report = App.ReportEngine.GetSystemReport(PredefinedReport.WineCellarBook);
if(report != null)
{
string destFileName = App.Path + "Cache\\ListeDesVins.pdf";
bool success = false;
try
{
report.Create(wines, destFileName);
success = true;
}
catch(Exception ex)
{
MessageBox.Show("Erreur");
}
// Rapport généré
if(success)
{
// On lance le fichier généré
IShellWindow shellWindow = (IShellWindow)App.GetWindow(WindowType.Shell, null);
if(shellWindow != null)
{
shellWindow.Start(destFileName);
}
}
}
}

App.SetCursor(false);
App.StopAnimate();
 

© 2006-2014 Matthieu DUCROCQ  Open Cellar official blog - All rights reserved - Last update: january 2014 | twitter