XEROF

 

xlsgen 4.5.0.65 : Python support in automatic source code generator


The automatic source code generator can already create source code in VB, VB.NET, VBScript, C++, C# and Java from an arbitrary Excel file, by just passing the file to it. Build 4.5.0.65 of xlsgen adds Python to the list of supported languages.


Support for Python in the xlsgen automatic source code generator

Here is an example of what it produces from an existing Excel file :


#
# Automatically generated Python code for xlsgen
#
# Produced by xlsgen code generator (c) ARsT design.
# For more info, see http://xlsgen.arstdesign.com
#

#
# Setting up Python for use in xlsgen :
#
# - Download python MSI installer (for instance python 2.7.10, 17 MB) from
# https://www.python.org/downloads/release/python-2710/
#
# - Double-click on python-2.7.10.msi in order to install the software
#
# - Download the python COM types library from
# https://pypi.python.org/pypi/comtypes
# (deep download link is https://github.com/enthought/comtypes/archive/1.1.2.zip)
#
# - Extract the /comtypes folder from the COM types library
# into the \Lib folder, where is the Python 2.7.10 install folder.
#
#
# In order to run the project, use the following command :
# \python.exe test.py
#


#
# Excel workbook creation
#

import comtypes.client
from comtypes.client import CreateObject

engine = CreateObject("ExcelGenerator.ARsTDesign")

xlsgen = comtypes.client.GetModule(["{2BDEA919-2489-4ED2-8F55-C12D74DAD9B8}", 1, 0])

wbk = engine.New("myfile.xlsx")

wbk.Theme = xlsgen.workbooktheme_classic

#
# Worksheet "MU_REPORT"
#

wksht001 = wbk.AddWorksheet( "MU_REPORT" )

#
# Worksheet "Data Dictionary"
#

wksht002 = wbk.AddWorksheet( "Data Dictionary" )

#
# Worksheet "SheetNew"
#

wksht003 = wbk.AddWorksheet( "SheetNew" )

#
# declaration of dynamic named ranges
#

dynrange0000 = wksht001.NewDynamicRange("_ftnref1")
dynrange0000.Formula = "='Data Dictionary'!$C$8"

wksht001.Cell[1,1].HtmlLabel = "<font size=11 name=\"Calibri\">EHR Certification Number</font>"
wksht001.Cell[1,2].HtmlLabel = "<font size=11 name=\"Calibri\">Vendor Name</font>"
wksht001.Cell[1,3].HtmlLabel = "<font size=11 name=\"Calibri\">EHR Product CHP Id</font>"
wksht001.Cell[1,4].HtmlLabel = "<font size=11 name=\"Calibri\">EHR Product Name</font>"
wksht001.Cell[1,5].HtmlLabel = "<font size=11 name=\"Calibri\">EHR Product Version</font>"
wksht001.Cell[1,6].HtmlLabel = "<font size=11 name=\"Calibri\">Product Classification</font>"
wksht001.Cell[1,7].HtmlLabel = "<font size=11 name=\"Calibri\">Product Setting</font>"
wksht001.Cell[1,8].HtmlLabel = "<font size=11 name=\"Calibri\">Product Certification Edition Yr</font>"
wksht001.Cell[1,9].HtmlLabel = "<font size=11 name=\"Calibri\">Attestation Month</font>"
wksht001.Cell[1,10].HtmlLabel = "<font size=11 name=\"Calibri\">Attestation Year</font>"
wksht001.Cell[1,11].HtmlLabel = "<font size=11 name=\"Calibri\">Business State/Territory</font>"
wksht001.Cell[1,12].HtmlLabel = "<font size=11 name=\"Calibri\">Provider Type</font>"
wksht001.Cell[1,13].HtmlLabel = "<font size=11 name=\"Calibri\">Specialty</font>"
wksht001.Cell[1,14].HtmlLabel = "<font size=11 name=\"Calibri\">Program Year</font>"
wksht001.Cell[1,15].HtmlLabel = "<font size=11 name=\"Calibri\">Payment Year</font>"
wksht001.Cell[1,16].HtmlLabel = "<font size=11 name=\"Calibri\">Provider Stage Number</font>"
wksht001.Cell[1,17].HtmlLabel = "<font size=11 name=\"Calibri\">Program Type</font>"
wksht001.Cell[1,18].HtmlLabel = "<font size=11 name=\"Calibri\">Attestation_ID</font>"
wksht001.Cell[1,19].HtmlLabel = "<font size=11 name=\"Calibri\">Provider_ID</font>"
wksht001.Cell[2,1].HtmlLabel = "<font size=11 name=\"Calibri\">30000001SVGWEAS</font>"
wksht001.Cell[2,2].HtmlLabel = "<font size=11 name=\"Calibri\">NextGen Healthcare</font>"
wksht001.Cell[2,3].HtmlLabel = "<font size=11 name=\"Calibri\">CHP-007425</font>"
wksht001.Cell[2,4].HtmlLabel = "<font size=11 name=\"Calibri\">NextGen Ambulatory EHR</font>"



pivotTable003s0 = wksht003.NewPivotTable();
pivotTable003s0.DataSource.Range = "'MU_REPORT'!A1:S300"
pivotTable003s0.Options.Layout = xlsgen.pivottablelayout_outline
pivotTable003s0.Options.BuiltInPivotTableStyle = xlsgen.pivottablestyle_light16
pivotTable003s0.Options.ShowRowHeaders = True
pivotTable003s0.Options.ShowColumnHeaders = True
pivotTable003s0.Options.ShowRowStripes = False
pivotTable003s0.Options.ShowColumnStripes = False
pivotTable003s0.Options.ShowGrandTotalsForRows = True
pivotTable003s0.Options.ShowGrandTotalsForColumns = True
pf003s0r1 = pivotTable003s0.Rows.AddByName("EHR Product Name")
pf003s0r1.SortAscending = True
pf003s0r2 = pivotTable003s0.Rows.AddByName("Vendor Name")
pf003s0r3 = pivotTable003s0.Rows.AddByName("EHR Product Version")
pf003s0d1 = pivotTable003s0.Data.AddByName("Specialty")
pf003s0d1.AggregateFunction = xlsgen.aggrpivotfunction_count
pivotTable003s0.InsertAt(2, 2)

#
# Excel workbook epilogue
#


wbk.Close()


Posted on 23-August-2019 21:44 | Category: xlsgen, Excel generator | comment[0] | trackback[0]

 

 

<-- previous page

< July >
0102030405
0607080910
1112131415
1617181920
2122232425
2627282930
31



 

 

This site
Home
Articles

DevTools
CPU-Z
EditPlus
ExplorerXP
Kill.exe
OllyDbg
DependencyWalker
Process Explorer
autoruns.exe
Araxis
COM Trace injection
CodeStats
NetBrute
FileMon/Regmon
BoundsChecker
AQTime profiler
Source monitor
GDI leaks tracking
Rootkit revealer
Rootkit removal
RunAsLimitedUser(1)
RunAsLimitedUser(2)

 

 

Liens
Le Plan B
Un jour à Paris
Meneame
Rezo.net (aggr)
Reseau voltaire
Cuba solidarity project
Le grand soir
L'autre journal
Le courrier suisse
L'Orient, le jour
Agoravox (aggr)