BirgitCuya
27th September 2006, 19:20
En algunas ordenes de compra las especificaciones tecnicas para los articulos (las cuales las colocamos en el campo texto de la linea de orden de compra) son demasiado grandes. Por lo que tengo problemas para controlar los textos en los formatos.
Estoy intentando guardar el texto en variables, pero no se como identificar el INTRO o ENTER, quiero guardar en cada variable una linea de texto. Cuando intente guardarlo con un ancho fijo me mostraba el INTRO como \n pero al intentar validarlo no es ese el valor.
Les agradeceria sus sugerencias,
Birgit Cuya
bcuya@yahoo.com
patvdv
27th September 2006, 22:02
Moved to spanish forum!
Felipe_Saavedra
28th September 2006, 00:07
Hola creo que no me quedo clara tu pregunta, en un campo de texto Baan tu puedes escribir un libro si quieres, por lo cual tus especificaciones deberian de poder ser impresas o desplegadas.
Otra alternativa es que dentro del report script leeas el texto y lo pases a un archivo ascii y despues del archivo ascii lo puedas colocar en los espacios que deseas.
Si me puedes dar un poco mas de informacion con gusto te aydo a resolver este problema.
saludos
Felipe Saavedra
BirgitCuya
23rd October 2006, 19:32
Gracias por contestar. En realidad son dos problemas de texto que tengo.
Te doy un ejemplo del texto para explicarlo mejor:
Calcio silicio Composicion quimica: CA:28% Min; Si 60% min, tamano de 0 a 2 mm 95% min over 2.36mm 5% max.
De acuerdo a las condiciones de contrato:90838
1.- El ancho de caracteres por linea es de 80, pero necesito imprimir en la Nota de almacenamiento un ancho max de 50 caracteres cuando le doy el ancho me imprime los 50 primeros caracteres de cada linea y los demas no aparecen
2.- Si el texto fuera muy largo, es decir por ejemplo de 20 lineas y el espacio que tengo para imprimir de 8 lineas no me respeta el margen e imprime hasta el borde de la hoja.
Por eso pensaba en guardar el texto en variables correlativas cada 50 caracteres por ejemplo, y asi poder controlar la impresion de los textos pero no puedo hacerlo porque no se distinguir en SALTO de PAGINA.
El numero 50 es un numero de ejemplo, porque tengo diferentes documentos con diferentes medidas.
Gracias por la ayuda
Felipe_Saavedra
31st October 2006, 00:30
Hola,
Yo usaria la funcion
long text.to.buf( string text_field(17), string lang, long nr_lines, ref string buf(,) [, long rtf.text] )
Esta funcion la puedes utilizar en tu report script en el area de before.layout del text field.
Entonces tendrias el texto en el buffer y de ahi podrias popular parcialmente el texto a tu antojo en los campos que requieras.
otra funcion seria la de text.read pero esta guarda el texto en un archivo y luego tendrias que leer este archivo y popular tus variables.
Yo he usado bastante al de text.write para poblar texto de archivos a Baan, aqui esta un poco del codigo, falta la dll tfacrdll8000 para mandar el mensaje especifico en caso de error en el archivo ASCII, si la requires te la mando.
|******************************************************************************
|* tfacrdll8001 0 VRC B40O b2 Oct
|* crate Text in Baan from a Table
|* Felipe Saavedra
|* 22 Jan 2003
|******************************************************************************
|* Script Type: Library
|******************************************************************************
#include <bic_tt>
function extern domain tcbool tfacrdll8001.populate.temptextfile(domain tcmcs.s240 tline1,
domain tcmcs.s240 tline2,
domain tcmcs.s240 tline3,
domain tcmcs.s240 tline4,
domain tcmcs.s240 tline5)
{
|* Felipe Saavedra, 22 Jan 2003
|* Up to 4 lines of 240 character each can be created with this program, the
|* lines are created in the file temptextfile under the user directory then the text
|* records are created from this files
extern domain tcmcs.str90 the.path
extern domain tcmcs.str90 file.name
extern domain tcmcs.long tfp, text.lines, err.check
tfp = 0
text.lines = 0
the.path = getcwd( )
the.path = the.path & "/"
file.name = the.path & "temptextfile"
|Open the file in write mode, this procedure will write up to 4 lines
tfp = seq.open( strip$(file.name), "w")
if tfp < 1 then
message("error in file - " & file.name)
tfacrdll8000.open.file.check.error(tfp, tcyesno.yes)
return(false)
endif
|Put the records in the file
if not isspace(tline1) then
err.check = seq.puts(tline1,tfp)
if err.check < 0 then
message("Error writing first text in temptextfile ")
tfacrdll8000.open.file.check.error(tfp, tcyesno.yes)
return(false)
else
text.lines = 1
endif
endif
if not isspace(tline2) then
err.check = seq.puts(tline2,tfp)
if err.check < 0 then
message("Error writing second text in temptextfile ")
tfacrdll8000.open.file.check.error(tfp, tcyesno.yes)
return(false)
else
text.lines = text.lines + 1
endif
endif
if not isspace(tline3) then
err.check = seq.puts(tline3,tfp)
if err.check < 0 then
message("Error writing third text in temptextfile ")
tfacrdll8000.open.file.check.error(tfp, tcyesno.yes)
return(false)
else
text.lines = text.lines + 1
endif
endif
if not isspace(tline4) then
err.check = seq.puts(tline4,tfp)
if err.check < 0 then
message("Error writing four text in temptextfile ")
tfacrdll8000.open.file.check.error(tfp, tcyesno.yes)
return(false)
else
text.lines = text.lines + 1
endif
endif
if not isspace(tline5) then
err.check = seq.puts(tline5,tfp)
if err.check < 0 then
message("Error writing five text in temptextfile ")
tfacrdll8000.open.file.check.error(tfp, tcyesno.yes)
return(false)
else
text.lines = text.lines + 1
endif
endif
|Close the file
if tfp >= 1 then
err.check = seq.close(tfp)
if err.check = 0 then
tfp = 0
else
message("error closing file " & str$(tfp) & " temptextfile ")
return(false)
endif
endif
if text.lines >= 1 then
return(true)
endif
return(false)
}
function extern domain tcbool tfacrdll8001.create.text.from.file(domain tcmcs.str17 text_field,
domain tcmcs.str17 kw1,
domain tcmcs.str17 kw2,
domain tcmcs.str17 kw3,
domain tcmcs.str17 kw4)
{
|* Felipe Saavedra, 22 Jan 2003
|* text_field The name of the new text field. This returns the text number for the new field.
|* kw1 to kw4 Use these arguments to specify key words for the text.
|* create.text Number of lines of text created
#include <bic_text>
extern domain tcmcs.long err.text
err.text = text.write(text_field, language$(1), kw1, kw2, kw3, kw4, "text", "text", "temptextfile")
if err.text > 0 then
return(true)
endif
return(false)
}
BirgitCuya
1st November 2006, 00:17
Gracias, intentare con esta funcion. :cool:
jftello
1st November 2006, 17:04
Otra forma es crear un "Window Text", session tttxt1120m000", de 50 caracteres de ancho, crear un "Text group" y despues asignar en la session "Maintain default text group by text table field", tttxt1112m000, el campo que quieres que sea de 50 caracteres maximo.
Con esta solucion, Baan siempre abrirá una ventana de ese tamaño y no tendrias que modificar reportes, etc.
BirgitCuya
3rd November 2006, 00:03
Gracias lo acabo de hacer y esto soluciona la mitad de mi problema, con la mezcla de ambas sugerencias creo que los listados estaran ok.