Hi,
Is it possible to generate a PDF file from an App Engine? If so, is it possible to write HTML content into it (using file.writeline or any other way)
Thanks,
Rama Naidu.

Thanks for posting your question!
Here are the steps using XMLP.1. Generate the
XML File using the below code (This
is used to
generate a XML file – which in turn used for
creating data source as part of XMLP. This is
the one time step.)
mport PSXP_XMLGEN:*;

Local Rowset &rs, &full, &rs12;

/* CREATE ROWSETS*/

&full = CreateRowset(Record.TEST_RS, &rs);

&full.Fill(“where emplid = ‘1’ “);

&RowsetDataSource = create PSXP_XMLGEN:
RowSetDS();

&rds = create PSXP_XMLGEN:RowSetDS();

&myschema = &rds.GetXSDSchema(&full);

&f1 = GetFile(“D:\Hexaware\SENTHIL\schema.xsd”,
“W”, %FilePath_Absolute);

&f1.WriteLine(&myschema);

&f1.close();

rem &myxmlfile = &rds.GetXMLData(&full, “D:\Hexaware\SENTHIL\schema.xsd”);

&myxmlfile = &rds.GetXMLData(&full, ” “);

&f2 = GetFile(“D:\Hexaware\SENTHIL\xmlfile.xml”,
“w”, %FilePath_Absolute);

&f2.WriteLine(&myxmlfile);

&f2.close();

2.Create the Data source (Date Source Type
= Row set)

Navigation – Reporting ToolsXML Publisher >
Data source

You go to this navigation after upload the xml file.

3. Create a RTF Template File.

4. Create Report definition

Navigation – Reporting ToolsXML Publisher >
Report Definition

Attach the  above created  RTF template in Report
Definition

5.Create the application engine

Application engine code:

import PSXP_RPTDEFNMANAGER:*;

import PSXP_XMLGEN:*;

Component string &KcFailPath;

&sRptDefn = “KC_UHC_ERR”;

&sTemplateId = “KC_UHC_ERR_1”;

&RptOutputDir = &KcFailPath;

&ReportDef = create PSXP_RPTDEFNMANAGER:
ReportDefn(&sRptDefn);

&ReportDef.Get();

&ReportDef.OutDestination = &RptOutputDir;

&rs = CreateRowset(Record.KC_UHC_ERR_MSG);

&rs.FILL(“where process_instance = :1”, KC_UHC_ELIG_AET.PROCESS_INSTANCE.Value);

&ReportDef.SetRuntimeDataRowset(&rs);

&ReportDef.ProcessReport(&sTemplateId, %
Language_User, %Date, “PDF”);

&ReportDef.Publish(“”, &RptOutputDir, “XMLP”, KC_UHC_ELIG_AET.PROCESS_INSTANCE.Value);

Thanks

Senthilkumar Subramanian

Posted by Nitin Pai
Comments (0)
January 6th, 2009

Comments (0)