Read text file no allow edits

Moderator: Rathinagiri

User avatar
RussBaker
Posts: 51
Joined: Wed Jul 22, 2015 9:44 am

Read text file no allow edits

Post by RussBaker »

This should be easy.

I normally use notepad to view my report .txt files. A client has people editing the reports before printing them.
Is there a way to create a notepad file "read only" program that will not allow edits or cut/paste?
And then print the contents?

I'm thinking of a simple HMG program, but certainly there must be something already out there.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Read text file no allow edits

Post by andyglezl »

At the bottom, there are post related to what you want, you just have to read ...

viewtopic.php?p=7569#p7569
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Read text file no allow edits

Post by dragancesu »

I had a similar problem, so I tried to solve

viewtopic.php?f=5&t=4456

only view and search text, then print
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Read text file no allow edits

Post by andyglezl »

No se el porque generar un txt, para luego buscar como imprimirlo,
pudiendo ser tan simple como crear el reporte con el ejemplo que esta en:
--------------------------------------------------------------------------------------------
I do not know why generate a txt, and then look like print,
can be as simple as creating the report, with the example is in:


\HMG\3.4\SAMPLES\Controls\ReportBasic\REPORT_BASIC_1


El archivo txt lo pueden abrir con cualquier otro programa de edicion
y seguir modificandolo.
---------------------------------------------------------------------------------
The txt file will be opened with any other editing program
and further editing.
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Read text file no allow edits

Post by esgici »

RussBaker wrote: Is there a way to create a notepad file "read only" program that will not allow edits or cut/paste?
"Preventing texts" is a multiple faces topic; within or outside the current application or OS; preventing from edit, and / or copy /cut + paste are different concepts.

TEXTBOX, EDITBOX and RICHEDITBOX have READONLY property; this should be enough for prevent text file to editing into HMG application.

FOR outside of HMG application may be usable settting "R" attribute to text file with ATTRIB command of OS. OS commands can be execute within HMG application via RUN command or their complements.

Preventing any text from copy / cut + paste is a different topic, time time I see within Internet browser, but sadly I don't know the method to do this :( If any one will explain, this will be useful for everyone.

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Read text file no allow edits

Post by dragancesu »

@andyglezl
I do not know why generate a txt, and then look like print,
can be as simple as creating the report, with the example is in:
Your suggestion is good but there are users that use dot matrix printers for example Epson LX300
User avatar
RussBaker
Posts: 51
Joined: Wed Jul 22, 2015 9:44 am

Re: Read text file no allow edits

Post by RussBaker »

Both code examples above are excellent. I like the searchable grid. Both will not allow cut/paste which is another benefit.
My application is viewing an employee hours worked file and users were editing their times (viewing it in notepad) before printing the report.

Now I need to be able to print to any Windows printer.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Read text file no allow edits

Post by andyglezl »

Hola dragancesu
No entiendo...Dejame adivinar.
Estas diciendo que por ser impresora de matriz,
no puedes sacar los reportes de la forma anterior ? (Ejemplo mencionado)
ó
Porque la impresión se torna lenta en forma gráfica ?
(se puede indicar que sean fuentes fijas en la impresora)
ó
?????

Puedes hacer la prueba con el "NotePad", abrir un documento pequeño
y enviarlo a impresión, así es como imprimirlo desde HMG.

------------------------------------------------------------------------------------------
Hello dragancesu
I do not understand...Let me guess.
You're saying that because matrix printer,
you can not take the reports of the previous form? (Mentioned Example)
or
For printing becomes slow graphically?
(you can tell they are fixed fonts to the printer)
or
?????

You can do the test with the "notepad" to open a small document
and send it to print, here's how to print from HMG.
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Read text file no allow edits

Post by dragancesu »

Of course, that everything can

Once the Clipper had trouble printing on a laser printer, today is a (maybe) problem printing on dot-matrix printer

Of course, windows that can be printed on dot-matrix printer, but I think it is more efficient to just send to the printer (copy to LPT)
Notepad is OK, but how to insert code for new page?

It can do, the only question is what to choose
I'm in Clipper programs formed text file, display and left the possibility to search and press, many times it is enough to look at and not wasting paper

it may seem strange, but this is simply to use the old Clipper printing programs
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Read text file no allow edits

Post by andyglezl »

Ok
Aqui les dejo una solución (de muchas) basada en el ejemplo de DO REPORT
------------------------------------------------------------------------------------------
OK
Here 'a solution (of many) based on the example of DO REPORT
DoReport2XPS.zip
(2.73 KiB) Downloaded 336 times

Step 2: Microsoft XPS Document Writer
Report2XPS.jpg
Report2XPS.jpg (358.74 KiB) Viewed 5524 times
Andrés González López
Desde Guadalajara, Jalisco. México.
Post Reply