Problema con Excel
Publicado por Abner Alejandro Moreno Mayorga (1 intervención) el 27/07/2006 23:37:47
Hola, me gustaría que alguien resolviera este problema, es al utilizar el ptrintpreview en un reporte de excel de la siguiente manera
/* Crear un nuevo objeto de aplicacion para EXCEL */
CREATE "Excel.Application" chExcelApplication.
/*Abre un archivo de excel */
ASSIGN chWorkbook = chExcelApplication:Workbooks:OPEN(vlc-RutaFormato).
ASSIGN chExcelApplication:VISIBLE = TRUE
chWorkSheet = chExcelApplication:Sheets:Item(1).
/* Pone margen de 1 a cada lado de la hoja*/
ASSIGN chWorkSheet:PageSetup:BottomMargin = 28
chWorkSheet:PageSetup:TopMargin = 28
chWorkSheet:PageSetup:RightMargin = 28
chWorkSheet:PageSetup:LeftMargin = 28.
/* PROCEDIMIENTOS */
/* RUN PrcHojas. */
RUN PrcDependencia.
RUN PrcEncabezado.
RUN PrcDetalle.
RUN PrcFirmas.
/* Vista Previa de la Hoja */
/* chWorkbook:PrintOut(). */
ASSIGN chExcelApplication:VISIBLE = TRUE.
chExcelApplication:sheets:printpreview().
/* Protección del documento */
/*chWorkSheet:Protect('clave'). */
chWorkbook:CLOSE(FALSE).
chExcelApplication:Visible = FALSE.
/* Liberación de apuntadores(com-handles) */
/* Liberación de apuntadores(com-handles) */
RELEASE OBJECT chWorksheet.
RELEASE OBJECT chWorkbook.
RELEASE OBJECT chExcelApplication.
Con chExcelApplication:sheets:printpreview().pretendo visualizar todas las hojas del libro, no había tenido conflictos con ellos hasta que utilicé una plantilla de excel de tamaño oficio al momento de hacer el printpreview marca un error del metodo printpreview de la clase sheets
Éspero alguna ayuda
Saludos
/* Crear un nuevo objeto de aplicacion para EXCEL */
CREATE "Excel.Application" chExcelApplication.
/*Abre un archivo de excel */
ASSIGN chWorkbook = chExcelApplication:Workbooks:OPEN(vlc-RutaFormato).
ASSIGN chExcelApplication:VISIBLE = TRUE
chWorkSheet = chExcelApplication:Sheets:Item(1).
/* Pone margen de 1 a cada lado de la hoja*/
ASSIGN chWorkSheet:PageSetup:BottomMargin = 28
chWorkSheet:PageSetup:TopMargin = 28
chWorkSheet:PageSetup:RightMargin = 28
chWorkSheet:PageSetup:LeftMargin = 28.
/* PROCEDIMIENTOS */
/* RUN PrcHojas. */
RUN PrcDependencia.
RUN PrcEncabezado.
RUN PrcDetalle.
RUN PrcFirmas.
/* Vista Previa de la Hoja */
/* chWorkbook:PrintOut(). */
ASSIGN chExcelApplication:VISIBLE = TRUE.
chExcelApplication:sheets:printpreview().
/* Protección del documento */
/*chWorkSheet:Protect('clave'). */
chWorkbook:CLOSE(FALSE).
chExcelApplication:Visible = FALSE.
/* Liberación de apuntadores(com-handles) */
/* Liberación de apuntadores(com-handles) */
RELEASE OBJECT chWorksheet.
RELEASE OBJECT chWorkbook.
RELEASE OBJECT chExcelApplication.
Con chExcelApplication:sheets:printpreview().pretendo visualizar todas las hojas del libro, no había tenido conflictos con ellos hasta que utilicé una plantilla de excel de tamaño oficio al momento de hacer el printpreview marca un error del metodo printpreview de la clase sheets
Éspero alguna ayuda
Saludos
Valora esta pregunta


0