Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:mervis-db:excel-exporter [2017/08/16 17:50]
m.chlupac [Example]
en:mervis-db:excel-exporter [2020/02/03 15:35] (current)
Line 4: Line 4:
  
 It's based on custom template XLSX files where you can place data from Mervis DB using special syntax. It's based on custom template XLSX files where you can place data from Mervis DB using special syntax.
- 
-{{ :en:mervis-db:excel_exporter.png?direct&800 |}} 
  
 For more info contact  [[en:help:energocentrum-plus|sales department]]. For more info contact  [[en:help:energocentrum-plus|sales department]].
Line 17: Line 15:
 {{ :en:mervis-db:excel_exporter_viewer.png?direct&800 |}} {{ :en:mervis-db:excel_exporter_viewer.png?direct&800 |}}
  
-First you have to create a simple XML file where you define mapping between a set of keys describing individual Mervis DB variable and some Variable Name that will be used later in Excel template.+==== Configuration File ==== 
 + 
 + 
 +First you have to create a configuration XML file where you define mapping between a set of keys describing individual Mervis DB variable and some Variable Name that will be used later in Excel template
 + 
 +You can also define the name of output file and whether the file should be just updated or overwritten.
  
 <code xml ExcelDemo.xml><?xml version="1.0" encoding="utf-8"?> <code xml ExcelDemo.xml><?xml version="1.0" encoding="utf-8"?>
 <RcWareDbExporterVariableTemplateFile> <RcWareDbExporterVariableTemplateFile>
-     <exportTemplate>ExcelDemo.xlsx</exportTemplate> +     <exportTemplate>exceldemo.xlsx</exportTemplate> 
-     <exportOutput>ExcelDemoOutput_[yyyy-MM-dd_HH-mm].xlsx</exportOutput>+     <exportOutput>exceldemo_[yyyy-MM-dd_HH-mm].xlsx</exportOutput>
  <fillIncrementaly>false</fillIncrementaly>  <fillIncrementaly>false</fillIncrementaly>
      <variables>      <variables>
Line 39: Line 42:
      </variables>      </variables>
 </RcWareDbExporterVariableTemplateFile></code> </RcWareDbExporterVariableTemplateFile></code>
 +
 +==== Excel Template ====
 +
 +You can use a simple templating language to define which values from Mervis DB should go where in the output Excel file.
 +
 +<code>[YEAR:2016|MONTH:1|DAY:15|HOUR:12|MINUTE:0|VARIABLE:OutsideTemperature]</code>
 +
 +Any of the time-defining values can be omitted and will be replace by current date, time or values passed via command line parameters.
 +
 +{{ :en:mervis-db:excel_exporter_template.png?direct&800 |}}
 +
 +==== Run the Exporter  ====
 +
 +<code bat runExcelDemo.bat>.\ESG.RcWareDb.DataExporter\ESG.RcWareDb.DataExporter.exe tmpPath:"ExcelDemo.xml" srvUrl:"http://db.mervis.info/db/energocentrum/RcWareDbAccess" srvUser:"exceldemo" srvPsw:"pfi4cj4qrj" timeTolerance:300 toleranceType:before</code>
 +
 +For more info options see <code>.\ESG.RcWareDb.DataExporter\ESG.RcWareDb.DataExporter.exe --help</code>
 +
 +==== Output ====
 +
 +The output file is defined in configuration XML file and the example output should look like this:
 +
 +{{ :en:mervis-db:excel_exporter_output.png?direct&800 |}}
 +
 +==== Download Full Example ====
 +
 +Download: {{ :en:mervis-db:excelexporterdemo.zip |}}
 +
 +
 +
 +
 +
 +
  • © Energocentrum Plus, s.r.o. 2017 - 2024