Inquiridor
Impressão em Aplicação Publicada - mvc

Pergunta
-
Bom dia a todos;
estou desenvolvendo um aplicação em mvc , básica faz inserção e imprimi um layout especifico daquela inserção.
Em tempo de desenvolvimento esta impressão funciona normalmente, mas apos publicar para testar o real funcionamento ele faz a inserção porem não imprime!!!
Alguma dica sobre o que tenho de fazer?
agradeço desde já.
- Editado D SOUZA quarta-feira, 5 de fevereiro de 2014 17:31
Todas as Respostas
-
-
Claro,
namespace Achados.Models
{
public class ImpressaoEntrada : Entrada
{
public void Imprimir()
{
PrintDocument iniciar = new PrintDocument();
iniciar.PrintPage += new PrintPageEventHandler(this.iniciar_PrintPage);
iniciar.Print();
}
private void iniciar_PrintPage(object sender, PrintPageEventArgs e)
{
//Layout de Impressão de Entrada
e.PageSettings.Color = true;
e.Graphics.DrawString("_______________________________________", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 01));
e.Graphics.DrawImage(Image.FromFile(@"C:\Users\danilo\Documents\Visual Studio 2012\Projects\AchadosPerdidosWeb\AchadosPerdidosWeb\correto.png"), new Point(01, 20));
e.Graphics.DrawString("Controle de entrada de Achados e Perdidos ", new Font("ArialBlack", 10, FontStyle.Bold), new SolidBrush(Color.Black), new Point(01, 85));
e.Graphics.DrawString("_______________________________________ ", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 66));
e.Graphics.DrawString("_______________________________________ ", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 91));
e.Graphics.DrawString("Código de Controle: ", new Font("ArialBlack", 10, FontStyle.Bold), new SolidBrush(Color.Black), new Point(01, 108));
e.Graphics.DrawString("" + EntradaId + "", new Font("Arial", 09, FontStyle.Bold), new SolidBrush(Color.Black), new Point(140, 108));
e.Graphics.DrawString("_______________________________________ ", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 114));
e.Graphics.DrawString(" Terminal : ", new Font("ArialBlack", 10, FontStyle.Bold), new SolidBrush(Color.Black), new Point(01, 132));
e.Graphics.DrawString("" + Terminal + "", new Font("Arial", 09), new SolidBrush(Color.Black), new Point(90, 132));
e.Graphics.DrawString("_______________________________________ ", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 132));
e.Graphics.DrawString(" São Paulo ", new Font("ArialBlack", 10, FontStyle.Bold), new SolidBrush(Color.Black), new Point(01, 147));
e.Graphics.DrawString(" " + HoraEntrada + "", new Font("Arial", 09), new SolidBrush(Color.Black), new Point(90, 147));
e.Graphics.DrawString("_______________________________________ ", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 149));
e.Graphics.DrawString("Entregue Por: ", new Font("ArialBlack", 10, FontStyle.Bold), new SolidBrush(Color.Black), new Point(01, 162));
e.Graphics.DrawString("" + NomeUsuario + "", new Font("Arial", 09), new SolidBrush(Color.Black), new Point(120, 162));
e.Graphics.DrawString("_______________________________________ ", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 165));
e.Graphics.DrawString("Recebido por: ", new Font("ArialBlack", 10, FontStyle.Bold), new SolidBrush(Color.Black), new Point(01, 178));
e.Graphics.DrawString("" + Receptor + "", new Font("Arial", 09), new SolidBrush(Color.Black), new Point(95, 178));
e.Graphics.DrawString("_______________________________________ ", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 181));
e.Graphics.DrawString("Descrição do Objeto Entregue: ", new Font("ArialBlack", 10, FontStyle.Bold), new SolidBrush(Color.Black), new Point(01, 200));
e.Graphics.DrawString(" " + DescricaoObjeto + "", new Font("Arial", 09), new SolidBrush(Color.Black), new Point(01, 220));
e.Graphics.DrawString("_______________________________________ ", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 470));
e.Graphics.DrawString(" Assinatura do Usuário ", new Font("Arial", 09, FontStyle.Bold), new SolidBrush(Color.Black), new Point(20, 489));
e.Graphics.DrawString("_____________________________________", new Font("Arial", 10), new SolidBrush(Color.Black), new Point(01, 542));
e.Graphics.DrawString(" Assinatura do Funcionário ", new Font("Arial", 09, FontStyle.Bold), new SolidBrush(Color.Black), new Point(20, 557));
}
}
}ele desenha um layout especifico com os dados que preciso imprimir.
Talvez tenha de transformá-lo em um web service !!!
-
-
-
-