Error in send variable Stimulsoft - stimulsoft

i use Stimulsoft for my project however this problam stop my project
my code:
string cn1 = #"data source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\Report.mrt;integrated security=True;connect timeout=30;Encrypt=False;TrustServerCertificate=False;MultipleActiveResultSets=True;";
stiReport1.Load("Report.mrt");
stiReport1.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection11", cn1));
stiReport1.Dictionary.Variables["Variable1"].Value =textBox1.Text;
stiReport1.Render(false);
this.stiViewerControl1.Report = stiReport1;
this.stiViewerControl1.Refresh();
when i run that and fill textbox and submit :
Invalid column name 'اهواز'.
please help me

check DataSource columns name in StiReport Designer

Related

Excel VBA Ribbon - Set value of editBox on Startup Based on Value on Worksheet

I have an editBox on an Excel File where I want to display a date that is stored in a named cell on a specific worksheet. I want this value to be displayed when the Excel file is opened.
Here's the ribbon XML line:
<editBox id="editBoxSDate" label = "S Date" onChange = "onChange_SDate" getText = "getText_SDate"/>
Here's the getText_SDate function:
Public Function getText_SDate(ByRef control As Office.IRibbonControl) As String
getText_SDate = CStr(wksSettings.Range("SettingsSDate"))
End Function
When I open the file and click on my custom Ribbon tab, I get the following error message:
Wrong number of arguments or invalid property assignment
What am I missing or doing wrong?
Either change the name of the Function or the getText command to match, actually they do not match, i.e.: getText_Date vs.getText_SDate

Parsing Formula in Report Mail Settings

I'm trying to show an email pop up window with an attached report. I want the email fields in the popup window to be populated with the attached report's mail settings - similar to what happens when you click the "Send" button when running the report directly. I'm trying to do this in a PXAction method.
I've got it mostly done but, I'm having a problem if the Mail Settings have a formula in them. For instance if the Subject is set to "=[table].[field]" I get "=[table].[field]" in the Subject box for my email popup window instead of the value of table.field.
Any ideas on how to get the values of the Mail Settings fields in the report instead of the verbatim text?
TIA!
Here's what worked for me. I'm sure there's a way to dispense with the code that removes the "=" but, this got what I needed.
protected string GleanMailSetting(Report report, ReportNode reportNode, string settingText)
{
if ((string.IsNullOrEmpty(settingText)) || (!settingText.StartsWith("=")))
return settingText;
string trimmedText = settingText.TrimStart(new char[] { '=' });
PX.Common.Parser.ExpressionNode node = Reports.Parser.ReportExprParser.Parse(trimmedText, report);
node.Bind(report.DataSource);
return (string)node.Eval(reportNode.DataItem);
}

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.

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.

ADODB.Connection undefined

Reference Excel VBA to SQL Server without SSIS
After I got the above working, I copied all the global variables/constants from the routine, which included
Const CS As String = "Driver={SQL Server};" _
& "Server=****;" _
& "Database=****;" _
& "UID=****;" _
& "PWD=****"
Dim DB_Conn As ADODB.Connection
Dim Command As ADODB.Command
Dim DB_Status As Stringinto a similar module in another spreadsheet. I also copied into the same module
Sub Connect_To_Lockbox()
If DB_Status <> "Open" Then
Set DB_Conn = New Connection
DB_Conn.ConnectionString = CS
DB_Conn.Open ' problem!
DB_Status = "Open"
End If
End SubI added the same reference (ADO 2.8)
The first spreadsheet still works; the seccond at DB_Conn.Open pops up "Run-time error '-214767259 (80004005)': [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
Removing the references on both, saving files, re-opening, re-adding the references doesn't help. The one still works and the other gets the error.
?!?
I observed the same error message and in my case nothing had changed. I wondered if my odbc driver needed to be reinstalled (based on what i read online). In any case, restarting excel did the trick. Sometimes the solution is much simpler. :-)
When the error pops up, check your "locals" windows to see what the CS holds. View > Locals Window
Problem: Your constant isn't found by the compiler.
Solution: With the constant being located in a separate module, you'll need to set it as Public for the other code to see it.
Proof:
In order to prove this theory you can do the following:
Open a new Excel spreadsheet
Go to the VBA designer and add a new module
In this module put:
Const TestString As String = "Test String"
Then add the following code to ThisWorkbook:
Public Sub TestString()
MsgBox (TestString)
End Sub
After adding this return to the workbook and add a button, selecting "TestString" as the macro to run when clicked.
Click the button and a blank message box will appear.
Go back to the VBA designer and change the const in Module1 to Public
Click the button on the spreadsheet and you should now see "Test String" in the message box.
I realize that this question is really old. But for the record I want to document my solutions for the error here: It was a data related error in a spreadsheet! A column was formatted as date and contained a value 3000000. Changing the Format to numbers solved the Error 80004005.

Resources