Esempio n. 1
0
        void PrintPDF <T>(string filename, string printer, bool orientation, bool IsCreationOnly, List <T> ListeFacture) where T : new ()
        {
            try
            {
                PrinterSettings  ps         = new PrinterSettings();
                ImpressionDirect impression = new ImpressionDirect();


                // convertir les fichiers de rapport en format pdf
                if (IsCreationOnly)
                {
                    impression.Run(report, orientation, p.Server.MapPath("~") + @"PDF", filename, true);
                }
                else
                {
                    if (string.IsNullOrEmpty(printer))
                    {
                        printer = ps.PrinterName;
                    }
                    // imprimer les fichiers de rapport en fonction de l'orientation
                    impression.Run(report, orientation, printer);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 void PrintPDF(string printername, bool orientation)
 {
     try
     {
         PrinterSettings ps      = new PrinterSettings();
         string          printer = string.Empty;
         if (!string.IsNullOrEmpty(printername))
         {
             printer = printername;
         }
         else
         {
             printer = ps.PrinterName;
         }
         ImpressionDirect impression = new ImpressionDirect();
         impression.Run(localReport, orientation, printer);
     }
     catch (Exception)
     {
         //throw;
     }
     finally
     {
         Page.ClientScript.RegisterClientScriptBlock(GetType(), "close", "window.close()", true);
     }
 }
Esempio n. 3
0
        public string CreatePDFChemin(string filename, string cheminFacture, bool orientation, string rdlc, string modulename, string key)
        {
            param = new Dictionary <string, string>();
            RenderReport(rdlc, modulename, key);
            PrinterSettings  ps         = new PrinterSettings();
            ImpressionDirect impression = new ImpressionDirect();

            impression.RunCreationPDF(report, orientation, cheminFacture, filename, true);

            // On retourne le chemin du fichier pdf
            return(cheminFacture);
        }
Esempio n. 4
0
        string CreatePDF(string filename, string printer, bool orientation)
        {
            PrinterSettings  ps         = new PrinterSettings();
            ImpressionDirect impression = new ImpressionDirect();
            // convertir les fichiers de rapport en format pdf
            string cheminFacture = p.Server.MapPath("~") + @"PDF\\" + filename + ".PDF";

            impression.Run(report, orientation, p.Server.MapPath("~") + @"PDF", filename, true);

            // On retourne le chemin du fichier pdf
            return(cheminFacture);
        }
Esempio n. 5
0
 void PrintToCashier(string printer, string port, string machine)
 {
     try
     {
         PrinterSettings  ps         = new PrinterSettings();
         ImpressionDirect impression = new ImpressionDirect();
         impression.RunToCashierPrinter(report, printer, port, machine);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 6
0
        public string ExportChemin(string filename, string cheminFacture, bool orientation, string rdlc, string modulename, string key, string format)
        {
            PrintingsServiceClient printErrosr = new PrintingsServiceClient(new Utilitys().Protocole(), new Utilitys().EndPoint());

            param = new Dictionary <string, string>();
            RenderReport(rdlc, modulename, key);
            PrinterSettings  ps         = new PrinterSettings();
            ImpressionDirect impression = new ImpressionDirect();

            printErrosr.SetErrorsFromSilverlightWebPrinting(GetCurrentMethod(), "Debut RunExportFile");
            impression.RunExportFile(report, orientation, cheminFacture, filename, true, format);
            printErrosr.SetErrorsFromSilverlightWebPrinting(GetCurrentMethod(), "Fin RunExportFile");

            // On retourne le chemin du fichier pdf
            return(cheminFacture);
        }
Esempio n. 7
0
        void PrintPDF(string filename, bool orientation)
        {
            try
            {
                PrinterSettings  ps         = new PrinterSettings();
                ImpressionDirect impression = new ImpressionDirect();
                impression.Run(report, orientation, p.Server.MapPath("~") + @"PDF", filename, true);

                impression.Run(report, orientation, p.Server.MapPath("~") + @"PDF", filename, true);
                impression.Run(report, orientation, ps.PrinterName);
            }
            catch (Exception ex)
            {
                PrintingsServiceClient printError = new PrintingsServiceClient(Protocole(), EndPoint());
                printError.SetErrorsFromSilverlightWebPrinting(GetCurrentMethod(), ex.Message);
                throw ex;
            }
        }
 void CreatePDF(string filename, bool val)
 {
     try
     {
         PrinterSettings  ps         = new PrinterSettings();
         ImpressionDirect impression = new ImpressionDirect();
         string           filePath   = Server.MapPath("~") + @"PDF";
         impression.Run(localReport, val, filePath, filename, val);
     }
     catch (Exception)
     {
         //throw;
     }
     finally
     {
         Page.ClientScript.RegisterClientScriptBlock(GetType(), "close", "window.close()", true);
     }
 }
Esempio n. 9
0
 /// <summary>
 /// lance l'impresssion ou la creation du rendu du rapport
 /// seleon l'orientation est en portrait ou paysage
 /// </summary>
 /// <param name="filename">nom du fichier a créé ou a imprimé</param>
 /// <param name="orientation">détermine la position du rapport ( paysage ou portrait)</param>
 void PrintPDF(string filename, string printer, bool orientation)
 {
     try
     {
         PrinterSettings  ps         = new PrinterSettings();
         ImpressionDirect impression = new ImpressionDirect();
         // convertir les fichiers de rapport en format pdf
         //impression.Run(report, orientation, p.Server.MapPath("~") + @"PDF", filename, true);
         if (string.IsNullOrEmpty(printer))
         {
             printer = ps.PrinterName;
         }
         // imprimer les fichiers de rapport en fonction de l'orientation
         impression.Run(report, orientation, printer);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }