Tag: types

apache metamodel – 在文件中的非string列上

我需要你的帮助,我使用org.apache.metamodel为了读取文件的数据集(excel,csv ..),而这样做,我已经注意到所有返回的列被归类为“string”,我的问题是我试图使用org.apache.metamodel.query筛选列值。 FilterItem ,但我看到比较是一个“string比较” – 例如(i <2)将返回1,10,111等。 我遇到了数据types转换里面:“ http://wiki.apache.org/metamodel/examples/DataTypeConversion ” 但是当我使用它,它并没有真正改变列的types,我的结果是不正确的。 所以如何过滤文件中的非string列, 提前致谢!

PHP,Excel下载

# Excel File $filename = $_SERVER['DOCUMENT_ROOT']."XXX.txt"; $fp = fopen( $filename, "w" ); fwrite( $fp, $content); fclose( $fp ); chmod($filename, 0755); header( "Content-type: application/vnd.ms-excel;" ); header( "Content-Disposition: attachment; filename=XXX.xls" ); header( "Content-Description: PHP4 Generated Data" ); 但是,如果我推“Excel下载”button,Excel文件不会打开。 只需在简单的表格中embedded浏览器,就不会打开excel文件。 有人说标题冲突可能发生。 我该怎么办? 请告诉我。

Excel VBA如何在参数中防止/陷阱数据types不匹配错误

我有一个Excel VBA用户定义的函数,我为其中一个函数的参数声明了一个数据types。 我希望能够陷入潜在的错误,以防有人不把正确的数据types。 似乎应该是简单的,但无法弄清楚。 请参阅下面的示例,我已经使用子过程来演示此问题。 Sub MyTest() MsgBox myfunction("123a") End Sub Function myfunction(mynum As Double) As String On Error Resume Next If IsNumeric(mynum) Then myfunction = "ok" Else myfunction = "not ok" End If End Function 额外的注意:虽然我使用的是一个子过程来演示这个问题,但实际上我正在使用一个用户定义的函数并从我的工作表中调用函数。 因此,在调用“MyFunction”过程之前,在“MyTest”过程中添加保护措施并不简单。

Excel VBA工作代码今天突然出现“types不匹配”错误

下面的代码现在已经运行了6个月了,并没有改变(据我所知)。 今天我运行代码,并得到运行时错误13types不匹配。 得到错误的代码行由(TYPE MISMATCH ——–>)指出请帮忙。 Sub ADULTClearAndPaste() Dim lr As Long, lr2 As Long, r As Long Set Sh1 = ThisWorkbook.Worksheets("Members to cut & past") Set Sh2 = ThisWorkbook.Worksheets("ADULT Sign On Sheet") Program = 9 ATP = 10 FIFO = 7 LastName = 2 FirstName = 3 Sh2.Select For Each cell In Sh2.Range("B1:F756") If cell.Interior.Color […]

条件expression式中的OleDb数据types不匹配

我目前正试图写入一个Excel文件。 我使用这段代码: public void UpdateExcelFile(string dir, string sheet, string sql) { System.Data.OleDb.OleDbConnection MyConnection; System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand(); MyConnection = new System.Data.OleDb.OleDbConnection(String.Format("provider=Microsoft.Jet.OLEDB.4.0;Data Source='{0}';Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=0;MAXSCANROWS=0\";", dir)); MyConnection.Open(); myCommand.Connection = MyConnection; myCommand.CommandText = sql; myCommand.ExecuteNonQuery(); MyConnection.Close(); if (myCommand != null) { myCommand.Dispose(); myCommand = null; } if (MyConnection != null) MyConnection.Dispose(); } 我遇到了“标准expression式中的数据types不匹配”exception。 我的发言如下: string cmdString […]

隐式引用variables名称通过string数组的if语句?

我试图做的是使用if语句将指定的值与一长串variables进行比较。 我想隐式地引用if语句的variables名(以及进一步处理),这样我就不必做20+条if语句。 这是我的代码,我得到一个types不匹配。 Public iFPYCol As Long Public iTimeCol As Long Public iBrgPosCol As Long Public iBrgPosFailCol As Long Public iDisLoadCol As Long Public iDisLoadFailCol As Long Public iMaxBrgLoadCol As Long Public iBrgMaxLoadFailCol As Long Public iBrgTravelCol As Long Public iTravelFailCol As Long Public iPlateLoadCol As Long Public iPlateLoadFailCol As Long Public iDepartureCol As Long […]

Excel – 不显示来自SQL Server数据库的varbinary(16)列

我有一个SQL Server 2014存储过程作为数据连接添加到Excel 2013工作簿。 存储过程返回一个定义如下的表: create table #rollups ( ID_INT_EXT_KEY varbinary(16) not null, AS_OF_DATE date not null, FOR_MONTH int not null, FOR_YEAR int not null, FINAL_REPORT_DEPT varchar(100) null, PROV_NAME varchar(100) null, EXTERNAL_FLAG bit not null, YTD_VISITS decimal(15,2) not null default 0, YTD_CHARGED decimal(15,2) not null default 0, YTD_PROCS decimal(15,2) not null default 0, MTD_VISITS decimal(15,2) […]

VBA 2042types不匹配 – #N / A – 数组

我在创build一个包含大量数据的数组时会遇到问题,这些数据将被合并到一个文件中。 在从文件中读取信息的过程中,然后把它们放到另一个合并文件中,它所在的循环find了2042错误。 我在Add Watch中发现它想要返回#N / A,因为原始文件中的函数不返回任何东西。 我怎样才能避免我的macros停下来? 我find了跳过这个logging的方法,但是由于处理这些logging的经验不足,我无法将其插入到当前的循环中。 它停在这里“如果aOutput(1,outputCol)= aDataFromPivotFiltered(1,filteredCol)那么”看下面的一小段macros。 For outputCol = 1 To UBound(aOutput, 2) For filteredCol = 1 To UBound(aDataFromPivotFiltered, 2) If aOutput(1, outputCol) = aDataFromPivotFiltered(1, filteredCol) Then For filteredRow = 2 To UBound(aDataFromPivotFiltered, 1) aOutput(filteredRow, outputCol) = aDataFromPivotFiltered(filteredRow, filteredCol) Next filteredRow Exit For End If Next filteredCol Next outputCol 我发现下面,这将是好的,但它是应用另一个macros。 Sub […]

细胞types不匹配

我需要一个for循环来跳过一个索引值,我不明白为什么这个代码不会跳过循环中的第六个索引值。 Application.ScreenUpdating = False Exceptions = 0 Dim i As Long For i = 1 To Rows.Count If i <> 6 Then If (Cells(i, Selection.Column).Value – Cells(i + 1, Selection.Column).Value) > 0.1 And Cells(i, Selection.Column).Value > 90 Then MsgBox ("The ticker start value is: " & i – 6) Exit For End If End If […]

将excel单元格值放入字符数组中

我需要将单元格的内容转储到字符数组中,以便循环并删除不需要的字符。 (即我想将“00d”转换为“00”)我知道如何删除字符,但是我有麻烦进入数组单元格。 以下是我最近的尝试。 Dim content() As Characters Dim convert As String For Each cell In .Range("J2:" & .Range("J2").End(xlDown).Address) convert = .Cells(cell.Row, 10) content = convert.tochararray() For i = LBound(content) To UBound(content) If content(i) = "d" Then content(i) = "" End If Next Next 提前致谢!