Escolar Documentos
Profissional Documentos
Cultura Documentos
&Rs = GetLevel0()(1).GetRowset(Scroll.TT_PRNT_DOC_VW);
GENERATE REPORT
Function TT_Generate_Report(&ReportDefn_ID As string, &TemplateDefn_ID As string)
Evaluate &TemplateDefn_ID
When = "REPORTE_1"
&XMLReport = REPORTE_1 (“Diego”, “Cabot”, “Alem 1134”, “27123456”, “10-01-1979” );
Break;
When = "REPORTE_2"
&XMLReport = REPORTE_2 ();
Break;
When-Other
Error MsgGet(27200, 45, "Message not found.");
Break;
End-Evaluate;
&Node = &outXMLDoc.DocumentElement.AddElement("DNI");
&Node.NodeValue = String(&DNI);
&Node = &outXMLDoc.DocumentElement.AddElement("Nombre");
&Node.NodeValue = String(&Nombre);
&Node = &outXMLDoc.DocumentElement.AddElement("Apellido");
&Node.NodeValue = String(&Apellido);
/*ROWSET Autos*/
If &Vec_Autos [1].Len = 0 Then
&Vec_Autos = CreateArrayRept(CreateArrayRept("", 1), 32);
End-If;
For &k = 1 To &Vec_Autos [1].Len
&Node2 = &outXMLDoc.DocumentElement.AddElement("Autos");
&Node3 = &Node2.AddElement("Patente");
&Node3.NodeValue = &Vec_LifePolicy [1][&k];
&Node3 = &Node2.AddElement("Marca");
&Node3.NodeValue = &Vec_LifePolicy [2][&k];
&Node3 = &Node2.AddElement("Modelo");
&Node3.NodeValue = &Vec_LifePolicy [3][&k];
End-For;
/*ROWSET Autos*/
Return &outXMLDoc;
End-Function;
PUBLICA EL REPORTE
Function TT_Publish_XML(&ReportDefn_ID As string, &TemplateDefn_ID As string, &inXMLDoc As XmlDoc)
/* --> Set-Up variables */
Local XmlNode &Node;
Local string &outStr;
Local File &MYFILE;
Local string &sourcepath;
Local PSXP_RPTDEFNMANAGER:ReportDefn &oRptDefn;
Local PSXP_RPTDEFNMANAGER:TemplateFile &oTmplFile;
Local number &format;
Local date &Effdt;
Local string &sFileExt;
Local string &sDirSep, &sOutputDir;
Local string &sTmplFile;
Local string &sOutputFile;
Local string &sOutputFileXSL;
Local string &sErr;
Local boolean &bRtn;
Local PSXP_ENGINE:FOProcessor &oFOProcessor;
Local PSXP_ENGINE:RTFProcessor &oRTFProcessor;
Local PSXP_RPTDEFNMANAGER:Utility &oUtil;
/* --> Generate the XSL with Template taking into account the input parameters */
&oRTFProcessor = create PSXP_ENGINE:RTFProcessor();
If &oRTFProcessor.generateXSL(&sTmplFile, &sOutputFileXSL, &sErr) = False Then
Error ("Error generating the XSL File");
End-If;
/* --> Generate the report output in order to show it into a new windows */
End-Function;