Difference between revisions of "Saving the Report File in a Specific Folder"

From ArcoWiki
Jump to: navigation, search
(Created page with "This is used to save report file with specific names in specific folders.<br /> The example is using Static names, but it can be extended using variable names as shown in...")
 
 
Line 1: Line 1:
 
This is used to save report file with specific names in specific folders.<br />
 
This is used to save report file with specific names in specific folders.<br />
 
The example is using Static names, but it can be extended using [[variable]] names as shown in the page where there is the code about how [[Creating a Timestamp]].
 
The example is using Static names, but it can be extended using [[variable]] names as shown in the page where there is the code about how [[Creating a Timestamp]].
 +
 +
In the attached example, the GRAPHICAL PDF FILE it is still stored in the REPORTS FOLDER of ARCO and the data files XMLD is stored in the specific defined folder.<br />
 +
 +
Example of code:<br />
 +
 +
 +
 +
<code><span style="color: green; text-decoration: none;">$$Begin Example</span><br/></code>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Declaring Full Path Name</span><br/></code>
 +
::<code>DECL/CHAR,200, fullPathForTXTFile</code>
 +
::<code>DECL/CHAR,200, fullPathForExcelFile</code>
 +
::<code>DECL/CHAR,200, fullPathForXMLDFile</code>
 +
::<code>DECL/CHAR,200, fullPathForPdfTextFile</code>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Declaring Folder for different Type of Output</span><br/></code>
 +
::<code>DECL/CHAR,200, folderForTXTFile</code>
 +
::<code>DECL/CHAR,200, folderForExcelFile</code>
 +
::<code>DECL/CHAR,200, folderForXMLDFile</code>
 +
::<code>DECL/CHAR,200, folderForPdfTextFile</code>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Declaring FileName for different Type of Output</span><br/></code>
 +
::<code>DECL/CHAR,200, fileForTXTFormat</code>
 +
::<code>DECL/CHAR,200, fileForExcelFormat</code>
 +
::<code>DECL/CHAR,200, fileForXMLDFormat</code>
 +
::<code>DECL/CHAR,200, fileForPdfTextFormat</code>
 +
<br/>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Define Location for different Folders</span><br/></code>
 +
::<code>folderForTXTFile=ASSIGN/'c:\MyCustomReportFolder\Text_Format\'</code>
 +
::<code>folderForExcelFile=ASSIGN/'c:\MyCustomReportFolder\Excel_Format\'</code>
 +
::<code>folderForXMLDFile=ASSIGN/'c:\MyCustomReportFolder\XMLD_Format\'</code>
 +
::<code>folderForPDFTextFile=ASSIGN/'c:\MyCustomReportFolder\PDF_Format\'</code>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Define File Name for different Formats</span><br/></code>
 +
::<code>fileForTXTFormat=ASSIGN/'myTextFileName.txt'</code>
 +
::<code>fileForExcelFormat=ASSIGN/'myExcelFileName.xlsx'</code>
 +
::<code>fileForXMLDFormat=ASSIGN/'myXMLDFileName.xmld'</code>
 +
::<code>fileForPdfTextFormat=ASSIGN/'myPDFTextFileName.pdf'</code>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Concatenate folder and file name</span><br/></code>
 +
::<code>fullPathForTXTFile=ASSIGN/CONCAT(folderForTXTFile,fileForTXTFormat)</code>
 +
::<code>fullPathForExcelFile=ASSIGN/CONCAT(folderForExcelFile,fileForExcelFormat)</code>
 +
::<code>fullPathForXMLDFile=ASSIGN/CONCAT(folderForXMLDFile,fileForXMLDFormat)</code>
 +
::<code>fullPathForPdfTextFile=ASSIGN/CONCAT(folderForPdfTextFile,fileForPdfTextFormat)</code>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Declaring the different Output Format</span><br/></code>
 +
::<code>V(TEXT)=VFORM/ALL</code>
 +
::<code>V(XLSX_INCR)=VFORM/DME,'XLSX/I',ALL</code>
 +
::<code>V(XMLDA)=VFORM/DME,'XMLD/A',ALL</code>
 +
::<code>V(PDF)=VFORM/DME,'PDF',ALL</code>
 +
<br/>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Open The specific file per each output file</span><br/></code>
 +
::<code>DID(OUT_FILE_TEXT)=DEVICE/STOR,fullPathForTXTFile</code>
 +
::<code>OPEN/DID(OUT_FILE_TEXT),FDATA,V(TEXT),OUTPUT,OVERWR</code>
 +
<br/>
 +
::<code>DID(OUT_FILE_EXCEL)=DEVICE/STOR,fullPathForExcelFile</code>
 +
::<code>OPEN/DID(OUT_FILE_EXCEL),FDATA,V(XLSX_INCR),OUTPUT,OVERWR</code>
 +
<br/>
 +
::<code>DID(OUT_FILE_XMLD)=DEVICE/STOR,fullPathForXMLDFile</code>
 +
::<code>OPEN/DID(OUT_FILE_XMLD),FDATA,V(XMLDf),OUTPUT,OVERWR</code>
 +
<br/>
 +
::<code>DID(OUT_FILE_PDF)=DEVICE/STOR,fullPathForPdfTextFile</code>
 +
::<code>OPEN/DID(OUT_FILE_PDF),FDATA,V(PDF),OUTPUT,OVERWR</code>
 +
<br/>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Declare a fake Point</span><br/></code>
 +
::<code>F(q)=FEAT/POINT,CART,00,0,0,0,0,1</code>
 +
::<code>FA(q)=FEAT/POINT,CART,00,0,0,0,0,1</code>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Send the POINT to OUTPUT</span><br/></code>
 +
::<code>T(CORTOL_1)=TOL/CORTOL,XAXIS,-0.1000,0.1000</code>
 +
::<code>T(CORTOL_2)=TOL/CORTOL,YAXIS,-0.1000,0.1000</code>
 +
::<code>T(CORTOL_3)=TOL/CORTOL,ZAXIS,-0.1000,0.1000</code>
 +
::<code>OUTPUT/FA(Q),TA(CORTOL_1),TA(CORTOL_2),TA(CORTOL_3)</code>
 +
<br/>
 +
<code><span style="color: green; text-decoration: none;">$$Close the Output Device</span><br/></code>
 +
::<code>CLOSE/DID(OUT_FILE_TEXT)</code>
 +
::<code>CLOSE/DID(OUT_FILE_EXCEL)</code>
 +
::<code>CLOSE/DID(OUT_FILE_XMLD)</code>
 +
::<code>CLOSE/DID(OUT_FILE_PDF)</code>
  
 
[[Category:Dmis_Tutorial]]
 
[[Category:Dmis_Tutorial]]

Latest revision as of 11:00, 20 November 2019

This is used to save report file with specific names in specific folders.
The example is using Static names, but it can be extended using variable names as shown in the page where there is the code about how Creating a Timestamp.

In the attached example, the GRAPHICAL PDF FILE it is still stored in the REPORTS FOLDER of ARCO and the data files XMLD is stored in the specific defined folder.

Example of code:


$$Begin Example

$$Declaring Full Path Name

DECL/CHAR,200, fullPathForTXTFile
DECL/CHAR,200, fullPathForExcelFile
DECL/CHAR,200, fullPathForXMLDFile
DECL/CHAR,200, fullPathForPdfTextFile


$$Declaring Folder for different Type of Output

DECL/CHAR,200, folderForTXTFile
DECL/CHAR,200, folderForExcelFile
DECL/CHAR,200, folderForXMLDFile
DECL/CHAR,200, folderForPdfTextFile


$$Declaring FileName for different Type of Output

DECL/CHAR,200, fileForTXTFormat
DECL/CHAR,200, fileForExcelFormat
DECL/CHAR,200, fileForXMLDFormat
DECL/CHAR,200, fileForPdfTextFormat



$$Define Location for different Folders

folderForTXTFile=ASSIGN/'c:\MyCustomReportFolder\Text_Format\'
folderForExcelFile=ASSIGN/'c:\MyCustomReportFolder\Excel_Format\'
folderForXMLDFile=ASSIGN/'c:\MyCustomReportFolder\XMLD_Format\'
folderForPDFTextFile=ASSIGN/'c:\MyCustomReportFolder\PDF_Format\'


$$Define File Name for different Formats

fileForTXTFormat=ASSIGN/'myTextFileName.txt'
fileForExcelFormat=ASSIGN/'myExcelFileName.xlsx'
fileForXMLDFormat=ASSIGN/'myXMLDFileName.xmld'
fileForPdfTextFormat=ASSIGN/'myPDFTextFileName.pdf'


$$Concatenate folder and file name

fullPathForTXTFile=ASSIGN/CONCAT(folderForTXTFile,fileForTXTFormat)
fullPathForExcelFile=ASSIGN/CONCAT(folderForExcelFile,fileForExcelFormat)
fullPathForXMLDFile=ASSIGN/CONCAT(folderForXMLDFile,fileForXMLDFormat)
fullPathForPdfTextFile=ASSIGN/CONCAT(folderForPdfTextFile,fileForPdfTextFormat)


$$Declaring the different Output Format

V(TEXT)=VFORM/ALL
V(XLSX_INCR)=VFORM/DME,'XLSX/I',ALL
V(XMLDA)=VFORM/DME,'XMLD/A',ALL
V(PDF)=VFORM/DME,'PDF',ALL



$$Open The specific file per each output file

DID(OUT_FILE_TEXT)=DEVICE/STOR,fullPathForTXTFile
OPEN/DID(OUT_FILE_TEXT),FDATA,V(TEXT),OUTPUT,OVERWR


DID(OUT_FILE_EXCEL)=DEVICE/STOR,fullPathForExcelFile
OPEN/DID(OUT_FILE_EXCEL),FDATA,V(XLSX_INCR),OUTPUT,OVERWR


DID(OUT_FILE_XMLD)=DEVICE/STOR,fullPathForXMLDFile
OPEN/DID(OUT_FILE_XMLD),FDATA,V(XMLDf),OUTPUT,OVERWR


DID(OUT_FILE_PDF)=DEVICE/STOR,fullPathForPdfTextFile
OPEN/DID(OUT_FILE_PDF),FDATA,V(PDF),OUTPUT,OVERWR



$$Declare a fake Point

F(q)=FEAT/POINT,CART,00,0,0,0,0,1
FA(q)=FEAT/POINT,CART,00,0,0,0,0,1


$$Send the POINT to OUTPUT

T(CORTOL_1)=TOL/CORTOL,XAXIS,-0.1000,0.1000
T(CORTOL_2)=TOL/CORTOL,YAXIS,-0.1000,0.1000
T(CORTOL_3)=TOL/CORTOL,ZAXIS,-0.1000,0.1000
OUTPUT/FA(Q),TA(CORTOL_1),TA(CORTOL_2),TA(CORTOL_3)


$$Close the Output Device

CLOSE/DID(OUT_FILE_TEXT)
CLOSE/DID(OUT_FILE_EXCEL)
CLOSE/DID(OUT_FILE_XMLD)
CLOSE/DID(OUT_FILE_PDF)