Interesting pieces of code
Posted
#1
(In Topic #95)
Regular

CREATING EDITABLE DOCUMENTS FOR AN OFFICE
Problem: The office produces some huge reports using LibreOffice. To much text to type!
Solution: These reports are water sample analysis.
1) The lab feeds the results into a postgresql database.
2) When finished the work on the water sample by the lab, an office software alerts its user.
3) This software has a odt report template, which is copied to another directory for edition and uncompressed there.
4) All the data is in the content.xml file. So, we could use a script to edit some placeholders we have in our template. Here is an example:
Code
#!/bin/bash
cd "$1"
sed -i "s~$2~$3~" content.xmlCode
#!/bin/bash
ftp -n <<EOF
open ftp://IP
user name password
put $1
EOFOnce in the FTP server, the file is available to the customer.
Posted
Guru

Code
Public Sub Form_Open()
Dim sTemp As String = "This is a very badly spaced string"
Dim sCheck As String
Repeat
sCheck = sTemp
Print sTemp
sTemp = Replace(sTemp, " ", " ")
Until sCheck = sTemp
sTemp = Replace(sTemp, " is", " WAS")
Print "\n" & sTemp
End
Posted
Guru

Code
Public Sub Form_Open()
Dim sInputString As String[] = ["One ", "Three ", "Zero ", "Five", "Four ", "Two "]
Dim sOrder As Short[] = [2, 0, 5, 1, 4, 3]
Dim siCount As Short
For sicount = 0 To 5
Print sInputString[sOrder[siCount]];
Next
End
Posted
Regular

1 - Install cmdlnprint complement for firefox
From your code:
2 - Shell "firefox -print " & URL & " -print-mode pdf -print-file " & /file_path/file_name.pdf
A software I wrote creates a bank slip using php. The document is saved as pdf in order to be sent to the customer by email.
1 guest and 0 members have just viewed this.


