![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
problemas con FastReport
Hola a tod@s.
Uso FastReport en mi aplicación y hay ocasiones en la cuales me pasa lo siguiente: Tengo un formato de etiqueta que se imprime en una impresora Eltron, que esta conectada a un servidor de impresion (no a un ordenador fisico, sino a una IP), y en ocasiones me cambia el formato del papel saliendo mal las impresión. Lo curioso es que si apago la impresora y la vuelvo a encender ya salen bien. He creado dos combos, uno con las impresoras y otro con los formatos de papel, ademas un campo para indicar el numero de copias. Alguien a tenido el mismo problema? Les pego el codigo que uso, asi de paso a alguien le puede servir algo: private { Private declarations } aFormato:array of integer; procedure Accion(nAccion:integer); public { Public declarations } end; var FLstEtiquetas: TFLstEtiquetas; FImprimir: TFLstEtiquetas; nEmpresaLocal,nEjercicioLocal,nCanalLocal:integer; cSerieLocal,cTipoDocLocal,cTituloLocal:string; nDesde,nHasta: integer; function ImprimirEtiquetas(padre:TComponent):boolean; implementation uses FR_Prntr,UDMMain, UvGlobales, UFormGest, UFBuscar, UVarios, UUtiles, UDMCargas, UDMLstPal; {$R *.dfm} function ImprimirEtiquetas(padre:TComponent):boolean; begin FImprimir := TFLstEtiquetas.Create(padre); FImprimir.ShowModal; Result := True; end; procedure TFLstEtiquetas.FormCreate(Sender: TObject); var n:integer; begin // rellenamos el ComboBox de impresoras CBImpresora.Items := printer.Printers ; CBImpresora.ItemIndex := 0; SetLength(aFormato,Prn.PaperNames.Count); for n := 0 to Prn.PaperNames.Count - 1 do begin // Añadimos los formatos CBFormato.Items.Add(Prn.PaperNames.Strings[n]); // indice del formato dentro de windows aFormato[n] := Prn.PaperSizes[n]; if AnsiUpperCase(Prn.PaperNames.Strings[n]) = AnsiUpperCase('Etiqueta Embalaje 10 x 6.5') then begin CBFormato.ItemIndex := n; end; end; // buscamos la impresora por defecto for n := 0 to CBImpresora.Items.Count - 1 do begin if CBImpresora.Items.Strings[n] = 'Eltron TigerWriter 4' then CBImpresora.ItemIndex := n; end; end; procedure TFLstEtiquetas.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; end; procedure TFLstEtiquetas.BitBtn2Click(Sender: TObject); begin Close; end; procedure TFLstEtiquetas.Accion(nAccion:integer); var cListado,cSQL:string; nCopia, n:integer; begin with DMCargas do begin PanelEst.Color := clYellow; PanelEst.Font.Color := clBlack; PanelEst.Caption := 'Imprimiendo'; QDocCargas.First; QDocCargas.DisableControls; AbreData( TDMLstPal, DMLstPal ); with DMLstPal do begin frEtiquetas.LoadFromFile(cDirApp+'\Listados\Logistica\Etiquetas_Bultos.frf'); frEtiquetas.Pages.Pages[0].pgSize := aFormato[CBFormato.ItemIndex]; //nFormato; frEtiquetas.DefaultCopies := nCopia; frEtiquetas.ChangePrinter(printer.PrinterIndex,CBImpresora.ItemIndex); frEtiquetas.PrepareReport; end; while not QDocCargas.Eof do begin if ((QDocCargasALBARAN.Value > 0) and (QDocCargasMARCA.Value = 1)) and (QDocCargasBULTOS.Value > 0) then DMLstPal.ImprimeEtiquetaBulto(QDocCargasEMPRESA.Value, QDocCargasEJERCICIO.Value, QDocCargasCANAL.Value, QDocCargasNUMERO.Value, QDocCargasALBARAN.Value, nAccion, QDocCargasSERIE_ALBARAN.Value); QDocCargas.Next; end; CierraData( DMLstPal ); QDocCargas.First; QDocCargas.EnableControls; PanelEst.Color := clSilver; PanelEst.Font.Color := clBlack; PanelEst.Caption := 'Espera'; end; end; procedure TFLstEtiquetas.TBImprimirClick(Sender: TObject); begin Accion(2) end; procedure TFLstEtiquetas.TBSalirClick(Sender: TObject); begin Close; end; procedure TFLstEtiquetas.TBDisenoClick(Sender: TObject); begin if ValidaAccesoProceso(-10) then Accion(3) else Aviso('ACCESO NO AUTORIZADO','',1,false); end; procedure TFLstEtiquetas.TBVisualizarClick(Sender: TObject); begin Accion(1) end; end. Un saludo. |
|
|
![]() |
|