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
        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;
            }
        }
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);
        }
 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. 6
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;
     }
 }