ExportToExcel() public method

public ExportToExcel ( string mapname, int address, int length, byte mapdata, int cols, int rows, bool isSixteenbit, int xaxisvalues, int yaxisvalues, bool isupsidedown, string xaxisdescr, string yaxisdescr, string zaxisdescr ) : void
mapname string
address int
length int
mapdata byte
cols int
rows int
isSixteenbit bool
xaxisvalues int
yaxisvalues int
isupsidedown bool
xaxisdescr string
yaxisdescr string
zaxisdescr string
return void
Ejemplo n.º 1
0
        private void StartExcelExport()
        {
            ExcelInterface excelInterface = new ExcelInterface();
            if (gridViewSymbols.SelectedRowsCount > 0)
            {
                int[] selrows = gridViewSymbols.GetSelectedRows();
                if (selrows.Length > 0)
                {
                    SymbolHelper sh = (SymbolHelper)gridViewSymbols.GetRow((int)selrows.GetValue(0));
                    //DataRowView dr = (DataRowView)gridViewSymbols.GetRow((int)selrows.GetValue(0));
                    //frmTableDetail tabdet = new frmTableDetail();
                    string Map_name = sh.Varname;
                    if ((Map_name.StartsWith("2D") || Map_name.StartsWith("3D")) && sh.Userdescription != "") Map_name = sh.Userdescription;
                    int columns = 8;
                    int rows = 8;
                    int tablewidth = GetTableMatrixWitdhByName(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, Map_name, out columns, out rows);

                    int address = (int)sh.Flash_start_address;
                    if (address != 0)
                    {
                        int length = sh.Length;

                        byte[] mapdata = Tools.Instance.readdatafromfile(Tools.Instance.m_currentfile, address, length, Tools.Instance.m_currentFileType);
                        int[] xaxis = GetXaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, Map_name);
                        int[] yaxis = GetYaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, Map_name);
                        Map_name = Map_name.Replace(",", "");
                        Map_name = Map_name.Replace("[", "");
                        Map_name = Map_name.Replace("]", "");

                        excelInterface.ExportToExcel(Map_name, address, length, mapdata, columns, rows, true, xaxis, yaxis, m_appSettings.ShowTablesUpsideDown, sh.X_axis_descr, sh.Y_axis_descr, sh.Z_axis_descr);
                    }
                }
            }
            else
            {
                frmInfoBox info = new frmInfoBox("No symbol selected in the primary symbol list");
            }
        }