This topic is locked

Type mismatch: '[string: 'foreach.header.first']'

11/27/2007 6:44:26 AM
ASPRunnerPro General questions
A
Atul author

I have written code like this bellow but it comes a error that---: Type mismatch: '[string: "foreach.header.first"]' :------

mainly the error is coming when i add red bold code. pls help me
My code is ....
<html>

<head>

<title>Emp. General Info</title>

<link REL="stylesheet" href="include/style.css" type="text/css">

</head>

{literal}

<style>

table { border-collapse: collapse}

td {

padding: 5px;

margin: 0px;

border-width: 1px;

border-style: solid;

border-color: #000000;

}

</style>

{/literal}

{include_if_exists file="include/header.asp"}
<p>{doevent name="PrintOnLoad"}</p>

<h1>Emp. General Info </h1>



{foreach from=$rowinfo item=row name=header}

{if $smarty.foreach.header.first}

Faculty: {$row.1vEmpName_value}

Institute: {$row.1vEducation_value}

{/if}

{/foreach}

<table align='center' width='95%' border='0' cellpadding=3 cellspacing=2>
<tr>

<!--{if $column1show}-->

<td class=blackshade>Emp. Name</td>

<td class=blackshade>Age</td>

<td class=blackshade>Sex</td>

<td class=blackshade>Education</td>

<td class=blackshade>Subject</td>

<td class=blackshade>Present Add</td>

<td class=blackshade>Permanent Add</td>

<td class=blackshade>Ph-Mob</td>

<td class=blackshade>Image</td>

<!--{/if}-->

</tr>

{foreach from=$rowinfo item=row}
<tr valign=top>

<td>

{$row.1vEmpName_value}

</td>

<td>

{$row.1vAge_value}

</td>

<td>

{$row.1vSex_value}

</td>

<td>

{$row.1vEducation_value}

</td>

<td>

{$row.1vSubject_value}

</td>

<td>

{$row.1vPresentAdd_value}

</td>

<td>

{$row.1vPermaAdd_value}

</td>

<td>

{$row.1vPh_Mob_value}

</td>

<td>

{$row.1vImage_value}

</td>
</tr>

{/foreach}

<!-- totals row -->

</table>

{include_if_exists file="include/footer.asp}

</body>
</html>
The error is like that..................
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "foreach.header.first"]'
/HRD_System/tblEmpInfo_print.asp, line 0

Sergey Kornilov admin 11/27/2007

The following line doesn't mean much:

{if $smarty.foreach.header.first}
A
Atul author 11/28/2007

The following line doesn't mean much:


{if $smarty.foreach.header.first}


First of all I want say you many many thanks for reviewing my message. Actually sir I am create a simple payroll system and I want to be HEADER like Division name, Section Name, Salary Month which will take from Database. Thats why i have use this code. My format is given bellow....
Garments Division

Month-September-2007
Section : Staff

--------------------------------------------------------------------------------

Name of Employee|Card ID|Designation|Joining Date|Working Days|

--------------------------------------------------------------------------------

xyz |001 |Asst.xyz |24-03-2001 |30 |

------------------------------------------------------------------------------ |

abc |002 |Asst.xyz |24-03-2001 |30 |

------------------------------------------------------------------------------ |

efg |003 |Asst.xyz |24-03-2001 |30 |

------------------------------------------------------------------------------ |
Pls sir help me

Thanks for your nice co-operation

Best Regards :

Atul

Sergey Kornilov admin 11/28/2007

Atul,
post your existing project to Demo Account and contact me directly at support@xlinesoft.com sending your order number.