"External table is not in the expected format." typically occurs when trying to use an Excel 2007 file with a connection string that uses: Microsoft.Jet.OLEDB.4.0 and Extended Properties=Excel 8.0
Using the following connection string seems to fix most problems.
public static string path = @"C:\src\RedirectApplication\RedirectApplication\301s.xlsx";
public static string connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;HDR=Yes;IMEX=1;";
Search This Blog
Friday, August 19, 2011
Print Using Javascript.
function tablePrint(tblId)
{
var display_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
display_setting+="scrollbars=yes,width=750, height=600, left=100, top=25";
var lbtnPrint = document.getElementById('ctl00_CPHVmanage_FvVendorBillEntry_lbtnPrint');
lbtnPrint.style.display = 'none';
var content_innerhtml = document.getElementById(tblId).innerHTML;
var document_print = window.open("","",display_setting);
//document_print.document.open();
document_print.document.write('<html><head><title>Vendor Bill </title></head>');
document_print.document.write('<body onLoad="self.print();self.close();" >');
document_print.document.write(content_innerhtml);
document_print.document.write('</body>
{
var display_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
display_setting+="scrollbars=yes,width=750, height=600, left=100, top=25";
var lbtnPrint = document.getElementById('ctl00_CPHVmanage_FvVendorBillEntry_lbtnPrint');
lbtnPrint.style.display = 'none';
var content_innerhtml = document.getElementById(tblId).innerHTML;
var document_print = window.open("","",display_setting);
//document_print.document.open();
document_print.document.write('<html><head><title>Vendor Bill </title></head>');
document_print.document.write('<body onLoad="self.print();self.close();" >');
document_print.document.write(content_innerhtml);
document_print.document.write('</body>