Question about Compilers & Programming Tools

1 Answer

Related to excel sheet

Sir,
taking the cell reference value in same data sheet, but it shows null value in the cell, why

Posted by on

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    Hot-Shot:

    An expert who has answered 20 questions.

    Corporal:

    An expert that has over 10 points.

    Mayor:

    An expert whose answer got voted for 2 times.

  • Contributor
  • 71 Answers

Could you give me more info plz

Posted on Jul 30, 2008

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Mysql> desc contact_info -> ; --------------


Hi David,

It looks like you're missing two more null's in the third record, the column count is only 21 and you have 23 fields in your destination table.

All your data matches up to the columns, but you'll need to insert ", null, null" before the last paren to cover CompanyURL and companyPhone):

('Karson', 'B', 'Campbell', null, 'Dr.', 'Chief Resident', 'Pediatrics', 'kbc232@mvch.org', null, null, '585-544-1212', 'home', '1955-01-05', 'Wife: Molly Kids: Cassidy, Justine, and Cory.', 'Mountain View Hospital', null, null, null, null, null, null, null, null, null, null )

Sep 06, 2013 | Sun MySQL

Tip

How to export datagridview data to excel in C#


First, add this to your namespace.<br /><span style="font-weight: bold;">using Microsoft.Office.Interop.Excel;</span><br /><br />Then, copy the codes below and paste it into the export button click event.<br /><br /> <span style="font-weight: bold;">Microsoft.Office.Interop.Excel.Application wapp;</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> Microsoft.Office.Interop.Excel.Worksheet wsheet;</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> Microsoft.Office.Interop.Excel.Workbook wbook;</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> wapp = new Microsoft.Office.Interop.Excel.Application();</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> wapp.Visible = false;</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> wbook = wapp.Workbooks.Add(true);</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> wsheet = (Worksheet)wbook.ActiveSheet;</span><br style="font-weight: bold;" /><br style="font-weight: bold;" /><span style="font-weight: bold;"> if (dataGridView1.RowCount == 0)</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> {</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> mssgbox_noretrieve();</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> return;</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> }</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> try</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> {</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> for (int i = 0; i &lt; this.dataGridView1.Columns.Count; i++)</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> {</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> wsheet.Cells[1, i + 1] = this.dataGridView1.Columns[i].HeaderText;</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> }</span><br style="font-weight: bold;" /><br style="font-weight: bold;" /><span style="font-weight: bold;"> for (int i = 0; i &lt; this.dataGridView1.Rows.Count; i++)</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> {</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> DataGridViewRow row = this.dataGridView1.Rows[i];</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> for (int j = 0; j &lt; row.Cells.Count; j++)</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> {</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> DataGridViewCell cell = row.Cells[j];</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> try</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> {</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> wsheet.Cells[i + 2, j + 1] = (cell.Value == null) ? "" : cell.Value.ToString();</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> }</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> catch (Exception ex)</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> {</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> MessageBox.Show(ex.Message);</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> }</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> }</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> }</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> wapp.Visible = true;</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> }</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> catch (Exception ex1)</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> {</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> MessageBox.Show(ex1.Message);</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> }</span><br style="font-weight: bold;" /><span style="font-weight: bold;"> wapp.UserControl = true;<br /><br /><br /><br /></span><br /> That's all and enjoy...<br /> Larrix<br /> <span style="font-weight: bold;"><br /></span>

on Jul 09, 2011 | Compilers & Programming Tools

Tip

How to datagridview to excel in C#


First, add this to your namespace.
using Microsoft.Office.Interop.Excel;

Then, copy the codes below and paste it into the export button click event.

Microsoft.Office.Interop.Excel.Application wapp;
Microsoft.Office.Interop.Excel.Worksheet wsheet;
Microsoft.Office.Interop.Excel.Workbook wbook;
wapp = new Microsoft.Office.Interop.Excel.Application();
wapp.Visible = false;
wbook = wapp.Workbooks.Add(true);
wsheet = (Worksheet)wbook.ActiveSheet;

if (dataGridView1.RowCount == 0)
{
mssgbox_noretrieve();
return;
}
try
{
for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
{
wsheet.Cells[1, i + 1] = this.dataGridView1.Columns[i].HeaderText;
}

for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
{
DataGridViewRow row = this.dataGridView1.Rows[i];
for (int j = 0; j < row.Cells.Count; j++)
{
DataGridViewCell cell = row.Cells[j];
try
{
wsheet.Cells[i + 2, j + 1] = (cell.Value == null) ? "" : cell.Value.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
wapp.Visible = true;
}
catch (Exception ex1)
{
MessageBox.Show(ex1.Message);
}
wapp.UserControl = true;




That's all and enjoy...
Larrix



on Jul 09, 2011 | Compilers & Programming Tools

1 Answer

Change font color in cell A based on value in cell B


If you are referring to the excel program, it is not possible to do that. You cannot make it change colours based on values in the cells. You would have to manually change the colours. Hope this helps. Cheers.

Oct 02, 2009 | Compilers & Programming Tools

1 Answer

In microsoft excel sheet how do we copy zodiac signs written in front of employee from one sheet to another by writing a formulae in the blank space eg 1 amit scorpio 2 divik saggitarius 2 tisha...


When the cell is in a different sheet in the same file use:
=sheet-name!cell-name as in =Sheet1!A1

If the cell you want is in a different sheet in a different file use:
=[file-name]sheet-name!cell-name

as in: ='[sample excel 2.xls]Sheet1'!$A$1

The easiest way to do it is in the blank cell, type an equals sign "=" then go to the cell you want to copy, then press enter. All the correct formatting will be handled for you. (Sometimes you need quotes when you have spaces in the filenames and or sheet names.)

Sep 06, 2009 | Compilers & Programming Tools

1 Answer

Validating in jsp


JavaScript Form Validation JavaScript can be used to validate input data in HTML forms before sending off the content to a server.
Form data that typically are checked by a JavaScript could be:
  • has the user left required fields empty?
  • has the user entered a valid e-mail address?
  • has the user entered a valid date?
  • has the user entered text in a numeric field?
Required Fields The function below checks if a required field has been left empty. If the required field is blank, an alert box alerts a message and the function returns false. If a value is entered, the function returns true (means that data is OK):
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{
alert(alerttxt);return false;
}
else
{
return true;
}
}
} The entire script, with the HTML form could look something like this:
<html>
<head>
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);return false;}
else {return true}
}
} function validate_form(thisform)
{
with (thisform)
{
if (validate_required(email,"Email must be filled out!")==false)
{email.focus();return false;}
}
}
</script>
</head> <body>
<form action="submitpage.htm"
onsubmit="return validate_form(this)"
method="post">
Email: <input type="text" name="email" size="30">
<input type="submit" value="Submit">
</form>
</body> </html>
E-mail Validation The function below checks if the content has the general syntax of an email.
This means that the input data must contain at least an @ sign and a dot (.). Also, the @ must not be the first character of the email address, and the last dot must at least be one character after the @ sign:
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false;}
else {return true;}
}
} The entire script, with the HTML form could look something like this:
<html>
<head>
<script type="text/javascript">
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false;}
else {return true;}
}
} function validate_form(thisform)
{
with (thisform)
{
if (validate_email(email,"Not a valid e-mail address!")==false)
{email.focus();return false;}
}
}
</script>
</head> <body>
<form action="submitpage.htm"
onsubmit="return validate_form(this);"
method="post">
Email: <input type="text" name="email" size="30">
<input type="submit" value="Submit">
</form>
</body> </html>


P.S.: If this information was helpful, please rate this solution.

Mar 13, 2009 | Sun Java Programming Language (cdj-275)

1 Answer

Macro code for copying a range of cells from one Excell w/sheet t


You did not respond to my claification request. Here is some code that might help, it copies a selection of cells going down until an emty cell is found and across until an emty cell is found. This is form an earlier version of office but should comeclose to woring in 2007.

Sub copyrange()
'
' copyrange Macro
' Macro written by Royal 11/22/2008.
'


'save the return values
wksname = ActiveSheet.Name
returncell = ActiveCell.Address
searchfor = ActiveCell.Value

'go to first worksheet and find entered value (note this is a value serach)
Worksheets(1).Activate
findfor = "A1"
On Error Resume Next

findfor = Cells.Find(What:=searchfor, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False).Address
If findfor = "A1" Then
erwks = ActiveSheet.Name
Sheets(wksname).Activate
er = MsgBox("Search item not found on Worksheet" + erwks, , "Search Error")
Exit Sub
Else
findfor.Activate
End If

Cells.FindNext(After:=ActiveCell).Activate

'save this address and start searching for copy area boundaries
begcell = ActiveCell.Address
begcl = ActiveCell.Cells.Column
begri = ActiveCell.Cells.Row
'search amaximum of 1000 rows and 676 columns
endri = begri + 1000
endcl = 26 * 26
maxrow = 0
maxcol = 0

For col = Cells.Column To endcl
If Cells(begri, col) = "" Then
maxcol = col
col = endcl
ri = endri
Else
ri = begri
End If
For ri = ri To (Cells.Row + 1000)
If Cells(ri, col) = "" Then
If ri > maxrow Then
maxrow = ri
End If
ri = endri
End If
Next ri
Next col

maxrow = maxrow - 1
maxcol = maxcol - 1

'copy the selected area
endcell = Cells(maxrow, maxcol).Address
crnge = begcell & ":" & endcell
Range(crnge).Select
Selection.Copy
'go back and paste it in
Sheets(wksname).Activate
Range(returncell).Select
' use this if yo want to paste formulas etc.
'ActiveSheet.Paste
' use this code if you want to paste values instead of formulas etc.
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range(returncell).Select

Nov 20, 2008 | Compilers & Programming Tools

1 Answer

MySQL data types


These are the types i know

1.VARCHARs with length less than 4 become CHARs
2.CHARs with length more than 3 become VARCHARs.
3.NOT NULL gets added to the columns declared as PRIMARY KEYs
4.Default values such as NULL are specified for each column

If there are more i'm sure folks around here will post them.

Aug 05, 2008 | Sun MySQL

1 Answer

MySQL Auto Increase


Try this -


CREATE TABLE users (
id MEDIUMINT NOT NULL AUTO_INCREMENT,
login TEXT NOT NULL,
password TEXT NOT NULL,
PRIMARY KEY( id )
);

INSERT INTO users VALUES ( null, 'bob', 'mypassword' );
INSERT INTO users VALUES ( null, 'bill', 'pass' );
INSERT INTO users VALUES ( null, 'sean', '1234' );

Aug 04, 2008 | Sun MySQL

Not finding what you are looking for?
Compilers & Programming Tools Logo

Related Topics:

33 people viewed this question

Ask a Question

Usually answered in minutes!

Top Compilers & Programming Tools Experts

Robin Hill
Robin Hill

Level 3 Expert

1251 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18297 Answers

Florin

Level 3 Expert

733 Answers

Are you a Compiler and Programming Tool Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...