Read text file no allow edits

Moderator: Rathinagiri

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

Read text file no allow edits

Post by RussBaker » Tue Sep 08, 2015 11:30 pm

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: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

Post by andyglezl » Wed Sep 09, 2015 1:48 am

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: 700
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 23 times
Been thanked: 149 times

Post by dragancesu » Wed Sep 09, 2015 9:58 am

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: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

Post by andyglezl » Wed Sep 09, 2015 1:51 pm

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: 4516
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 389 times
Been thanked: 111 times
Contact:

Post by esgici » Wed Sep 09, 2015 2:52 pm

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: 700
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 23 times
Been thanked: 149 times

Post by dragancesu » Wed Sep 09, 2015 4:05 pm

@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: 49
Joined: Wed Jul 22, 2015 9:44 am

Post by RussBaker » Wed Sep 09, 2015 7:44 pm

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: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

Post by andyglezl » Wed Sep 09, 2015 7:56 pm

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: 700
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 23 times
Been thanked: 149 times

Post by dragancesu » Wed Sep 09, 2015 10:15 pm

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: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

Post by andyglezl » Thu Sep 10, 2015 1:25 am

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 128 times

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

Post Reply