diff --git a/instat/dlgImportDataset.vb b/instat/dlgImportDataset.vb index d3dc106c1af..77c94b053d5 100644 --- a/instat/dlgImportDataset.vb +++ b/instat/dlgImportDataset.vb @@ -331,11 +331,12 @@ Public Class dlgImportDataset If strFileType <> "RDS" Then grdDataPreview.Show() lblDataFrame.Show() - If strFileType = "csv" Then - clsReadCSV.AddParameter("nrows", intLines) - ElseIf strFileType = "xlsx" Then - clsReadXL.AddParameter("rows", "1:" & intLines) - End If + If strFileType = "csv" Then + clsReadCSV.AddParameter("nrows", intLines) + ElseIf strFileType = "xlsx" Then + 'iPosition = 0 is needed because of a bug in rio::import + clsReadXL.AddParameter("rows", "1:" & intLines, iPosition:=0) + End If lblCannotImport.Hide() lblNoPreview.Hide() If ucrInputFilePath.IsEmpty() Then diff --git a/instat/dlgUnusedLevels.vb b/instat/dlgUnusedLevels.vb index 699475a599f..7f46d7c55e7 100644 --- a/instat/dlgUnusedLevels.vb +++ b/instat/dlgUnusedLevels.vb @@ -16,8 +16,9 @@ Imports instat.Translations Public Class dlgUnusedLevels - Public bFirstLoad As Boolean = True + Private bFirstLoad As Boolean = True Private bReset As Boolean = True + Private clsUnusedLevels As New RFunction Private Sub dlgUnusedLevels_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -31,25 +32,19 @@ Public Class dlgUnusedLevels bReset = False autoTranslate(Me) End Sub - Private Sub ReopenDialog() - End Sub Private Sub SetDefaults() - Dim clsDefaultFunction As New RFunction - + clsUnusedLevels = New RFunction ucrSelectorFactorColumn.Reset() - ' Set default RFunction as the base function - clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$drop_unused_factor_levels") - ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone()) - + clsUnusedLevels.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$drop_unused_factor_levels") + ucrBase.clsRsyntax.SetBaseRFunction(clsUnusedLevels) End Sub Private Sub SetRCodeforControls(bReset As Boolean) SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub - Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 40 @@ -58,6 +53,7 @@ Public Class dlgUnusedLevels ucrReceiverFactorColumn.SetMeAsReceiver() ucrReceiverFactorColumn.SetIncludedDataTypes({"factor"}) ucrRemoveUnusedFactorLevels.SetReceiver(ucrReceiverFactorColumn) + ucrReceiverFactorColumn.SetParameter(New RParameter("col_name", 1)) ucrReceiverFactorColumn.SetParameterIsString()