Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 25th February 2004, 05:05
ahulikavi's Avatar
ahulikavi ahulikavi is offline
Member
 
Join Date: Jan 2002
Location: Pune, India
Posts: 81
ahulikavi is on a distinguished road
Baan: BaaN IVc4 - DB: Oracle 8.x, mySQL - OS: Sun Solaris 2.6, RH 7.2
Lightbulb Another Option

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
http://www.lowagie.com/iText/

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 ???)
__________________


Akshay
Reply With Quote
  #2  
Old 25th February 2004, 05:36
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
Akshay,

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.
__________________
~Vamsi
Vamsi Potluru
Baan XL Yet another tool to format Baan output in Excel from Baan Board
This one just happens to be free :)

Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 25th February 2004, 07:14
ahulikavi's Avatar
ahulikavi ahulikavi is offline
Member
 
Join Date: Jan 2002
Location: Pune, India
Posts: 81
ahulikavi is on a distinguished road
Baan: BaaN IVc4 - DB: Oracle 8.x, mySQL - OS: Sun Solaris 2.6, RH 7.2
Java Class based on i-Text

Hi,

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

Code:
||******************************************************************************
|* tdtcdpdf	0  VRC B40C L ive		
|* Title	: PDF
|* Author	: Akshay Hulikavi
|* Date		: 2004-02-09 [09:17]
|******************************************************************************
|* License	:
|* Copyright 2004 by Akshay Hulikavi
|* 
|* All Rights Reserved 
|* 
|* Permission to use, copy, modify, and distribute this software and its
|* documentation for any purpose and without fee is hereby granted,
|* provided that the above copyright notice appear in all copies and that
|* both that copyright notice and this permission notice appear in
|* supporting documentation. 
|* 
|* Akshay Hulikavi DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|* AND FITNESS, IN NO EVENT SHALL Akshay Hulikavi BE LIABLE FOR ANY
|* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
|* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 
|* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|* OR PERFORMANCE OF THIS SOFTWARE.
|******************************************************************************
	#pragma used dll ottdllbw
	
	long		ret, fp, zoomed	| general return variable
	extern	domain	tcmcs.str215	input.file, pdf.file, local.file	| input file - created by Baan
	extern	domain	tcmcs.str215	argument, argu1, argu4, argu0, argu2, argu3
	extern	domain	tcmcs.str215	argu5, argu6, argu7, argu8, argu9
	extern string	sh.string(1024), file.path(128), date.str(8), time.str(5), dat(12)

function main()
{
 	argu0 = argv$(0)
 	argu1 = argv$(1)
 	argu2 = argv$(2)
 	argu3 = argv$(3)
	argu4 = argv$(4)
	zoomed = false

	dat = dte$()
	date.str = dat(3;2) & "/" & dat(1;2)& "/" & dat(5;2)
	time.str = dat(7;2) & ":" & dat(9;2)
	
	if argu1 = "" and argu2= "" then	| Called from another program not spooler
	    import("argu1", argu1)
	    import("argu2", argu2)
	    import("argu3", argu3)
	    import("argu4", argu4)
	    zoomed = true
	endif    
	    
	file.path = getcwd()
 	input.file = shiftl$(strip$(argu2))
	ret = wait.and.activate("ttstpconv", argu1, input.file, "ASCII", "wt")


	input.file = shiftl$(strip$(file.path))&"/"&shiftl$(strip$(input.file))
	pdf.file = input.file&".pdf"
	local.file = "c:\"&shiftl$(strip$(argu2))&".pdf"

	sh.string = ""
	sh.string = sh.string &" "&chr$(34)&input.file&chr$(34)
	sh.string = sh.string &" "&chr$(34)&pdf.file&chr$(34)
	sh.string = sh.string &" "&str$(spool.pg.length)
	sh.string = sh.string &" "&chr$(34)&logname$&" on "& date.str & " at "& time.str& chr$(34)

	fp=seq.open("text2pdf.sh","r")	
	if fp >= 1 then | text2pdf.sh file exists
		ret = shell( "text2pdf.sh " & sh.string,0)
	else	
		fp=seq.open("text2pdf.sh","wt")	
		seq.puts("cd /baanIVc/c4/bse/tcd_email", fp)
		seq.puts("pdf.sh $@", fp)
		seq.close(fp)
		ret = shell( "chmod 777 text2pdf.sh",0)
		ret = shell( "text2pdf.sh " & sh.string,0)
	endif	

	if ret = 0 then
		if zoomed = false then	| Called from another program not report
			ret =  server2client(pdf.file,local.file,  0, 0)  | Binary Mode Transfer
			if ret = 0 then
				ret =  app_start(local.file,"","","","")
				ret = seq.unlink(input.file)
				ret = seq.unlink(pdf.file)
			else	
				message("File could sent to client !!!!" & str$(ret)&local.file)
			endif	
		endif	
	else
		message("File could not be created !!!!" & str$(ret))
	endif	

}
|*********************************** end of script ****************************



2. the java class tcd_text2pdf
Code:
/*
Class to convert baan ascii report to pdf
Author : Akshay Hulikavi
Date    : 10.02.2004

Requires : itext-x.jar - can be downloaded from <a href="http://www.lowagie.com/iText/" target="_blank">www.lowagie.com/iText/</a>
Source can be downloaded from <a href="http://www.lowagie.com/iText/" target="_blank">www.lowagie.com/iText/</a>

Usage : java tcd_text2pdf  <inputfile> <outputfile.pdf> <PageLength, Default = 60>

*/
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import java.io.*;

public class tcd_text2pdf 
{

public static void main(String[] args)
         throws IOException, DocumentException
	{
	String resultStr = "", line=null, strFooter; 
	int lncnt=1, i, j, pgcnt=0, fntSize=8, lineSpacing, strLength=0;	

	//~ i = Integer.parseInt(args[2]);
	j = Integer.valueOf(args[2]).intValue();
		if (j <= 0)
			j = 60;  // Default page length

		if(args.length < 2 ) {
			System.out.println("Usage : java tcd_text2pdf  <inputfile> <outputfile.pdf> <PageLength, Default = 60>"); 
			return;	
		}	
	
	Reader in = new InputStreamReader(new FileInputStream(args[0]));
	OutputStream os = new FileOutputStream(args[1]);
	Document doc= new Document();
	Image t_logo = Image.getInstance("logocolor.jpg");
	t_logo.scalePercent(75);  // scale image to 75%
	java.io.BufferedReader  br2  = new java.io.BufferedReader(in);   

	// get length of the longest line 	
		try { 
		    BufferedReader bufReader = new BufferedReader(new FileReader(args[0])); 
		    while ((line=bufReader.readLine()) != null){ 
					if (strLength < line.length())
						strLength = line.length();
				}
		    bufReader.close(); 
		
		} catch (IOException e) { 
		    System.err.println(e); 
		}



	line = null;		
		i=1;

/*
	Decide on Paper Size ,Orientation and Line Spacing based on max line length in report
	
*/
		if (strLength <= 108)
			i = 1 ;	
		if (strLength > 108 && strLength <= 127)
			i = 2 ;	
		if (strLength > 127 && strLength <= 165)
			i = 3 ;	
		if (strLength > 165 && strLength <= 176)
			i = 4 ;	
		if (strLength > 176 && strLength <= 239)
			i = 5;	
		if (strLength > 239)
			i = 6 ;	
			
	 switch (i) { 
			case 1: 
				doc = new Document(PageSize.A4, 36, 18, 72, 18); 
				fntSize = 8;
				lineSpacing = fntSize;
				t_logo.setAbsolutePosition(535, 770);  // image margin 60 so 595-60 and 842-60
			break; 		
			case 2: 
				doc = new Document(PageSize.A4, 36, 18, 72, 18); 
				fntSize = 7;
				lineSpacing = 9;
				t_logo.setAbsolutePosition(535, 770);  
			break;		
			case 3:
				doc = new Document(PageSize.A4.rotate(), 36, 18, 72, 18); 
				fntSize = 8;
				lineSpacing = fntSize;
				t_logo.setAbsolutePosition(770, 535);  
			break; 
			case 4:
				doc = new Document(PageSize.A4.rotate(), 36, 18, 72, 18); 
				fntSize = 7;
				lineSpacing = 9;
				t_logo.setAbsolutePosition(770, 535);  
			break;
			case 5:
				doc = new Document(PageSize.LEDGER, 36, 18, 72, 18); 
				fntSize = 8;
				lineSpacing = fntSize;
				t_logo.setAbsolutePosition(1164, 732);  
			break;
			case 6:
				doc = new Document(PageSize.LEDGER, 36, 18, 72, 18); 
				fntSize = 7;
				lineSpacing = 9;
				t_logo.setAbsolutePosition(1164, 732);  
			break;
			default:
				doc = new Document(PageSize.A4, 36, 36, 72, 18); 
				fntSize = 8;
				lineSpacing = fntSize;
				t_logo.setAbsolutePosition(535, 770);  // image margin 85 so 595-85 and 842-85
			break;		

			} 
	
	
	// Add footer
	strFooter   = "Thermax Limited Chemical Division : 97-E General Block MIDC Bhosari Pune 411026";
	strFooter +="\nPhone - 91-20-27120181, Fax - 91-20-27120206, URL - <a href="http://www.thermaxindia.com/chemical" target="_blank">www.thermaxindia.com/chemical</a>";
	strFooter +="\nGenerated by (BaaN Login) : ";
	strFooter +=args[3];
	
	HeaderFooter footer = new HeaderFooter(new Phrase(strFooter,FontFactory.getFont(FontFactory.COURIER, 7)), false);
	
	PdfWriter docWriter = null;
	docWriter = PdfWriter.getInstance(doc, os);
        doc.setFooter(footer);
	docWriter.setEncryption(PdfWriter.STRENGTH40BITS, null, null,  PdfWriter.AllowPrinting);
	doc.addTitle("BaaN Report");
	doc.addSubject("Report Generated from BaaN System");
	doc.addKeywords("Thermax Limited Chemical Division : 97-E General Block MIDC Bhosari Pune 411026");
		
	doc.open();
            doc.add(t_logo);
	Paragraph p;
	java.io.BufferedReader  br  = new java.io.BufferedReader(in);   

	try 	{ 
		while ((line=br.readLine()) != null){ 
			if (lncnt > j)
			{	
				doc.newPage();
				lncnt = 0;
			}	
			p = new Paragraph(new Phrase(lineSpacing,line,FontFactory.getFont(FontFactory.COURIER, fntSize)));
			doc.add(p);
			lncnt++;	
			}
			br.close();
		} catch (IOException e) { 
			System.out.println("IO Exception on Buffered Read :" + e); 
		}; 
	
	doc.close();
	os.close();
}

}


3. Shell Scripts
a. text2pdf.sh in user home directory
Code:
cd /baanIVc/c4/bse/tcd_email
pdf.sh $@
b. pdf.sh in say $BSE or other convinient directory
Code:
CLASSPATH=.:/baanIVc/c4/bse/tcd_email/PeBSClasses.zip:/baanIVc/c4/bse/tcd_email/itext-1.01.jar:/usr/j2se/javamail/javamail-1.3/mail.
export CLASSPATH
java tcd_text2pdf $@

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



regards
__________________


Akshay
Reply With Quote
  #4  
Old 26th June 2010, 13:16
jmathew jmathew is offline
Senior Member
 
Join Date: Aug 2003
Location: Middle East
Posts: 183
jmathew is on a distinguished road
Baan: Baan IV C4 - DB: Oracle 8i - OS: Windows 2000
Hi Akshay,
Can you please help us how we could implement the same with Baan LN 6.1 FP5. The operating system is AIX 5.3. and the database is Oracle 9.2. Please let us know the steps in details. Thanks in advance.


Quote:
Originally Posted by ahulikavi View Post
Hi,

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

Code:
||******************************************************************************
|* tdtcdpdf	0  VRC B40C L ive		
|* Title	: PDF
|* Author	: Akshay Hulikavi
|* Date		: 2004-02-09 [09:17]
|******************************************************************************
|* License	:
|* Copyright 2004 by Akshay Hulikavi
|* 
|* All Rights Reserved 
|* 
|* Permission to use, copy, modify, and distribute this software and its
|* documentation for any purpose and without fee is hereby granted,
|* provided that the above copyright notice appear in all copies and that
|* both that copyright notice and this permission notice appear in
|* supporting documentation. 
|* 
|* Akshay Hulikavi DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|* AND FITNESS, IN NO EVENT SHALL Akshay Hulikavi BE LIABLE FOR ANY
|* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
|* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 
|* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|* OR PERFORMANCE OF THIS SOFTWARE.
|******************************************************************************
	#pragma used dll ottdllbw
	
	long		ret, fp, zoomed	| general return variable
	extern	domain	tcmcs.str215	input.file, pdf.file, local.file	| input file - created by Baan
	extern	domain	tcmcs.str215	argument, argu1, argu4, argu0, argu2, argu3
	extern	domain	tcmcs.str215	argu5, argu6, argu7, argu8, argu9
	extern string	sh.string(1024), file.path(128), date.str(8), time.str(5), dat(12)

function main()
{
 	argu0 = argv$(0)
 	argu1 = argv$(1)
 	argu2 = argv$(2)
 	argu3 = argv$(3)
	argu4 = argv$(4)
	zoomed = false

	dat = dte$()
	date.str = dat(3;2) & "/" & dat(1;2)& "/" & dat(5;2)
	time.str = dat(7;2) & ":" & dat(9;2)
	
	if argu1 = "" and argu2= "" then	| Called from another program not spooler
	    import("argu1", argu1)
	    import("argu2", argu2)
	    import("argu3", argu3)
	    import("argu4", argu4)
	    zoomed = true
	endif    
	    
	file.path = getcwd()
 	input.file = shiftl$(strip$(argu2))
	ret = wait.and.activate("ttstpconv", argu1, input.file, "ASCII", "wt")


	input.file = shiftl$(strip$(file.path))&"/"&shiftl$(strip$(input.file))
	pdf.file = input.file&".pdf"
	local.file = "c:\"&shiftl$(strip$(argu2))&".pdf"

	sh.string = ""
	sh.string = sh.string &" "&chr$(34)&input.file&chr$(34)
	sh.string = sh.string &" "&chr$(34)&pdf.file&chr$(34)
	sh.string = sh.string &" "&str$(spool.pg.length)
	sh.string = sh.string &" "&chr$(34)&logname$&" on "& date.str & " at "& time.str& chr$(34)

	fp=seq.open("text2pdf.sh","r")	
	if fp >= 1 then | text2pdf.sh file exists
		ret = shell( "text2pdf.sh " & sh.string,0)
	else	
		fp=seq.open("text2pdf.sh","wt")	
		seq.puts("cd /baanIVc/c4/bse/tcd_email", fp)
		seq.puts("pdf.sh $@", fp)
		seq.close(fp)
		ret = shell( "chmod 777 text2pdf.sh",0)
		ret = shell( "text2pdf.sh " & sh.string,0)
	endif	

	if ret = 0 then
		if zoomed = false then	| Called from another program not report
			ret =  server2client(pdf.file,local.file,  0, 0)  | Binary Mode Transfer
			if ret = 0 then
				ret =  app_start(local.file,"","","","")
				ret = seq.unlink(input.file)
				ret = seq.unlink(pdf.file)
			else	
				message("File could sent to client !!!!" & str$(ret)&local.file)
			endif	
		endif	
	else
		message("File could not be created !!!!" & str$(ret))
	endif	

}
|*********************************** end of script ****************************



2. the java class tcd_text2pdf
Code:
/*
Class to convert baan ascii report to pdf
Author : Akshay Hulikavi
Date    : 10.02.2004

Requires : itext-x.jar - can be downloaded from <a href="http://www.lowagie.com/iText/" target="_blank">www.lowagie.com/iText/</a>
Source can be downloaded from <a href="http://www.lowagie.com/iText/" target="_blank">www.lowagie.com/iText/</a>

Usage : java tcd_text2pdf  <inputfile> <outputfile.pdf> <PageLength, Default = 60>

*/
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import java.io.*;

public class tcd_text2pdf 
{

public static void main(String[] args)
         throws IOException, DocumentException
	{
	String resultStr = "", line=null, strFooter; 
	int lncnt=1, i, j, pgcnt=0, fntSize=8, lineSpacing, strLength=0;	

	//~ i = Integer.parseInt(args[2]);
	j = Integer.valueOf(args[2]).intValue();
		if (j <= 0)
			j = 60;  // Default page length

		if(args.length < 2 ) {
			System.out.println("Usage : java tcd_text2pdf  <inputfile> <outputfile.pdf> <PageLength, Default = 60>"); 
			return;	
		}	
	
	Reader in = new InputStreamReader(new FileInputStream(args[0]));
	OutputStream os = new FileOutputStream(args[1]);
	Document doc= new Document();
	Image t_logo = Image.getInstance("logocolor.jpg");
	t_logo.scalePercent(75);  // scale image to 75%
	java.io.BufferedReader  br2  = new java.io.BufferedReader(in);   

	// get length of the longest line 	
		try { 
		    BufferedReader bufReader = new BufferedReader(new FileReader(args[0])); 
		    while ((line=bufReader.readLine()) != null){ 
					if (strLength < line.length())
						strLength = line.length();
				}
		    bufReader.close(); 
		
		} catch (IOException e) { 
		    System.err.println(e); 
		}



	line = null;		
		i=1;

/*
	Decide on Paper Size ,Orientation and Line Spacing based on max line length in report
	
*/
		if (strLength <= 108)
			i = 1 ;	
		if (strLength > 108 && strLength <= 127)
			i = 2 ;	
		if (strLength > 127 && strLength <= 165)
			i = 3 ;	
		if (strLength > 165 && strLength <= 176)
			i = 4 ;	
		if (strLength > 176 && strLength <= 239)
			i = 5;	
		if (strLength > 239)
			i = 6 ;	
			
	 switch (i) { 
			case 1: 
				doc = new Document(PageSize.A4, 36, 18, 72, 18); 
				fntSize = 8;
				lineSpacing = fntSize;
				t_logo.setAbsolutePosition(535, 770);  // image margin 60 so 595-60 and 842-60
			break; 		
			case 2: 
				doc = new Document(PageSize.A4, 36, 18, 72, 18); 
				fntSize = 7;
				lineSpacing = 9;
				t_logo.setAbsolutePosition(535, 770);  
			break;		
			case 3:
				doc = new Document(PageSize.A4.rotate(), 36, 18, 72, 18); 
				fntSize = 8;
				lineSpacing = fntSize;
				t_logo.setAbsolutePosition(770, 535);  
			break; 
			case 4:
				doc = new Document(PageSize.A4.rotate(), 36, 18, 72, 18); 
				fntSize = 7;
				lineSpacing = 9;
				t_logo.setAbsolutePosition(770, 535);  
			break;
			case 5:
				doc = new Document(PageSize.LEDGER, 36, 18, 72, 18); 
				fntSize = 8;
				lineSpacing = fntSize;
				t_logo.setAbsolutePosition(1164, 732);  
			break;
			case 6:
				doc = new Document(PageSize.LEDGER, 36, 18, 72, 18); 
				fntSize = 7;
				lineSpacing = 9;
				t_logo.setAbsolutePosition(1164, 732);  
			break;
			default:
				doc = new Document(PageSize.A4, 36, 36, 72, 18); 
				fntSize = 8;
				lineSpacing = fntSize;
				t_logo.setAbsolutePosition(535, 770);  // image margin 85 so 595-85 and 842-85
			break;		

			} 
	
	
	// Add footer
	strFooter   = "Thermax Limited Chemical Division : 97-E General Block MIDC Bhosari Pune 411026";
	strFooter +="\nPhone - 91-20-27120181, Fax - 91-20-27120206, URL - <a href="http://www.thermaxindia.com/chemical" target="_blank">www.thermaxindia.com/chemical</a>";
	strFooter +="\nGenerated by (BaaN Login) : ";
	strFooter +=args[3];
	
	HeaderFooter footer = new HeaderFooter(new Phrase(strFooter,FontFactory.getFont(FontFactory.COURIER, 7)), false);
	
	PdfWriter docWriter = null;
	docWriter = PdfWriter.getInstance(doc, os);
        doc.setFooter(footer);
	docWriter.setEncryption(PdfWriter.STRENGTH40BITS, null, null,  PdfWriter.AllowPrinting);
	doc.addTitle("BaaN Report");
	doc.addSubject("Report Generated from BaaN System");
	doc.addKeywords("Thermax Limited Chemical Division : 97-E General Block MIDC Bhosari Pune 411026");
		
	doc.open();
            doc.add(t_logo);
	Paragraph p;
	java.io.BufferedReader  br  = new java.io.BufferedReader(in);   

	try 	{ 
		while ((line=br.readLine()) != null){ 
			if (lncnt > j)
			{	
				doc.newPage();
				lncnt = 0;
			}	
			p = new Paragraph(new Phrase(lineSpacing,line,FontFactory.getFont(FontFactory.COURIER, fntSize)));
			doc.add(p);
			lncnt++;	
			}
			br.close();
		} catch (IOException e) { 
			System.out.println("IO Exception on Buffered Read :" + e); 
		}; 
	
	doc.close();
	os.close();
}

}


3. Shell Scripts
a. text2pdf.sh in user home directory
Code:
cd /baanIVc/c4/bse/tcd_email
pdf.sh $@
b. pdf.sh in say $BSE or other convinient directory
Code:
CLASSPATH=.:/baanIVc/c4/bse/tcd_email/PeBSClasses.zip:/baanIVc/c4/bse/tcd_email/itext-1.01.jar:/usr/j2se/javamail/javamail-1.3/mail.
export CLASSPATH
java tcd_text2pdf $@

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



regards
__________________
Regards,
John.
Reply With Quote
  #5  
Old 25th February 2004, 19:18
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
Akshay,

I split the posting into two threads so that there is more visibility. You get the advantage of 4066 views to start with ;).
__________________
~Vamsi
Vamsi Potluru
Baan XL Yet another tool to format Baan output in Excel from Baan Board
This one just happens to be free :)

Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #6  
Old 8th May 2004, 00:42
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
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.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #7  
Old 10th December 2004, 23:36
sant123's Avatar
sant123 sant123 is offline
Member
 
Join Date: Mar 2002
Location: USA
Posts: 77
sant123 is on a distinguished road
Baan: B4C4 - DB: Oracle9i - OS: AIX 5.2
colors in PDF report

hi, AKshay,

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.

Any thoughts.

Thanks
Sant
Reply With Quote
  #8  
Old 1st June 2005, 07:36
veyant veyant is offline
Senior Member
 
Join Date: May 2003
Location: Gurgaon
Posts: 107
veyant is on a distinguished road
Baan: Baan IV/V - DB: Oracle - OS: Unix/AIX
Thumbs down 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[2]: 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.

CLASSPATH=/app/baan4c4/bse/tcd_email/PeBSClasses.zip:/app/baan4c4/bse/tcd_email/itext-1.3.jar:/usr/java14/bin
export CLASSPATH
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.

thanks
Sandy
__________________
veyant
Reply With Quote
  #9  
Old 2nd June 2005, 05:17
ahulikavi's Avatar
ahulikavi ahulikavi is offline
Member
 
Join Date: Jan 2002
Location: Pune, India
Posts: 81
ahulikavi is on a distinguished road
Baan: BaaN IVc4 - DB: Oracle 8.x, mySQL - OS: Sun Solaris 2.6, RH 7.2
Question

Hi Sandy,

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 ....
__________________


Akshay
Reply With Quote
  #10  
Old 16th June 2005, 05:48
veyant1 veyant1 is offline
Newbie
 
Join Date: Jun 2005
Posts: 2
veyant1 is on a distinguished road
Baan: BAAN IV IS5 - DB: Oracle 9i - OS: AIX
problem in converting to pdf

hi,

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.


pdf.sh:
=======================

CLASSPATH = /app/baan4c4/bse/tcd_email/itext-1.3.jar:/usr/java14/jre/bin
export CLASSPATH
java tcd_text2pdf $@
=========================


txt2pdf,sh:
=======================================
cd /app/baan4c4/bse/tcd_email
pdf.sh $@
=======================================

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.

thanks
Sandeep Makan
Reply With Quote
  #11  
Old 14th November 2006, 08:28
mr_suleyman's Avatar
mr_suleyman mr_suleyman is offline
Guru
 
Join Date: Aug 2004
Posts: 639
mr_suleyman is an unknown quantity at this point
Baan: Baan IV - DB: Oracle - OS: HP UX, IBM AIX
It doesnt' work for me . I got some errors about JAVA code. I removed some lines from it.I compiled but I couldn't get PDF file.
Quote:
WHO do you know all about it ?

Thanks ...
Reply With Quote
  #12  
Old 4th August 2011, 16:35
lchleong lchleong is offline
Junior Member
 
Join Date: Nov 2010
Posts: 5
lchleong is on a distinguished road
Baan: 3 - DB: Oracle - OS: Linux
Great idea. It works perfectly. But how do I draw lines or tables that i had drawn in LN report into PDF. Apparently, all the horizontal lines had been converted into dashed lines instead of straight lines.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DEV: Create vanilla PDF files from Baan with Open Source components ~Vamsi Code & Utilities 69 3rd August 2011 08:04
DEV: Create vanilla PDF files from Baan with Open Source components Eddie Monster Tools Development 7 17th December 2001 18:41


All times are GMT +2. The time now is 07:01.


©2001-2017 - Baanboard.com - Baanforums.com