We have developed baan to pdf functionality using Java iText Class, Java class is executed through shell script which is called by 4GL baan script.
More information at
Following things are done presently :
Any baan report is converted into PDF, page size/Font is chosen automatically based on report size.
PDF is encrypted and only Print choice is enabled.
Company Logo and Custom footer with Date/Time Stamp and User details added.
Things not done :
Font effects of report not carried over since basically its a text to PDF converter. (How to get formatting details ? (report XML could help ???)
Is the code you developed open source? If it is please either post it to this forum or a link to some other location.
If it is not open source... I will move the announcement to a different forum.
Java Class based on i-Text
3 components are required
1. Baan 3GL to convert report to ASCII and invoke shell scripts
2. Java Class to convert text to pdf
3. Shell scripts to invoke java class
4. Device Definition
1. Baan 3GL - Hope copyright is OK
2. the java class tcd_text2pdf
3. Shell Scripts
a. text2pdf.sh in user home directory
4. Device Definition
Also need to define device called say PDF as follows
Device type: Rewrite File
4GL Program : tdtcdpdf
Argument : %s
Page Length : 72
I split the posting into two threads so that there is more visibility. You get the advantage of 4066 views to start with ;).
Sean C. Sullivan works for our company and there was Portland Java User Group meeting here in April.
Here is more info -
Portland Java User Group Meeting Info
The topic was - Generating reports with JasperReports and there is a ppt on the site for reference.
Generating reports with JasperReports
JasperReports is an open source Java reporting tool. In this presentation, we will discuss the Jasper engine API, Jasper XML report templates, and Jasper datasources. We'll also look at JasperAssistant, a visual report designer tool.
colors in PDF report
I have implemented your idea, and it just works great!!
Now I want to go one step further and color the report, any ideas??? I looked at iText library there seems to be the chunk java api which lets us specify the color for the paragraph? I am palnning to try that.
can't create file
Hi ahulikavi ,
I tried to implement your idea. but i am facing problem in it.
as per your instructions, i have copied all 4 components and now when i give print on the new device(PDF), it gives me error "File can't be created!!! 127"
actually in debugging i found that while existing command
ret = shell("text2pdf.sh" & sh.string,0) it returns 127 value to ret.
however, i tried to run text2pdf file on command prompt directly and it gives following error.
pdf.sh: CLASSPATH^M: this is not an identifier.
is java needed to be installed on the server. i have java1.4 installed on the server.
here is the code of pdf.sh which i modified.
java tcd_text2pdf $@
PeBSClasses.zip file is not available on the path =/app/baan4c4/bse/tcd_email/
actually this file doesn't exist. please advice why it is throwing 127 value in return.
pdf.sh is a script to ensure that classpath is set correctly, it needs to be modified based on your setup and where you placed the itext-1.03.jar file, please modify it accordingly. You can ignore other jars like PeBS..., these are not required for pdf.
create pdf.sh in a common directory accessible by all users, with owner bsp. For our setup this is /tcd_email in bse path, change it as required by you.
You will have to make same change in script...
seq.puts("cd your_directory_path_where_pdf.sh_is_present", fp)
Run the shell script directly and check if CLASSPATH is set.
As far as text2pdf.sh is concerned, ensure, that it has 777 permission.
Lets see if it works now ....
problem in converting to pdf
i have modified the pdf.sh and txt2pdf.sh shell scripts accordingly. but it still gives me error "file can not be created!!!127".
However, i tried to run the text2pdf.sh at shell itself in AIX.
it activates pdf.sh and gives me error "vaja not found'.
however in pdf.sh on line 3 i am calling
java text2pdf $@
in AIX at /usr/java14/jre/bin , i have the java components available. i have declared these paths in CLASSPATH in pdf.sh.
here are the codes for pdf.sh and text2pdf.sh.
CLASSPATH = /app/baan4c4/bse/tcd_email/itext-1.3.jar:/usr/java14/jre/bin
java tcd_text2pdf $@
please help as txt2pdf.sh is working fine but pdf.sh is not working fine.
however, need one more clarification.
there is a file tcd_text2pdf which is a java class should this file be with .class extension or not.
do all in converter !
attached is an converter i use.
The shell script is built in converter and handles the java classes.
So you only need this converter and nothing else.
Class not found
I have still not got the break-thru in implementation of this utility.
here is what i have done.
I created a new folder in $BSE with tcd_email name and placed text2pdf.sh,
pdf.sh, tcd_text2pdf class, i-text.jar and source code for i-text with all related class files in it.
I copied your script in baan and attached it with a device. now when i try to check the utility, i found that it is failing in conversion.
i have installed all source and related class files in the folder. but it gives error "file can't be created". it fails in execuing pdf.sh.
i checked it seprately on shell and found that while running tcd_text2pdf it gives error com/lowagie/text/ELEMENT java class not found.
however, i check the path and found that ELEment class is present in the folder.
any clue please. can you let me know some tip on it.
java classes dirs
is the CLASSPATH set to the lowagie dir ?
set the absolute path /..../bse/..../.... to this dir.
the subdir structure must be the lowagie structure :
|----com-----------|lowagie----|---bc++++++subdirs and files
| |---text+++++subdirs and files
I am facing the same problem as Veyant is facing i.e. 127. Bernad, I have used your script also but its giving the same error.
Sant, how do you do that. Can anyone explain. Its urgent.
Thanx in advance
seeking for help from your side
Only things I can think of are accuracy of
1. CLASSPATH ( Should also include required itext JAR's)
2. File Permissions (Execute permissions on script files and classes)
3. Directory permissions
4. path_names as defined in your system ( also adjust accordingly in JAVA, BaaN Program script and OS Script files)
Hope this resolves your problem, since it is working at other places.
|All times are GMT +2. The time now is 04:25.|
©2001-2017 - Baanboard.com - Baanforums.com