Class QueryHistoricTimeseriesExportXlsxResponse.XlsxUtils
java.lang.Object
io.openems.common.jsonrpc.response.QueryHistoricTimeseriesExportXlsxResponse.XlsxUtils
- Enclosing class:
- QueryHistoricTimeseriesExportXlsxResponse
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
addBasicInfo
(org.dhatim.fastexcel.Worksheet ws, String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, ResourceBundle translationBundle) Adds basic information like the Edge-ID, date of creation,...protected static void
addEnergyData
(org.dhatim.fastexcel.Worksheet ws, SortedMap<ChannelAddress, com.google.gson.JsonElement> data, ResourceBundle translationBundle) Adds the energy data header and values.protected static void
addFloatValue
(org.dhatim.fastexcel.Worksheet ws, int row, int col, float value) Helper method to add the value to the excel sheet.protected static void
addKwhValueIfnotNull
(org.dhatim.fastexcel.Worksheet ws, int row, int col, com.google.gson.JsonElement jsonElement, ResourceBundle translationBundle) Helper method to add a energy value in unit [Wh] to the excel sheet.protected static void
addPowerData
(org.dhatim.fastexcel.Worksheet ws, SortedMap<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> data, ResourceBundle translationBundle) Adds the power data header and values.protected static void
addStringValue
(org.dhatim.fastexcel.Worksheet ws, int row, int col, String value) Helper method to add the value to the excel sheet.protected static void
addStringValueBold
(org.dhatim.fastexcel.Worksheet ws, int row, int col, String value) Helper method to add a value in bold font style to the excel sheet.protected static void
addStringValueItalic
(org.dhatim.fastexcel.Worksheet ws, int row, int col, String value) Helper method to add a value in bold + italic font style to the excel sheet.protected static void
addStringValueRightAligned
(org.dhatim.fastexcel.Worksheet ws, int row, int col, String value) Helper method to add the value to the excel sheet.
-
Constructor Details
-
XlsxUtils
protected XlsxUtils()
-
-
Method Details
-
addBasicInfo
protected static void addBasicInfo(org.dhatim.fastexcel.Worksheet ws, String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, ResourceBundle translationBundle) Adds basic information like the Edge-ID, date of creation,...- Parameters:
ws
- theWorksheet
edgeId
- the edgeId numberfromDate
- the fromdate the excel exported fromtoDate
- the todate the excel exported totranslationBundle
- theResourceBundle
for translations
-
addEnergyData
protected static void addEnergyData(org.dhatim.fastexcel.Worksheet ws, SortedMap<ChannelAddress, com.google.gson.JsonElement> data, ResourceBundle translationBundle) throws OpenemsError.OpenemsNamedExceptionAdds the energy data header and values.- Parameters:
ws
- theWorksheet
data
- the energy data maptranslationBundle
- theResourceBundle
for translations- Throws:
OpenemsError.OpenemsNamedException
- on error
-
addPowerData
protected static void addPowerData(org.dhatim.fastexcel.Worksheet ws, SortedMap<ZonedDateTime, SortedMap<ChannelAddress, throws OpenemsError.OpenemsNamedExceptioncom.google.gson.JsonElement>> data, ResourceBundle translationBundle) Adds the power data header and values.- Parameters:
ws
- theWorksheet
data
- the power data maptranslationBundle
- theResourceBundle
for translations- Throws:
OpenemsError.OpenemsNamedException
- on error
-
addStringValueBold
protected static void addStringValueBold(org.dhatim.fastexcel.Worksheet ws, int row, int col, String value) Helper method to add a value in bold font style to the excel sheet.- Parameters:
ws
- theWorksheet
row
- row numbercol
- column numbervalue
- actual value to be bold
-
addStringValueItalic
protected static void addStringValueItalic(org.dhatim.fastexcel.Worksheet ws, int row, int col, String value) Helper method to add a value in bold + italic font style to the excel sheet.- Parameters:
ws
- theWorksheet
row
- row numbercol
- column numbervalue
- actual value to be bold
-
addKwhValueIfnotNull
protected static void addKwhValueIfnotNull(org.dhatim.fastexcel.Worksheet ws, int row, int col, com.google.gson.JsonElement jsonElement, ResourceBundle translationBundle) throws OpenemsError.OpenemsNamedException Helper method to add a energy value in unit [Wh] to the excel sheet. The value is rounded to 100 Wh and formatted as [kWh]. If the value is 'null', is added instead.- Parameters:
ws
- theWorksheet
row
- row numbercol
- column numberjsonElement
- the valuetranslationBundle
- theResourceBundle
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
addStringValueRightAligned
protected static void addStringValueRightAligned(org.dhatim.fastexcel.Worksheet ws, int row, int col, String value) Helper method to add the value to the excel sheet.- Parameters:
ws
- theWorksheet
row
- row numbercol
- column numbervalue
- actual value in the sheet
-
addStringValue
protected static void addStringValue(org.dhatim.fastexcel.Worksheet ws, int row, int col, String value) Helper method to add the value to the excel sheet.- Parameters:
ws
- theWorksheet
row
- row numbercol
- column numbervalue
- actual value in the sheet
-
addFloatValue
protected static void addFloatValue(org.dhatim.fastexcel.Worksheet ws, int row, int col, float value) Helper method to add the value to the excel sheet. The float value is mathematically rounded.- Parameters:
ws
- theWorksheet
row
- row numbercol
- column numbervalue
- actual value in the sheet
-