hide and show combobox base another combobox value in Nintex of sharepoint - sharepoint

Im new in Sharepoint
i have combobox name c_RequestType with value value1 & value2
and another combobox name c_GuaranteeType in nintex workflow
when changing value of c_RequestType the c_GuaranteeType should be hide or show
I found this in net
If(c_RequestType.Selected.Value = "value1", true, false)
and doesn't work find some script but nothing
thanx for your helping

I found the code thanx by me :))
form.GetControl("c_RequestType").GetValue() == "value1" && form.ViewMode() == false

Related

How to access a FormControl checkbox in an Excel sheet using OpenXML SDK

I have a spreadsheet that has a number of check boxes in various cells on the sheet that I need to get the value of (checked/unchecked) from within a c# program.
I'm using the OpenXML SDK v2.5 and the associated toolbox.
Using the toolbox I can see the check box controls as part of the AlternateControlParts collection. These are not ActiveX checkboxes but are form controls added via the developer tab in Excel.
When I use the SDK I can also see the WorkSheetPart which has a ControlPropertiesParts collection on it which lists all the checkboxes.
My problem is, how do I find which checkbox is in which cell or at least related to which cell?
I have also found the collection
wsPart.ControlPropertiesParts.First().DrawingsPart
.WorkSheetDrawing.DrawingsPart.WorkSheetDrawing
This collection appears to have the alternate content of each of the checkboxes and if I drill down further I can find the anchor points which appear to give the location of the checkboxes relative to the cells on the sheet. However, the col and row Id’s don’t appear to exactly match up and I suspect that the Offset values may also have something to do with it.
If someone can point me in the right direction on how to map the checkboxes to the correct row/cells I would be very grateful.
Thank you for any help.
Regards
Paul
I have a solution, it contains only the logic (The property FormControlProperties is available since Office 2010:
SpreadsheetDocument document;
string sheetName = "sheetName";
string controlName = "Option Button 5";
...
var wbPart = document.WorkbookPart;
var theSheet = wbPart.Workbook.Descendants<Sheet>().FirstOrDefault(s => s.Name == sheetName);
var wsPart = (WorksheetPart)wbPart.GetPartById(theSheet.Id);
var control = wsPart.Worksheet.Descendants<DocumentFormat.OpenXml.Spreadsheet.Control>().FirstOrDefault(c => c.Name == controlName);
var controlProperies = (ControlPropertiesPart)wsPart.GetPartById(control.Id);
bool isChecked = controlProperies.FormControlProperties.Checked == "Checked";
But it is simplier to map the FormControl value to a cell and read the cell value if the you can edit the excel file.

Filtering a Pivot Table Automatically in Excel

I'm building a DB for school activities in the afternoon. I'm trying to create a search option through a form that controls a pivot table in which the user can filter on the class type and/or the age group and or the school year.
I wrote this code in VBA and it's not working. When i tried to write a code to filter on only one of the above (such as class type) it worked but when I expanded it to 3 filter options it isn't working. It fails when no value is inserted in one of the options.
search_class.Hide
ActiveSheet.PivotTables("PivotSearchClass").PivotFields("class type").ClearAllFilters
If IsNull(Range("type_search").Value) Then
ActiveSheet.PivotTables("PivotSearchClass").PivotFields("class type").CurrentPage = "(All)"
Else: ActiveSheet.PivotTables("PivotSearchClass").PivotFields("class type").CurrentPage = Range("type_search").Value
End If
type_box = "pick a class type"
ActiveSheet.PivotTables("PivotSearchClass").PivotFields("group age").ClearAllFilters
If IsNull(Range("target_search").Value) Then
ActiveSheet.PivotTables("PivotSearchClass").PivotFields("group age").CurrentPage = "(All)"
Else: ActiveSheet.PivotTables("PivotSearchClass").PivotFields("group age").CurrentPage = Range("target_search").Value
End If
target_box = "pick a group age"
ActiveSheet.PivotTables("PivotSearchClass").PivotFields("school year").ClearAllFilters
If IsNull(Range("year_search").Value) Then
ActiveSheet.PivotTables("PivotSearchClass").PivotFields("school year").CurrentPage = "(All)"
Else:
ActiveSheet.PivotTables("PivotSearchClass").PivotFields("school year").CurrentPage = Range("year_search").Value
End If
year_search_box = "pick a school year"
ActiveSheet.PivotTables("PivotSearchClass").PivotCache.Refresh
Does anyone know ehat the problem is and how to fix it?
I think it will work if you change your tests to either:
If IsEmpty(Range("type_search").Value)
or
If Range("type_search").Value = ""
IsNull is used to test whether a variant variable contains a null value, which won't be true with either a blank or filled cell.
I don't have Excel on this computer and pivot tables are my weakness but I'll try to help since you seem alone on this. First make sure your script is indeed running the "True" case of your if statement and then I would edit the value of CurrentPage to see if your issue is there (i.e., change the "(all)" value to something else). Where does the error lie and what is the error description?

datagridview combobox column in c#.net windows forms

hi friends iam creating datagridview combobox column in windows forms from load. but at run time iam not getting the values in comboboxcolumn of datagridview. iam using bellow code
DataGridViewComboBoxColumn clnStatus = new DataGridViewComboBoxColumn();
clnStatus.DataPropertyName = "Status";
clnStatus.Name = "Absent - Leave - Present";
clnStatus.DataSource = new string[] { "Absent", "Leave", "Present" };
DgvTeacherAttendance.Columns.Add(clnStatus);
here combobox column will display empty values before i select anyone of the dropdown list.
why iam getting these error please can anyone help me.

How to get the value in an Excel dropdown using C#

I am looking for code to open and read an Excel file, any version of Excel, including 2010. One of my columns has a dropdown in it. I need to get the value of the selected item in the dropdown. I would eventually want to populate these values into a business object.
If anyone has some code to share please let me know.
I am using C# and Visual Studio 2010.
Thanks.
I know the VBA for both the ActiveX combo and the forms dropdown, and based on that, I can give you some very inexpert notes for c# for the forms dropdown, the combo eludes me as yet.
Working with notes from: http://support.microsoft.com/kb/302084
//Get a new workbook.
oWB = (Excel._Workbook)(oXL.Workbooks.Open("C:\\Docs\\Book1.xls"));
//3rd Sheet
oSheet = (Excel._Worksheet)oWB.Sheets.get_Item(3);
//This will return an index number
var i = oSheet.Shapes.Item("Drop Down 1").ControlFormat.Value;
//This will return the fill range
var r = oSheet.Shapes.Item("Drop Down 1").ControlFormat.ListFillRange;
oRng = oSheet.get_Range(r);
//This will return the value of the dropdown, based on the index
//and fillrange
var a =oRng.get_Item(i).Value;
//Just to check
textBox1.Text = a;
This may help with an ActiveX combo, but I have only half got it to work:
using MSForm = Microsoft.Vbe.Interop.Forms;
<...>
Excel.OLEObject cbOLEObj = (Excel.OLEObject)workSheet.OLEObjects("ComboBox1");
MSForm.ComboBox ComboBox1 = (MsForm.ComboBox) cbOLEObj.Object;
Console.WriteLine(ComboBox1.Text);
From: http://www.eggheadcafe.com/community/aspnet/66/10117559/excel-get-value-from-a-combobox.aspx

how to save null value in subsonic

Dim xbg As Rm
xbg.LobId = cmb_lob.SelectedValue
xbg.Mobile = mobno.Text
xbg.BusinessFax = faxno.Text
xbg.BusinessPhone = phno.Text
xbg.Save()
I have a combo box, which is not mandatory while input in the module. therefore user can select blank value in combo cox for which i want to save null in Oracle Database for that record. I had trid with following condition but fails to get result. you are requested to please help
if cmb_lob.selectedindex=-1 then
xbg.lob=dbnull
else
xbg.LobId = cmb_lob.SelectedValue
Actual Problem arises when first user save record with selection in Combo box then user edit that record and select blank from Combo box. now i have to replace value of combox box with null at database.
Set it to null or whatever VB considers null - it will be set in the DB that way.
try:
if cmb_lob.selectedindex <> -1 then
xbg.LobId = cmb_lob.SelectedValue
else
xbg.LobId = Nothing 'suggested by John Shean (see comments)
So that if the value is selected only then assign it to field else leave it as it is (null)
Try xbg.LobId = Nothing instead –
By John Sheehan

Resources