locked
Asp.net exporting to microsoft word images not exporting RRS feed

  • Question

  • User594837732 posted

    Hi,

    I had some custom software built by a friend of a friend and there was one bug that we never got round to sorting when i export a certain page to word all the static text and text from text boxes export but the only image does not. All i get on word is a little red x where the pic should be.

    I have read on various sites that this is because the image link should be a www web link and not a location of the file on the server ../images/image.jpg

    Problem is i would not really know where to find this in the code, one section where i found the code i changed the image link and it did not work. I am not sure if it was the code controlling the export to word though.

    Is there a standard piece of code that should controll export to word that i should be looking for.

    Many Thanks,

    Adam



    Here is the two files that seem to control the page that is exported.


    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewFACertificate.aspx.cs" Inherits="Tasks_NewSite" %> <%@ Register Src="../Includes/header.ascx" TagName="header" TagPrefix="uc4" %> <%@ Register Src="../Includes/MainMenu.ascx" TagName="MainMenu" TagPrefix="uc3" %> <%@ Register TagPrefix="uc1" TagName="footer" Src="../includes/footer.ascx" %> <%@ Register TagPrefix="uc1" TagName="LeftNav" Src="../Includes/LeftNav.ascx" %> <%@ Register assembly="eWorld.UI" namespace="eWorld.UI" tagprefix="ew" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >  <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title>New Fire Alarm Certificate</title>     <link href="../Images/StyleSheet.css" rel="stylesheet" />     <script type="text/javascript">            function pageLoad() {       }          </script>     <style type="text/css">   p.MsoNormal 	{margin-bottom:.0001pt; 	font-size:10.0pt; 	font-family:"Times New Roman","serif"; 	        margin-left: 0in;             margin-right: 0in;             margin-top: 0in;         }         .style2         {             font-family: Tahoma;             font-style: normal;             font-weight: normal;             font-size: 11px;             height: 12px;         }     </style> </head> <body>     <form id="form1" runat="server">     <div>         <asp:ScriptManager ID="ScriptManager1" runat="server" />     </div>     <uc4:header ID="Header2" runat="server" />         <table id="Table2" cellspacing="0" cellpadding="0" width="100%" border="0">             <tr>                 <td valign="top" width="180" background="../ImagesNew/left_menu_BG.gif">                     <uc1:LeftNav ID="LeftNav1" runat="server"></uc1:LeftNav>                 </td>                 <td valign="top">                     <table border="0" cellpadding="1" cellspacing="1" summary="This table contains form title. e.g. New Marketing Campaign."                         width="100%">                         <tr>                             <td class="contentHead">                                 <uc3:MainMenu ID="MainMenu1" runat="server" />                             </td>                         </tr>                     </table>                     <table align="center" id="Table1" border="0" cellpadding="0" cellspacing="0" width="98%"                         bgcolor="#ffffff">                         <tr>                             <td colspan="2" class="windowHeaderBG" height="28">                                  </td>                             <td align="right" class="windowHeaderBG" height="28">                                 <img src="../ImagesNew/Panels/Panle-header-2.gif" /></td>                         </tr>                         <tr>                             <td width="6" align="left" class="LeftBorder">                             </td>                             <td>                                                                              <table id="Table8" cellspacing="1" cellpadding="1" width="100%"                                      border="0" bgcolor="#ffffff">                                 <tr>                                     <td class="contentHead">                                           Fire Alarm Certificate                                                                                    <img align="left" src="../Images/heading_line.gif" />                                         <asp:HyperLink ID="hlinkBack" runat="server" CssClass="contentBody"                                              NavigateUrl="#">Back</asp:HyperLink>                                     </td>                                 </tr>                                 </table>                                                                         <table id="Table3" cellspacing="1" cellpadding="1"                                                  width="100%" border="0" bgcolor="#ffffff"                                             align="left">                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     <img alt="CFS" src="http://localhost/Images/cfs.JPG" style="width: 300px; height: 81px" /></td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     <p align="center" class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;text-align:center">                                                         <b style="mso-bidi-font-weight:normal"><span lang="EN-GB"                                                              style="font-size:12.0pt;font-family:"Arial","sans-serif"">                                                         FIRE ALARM<o:p></o:p></span></b></p>                                                     <p align="center" class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;text-align:center">                                                         <b style="mso-bidi-font-weight:normal"><span lang="EN-GB"                                                              style="font-size:12.0pt;font-family:"Arial","sans-serif"">                                                         INSPECTION AND SERVICING CERTIFICATE<o:p></o:p></span></b></p>                                                 </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     Certificate No:                                                     <asp:Label ID="lblCertificateNo" runat="server" style="font-weight: 700"></asp:Label>                                                 </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     Customer:                                                     <asp:Label ID="lblCustomerName" runat="server" style="font-weight: 700"></asp:Label>                                                 </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     <span lang="EN-GB" style="font-size:8.0pt;font-family: "Arial","sans-serif";mso-fareast-font-family:"Times New Roman";mso-ansi-language: EN-GB;mso-fareast-language:EN-US;mso-bidi-language:AR-SA">Certificate of Inspection for the fire alarm system at:</span></td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     Address:                                                     <asp:Label ID="lblAddress" runat="server" style="font-weight: 700"></asp:Label>                                                 </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                                                                                                                                      I/we being the competent person(s) responsible (as indicated by my/our                                                          signatures below) for the servicing of the fire alarm system, particulars of                                                          which are set out below. CERTIFY that the said work for which I/we have been                                                          responsible complies to the best of my/our knowledge and belief with the                                                          recommendations of Clause <b>45 </b>of BS 5839-1:2002 inspection of vented                                                          batteries/periodic inspection and test/inspection, except for the variations, if                                                          any, stated in this certificate.                                                      </p>                                                 </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     <table class="contentBody" width="100%">                                                         <tr>                                                             <td>                                                                 Name: </td>                                                             <td>                                                                 <asp:TextBox ID="txtName" runat="server" Width="200px" CssClass="contentBody"></asp:TextBox>                                                             </td>                                                             <td>                                                                 Position: </td>                                                             <td>                                                                 <asp:TextBox ID="txtPosition" runat="server" Width="200px"                                                                      CssClass="contentBody"></asp:TextBox>                                                             </td>                                                         </tr>                                                         <tr>                                                             <td>                                                                 Signature: </td>                                                             <td>                                                                 <asp:TextBox ID="txtSignature" runat="server" Width="200px"                                                                      CssClass="contentBody"></asp:TextBox>                                                             </td>                                                             <td>                                                                 Date: </td>                                                             <td>                                     <ew:calendarpopup id="calStartDate" runat="server" cssclass="contentBody"                                                          Culture="English (United Kingdom)" Text="..."> <SelectedDateStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"></SelectedDateStyle>  <MonthHeaderStyle BackColor="SteelBlue" Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="White"></MonthHeaderStyle>  <WeekdayStyle BackColor="White" Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"></WeekdayStyle>  <HolidayStyle BackColor="White" Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"></HolidayStyle>  <GoToTodayStyle BackColor="White" Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"></GoToTodayStyle>  <OffMonthStyle BackColor="AntiqueWhite" Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Gray"></OffMonthStyle>  <WeekendStyle BackColor="LightGray" Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"></WeekendStyle>  <ClearDateStyle BackColor="White" Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"></ClearDateStyle>  <DayHeaderStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"></DayHeaderStyle>  <TodayDayStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"></TodayDayStyle>                                         <ButtonStyle CssClass="contentBody" />                                         <TextboxLabelStyle CssClass="contentBody" /> </ew:calendarpopup>                                                             </td>                                                         </tr>                                                     </table>                                                 </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="style2">                                                     For and on behalf of: CFS Fire & Security</b></td>                                             </tr>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     Address: <b>5 Churchtown, St Newlyn East, Newquay, Cornwall, TR8 5LQ</b></td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     The extent of liability of the signatory is limited to the system described                                                      below.</td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     Extent of system covered by this certificate: (Brief description of areas tested                                                      or tick relevant box below)</td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     <asp:TextBox ID="txtDetails" runat="server" Height="100px" TextMode="MultiLine"                                                          Width="100%" CssClass="contentBody"></asp:TextBox>                                                 </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     <asp:CheckBox ID="chkQuarterly" runat="server" />  Quarterly</td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     <asp:CheckBox ID="chkSemiAnnaul" runat="server" />  Semi-Annual</td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     <asp:CheckBox ID="chkAnnaual" runat="server" />  Annual</td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     Variations from the recommendations of Clause 45 of BS 5839-1:2002 for periodic                                                      or annual inspection and test (as applicable):</td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                     <asp:TextBox ID="txtRecommendations" runat="server" Height="50px"                                                          TextMode="MultiLine" Width="100%" CssClass="contentBody"></asp:TextBox>                                                 </td>                                             </tr>                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                                                                                                                                                                                                             <tr>                                                 <td class="contentBody">                                                     <span lang="EN-GB" style="font-size:8.0pt;font-family: "Arial","sans-serif";mso-fareast-font-family:"Times New Roman";mso-ansi-language: EN-GB;mso-fareast-language:EN-US;mso-bidi-language:AR-SA">                                                     <asp:CheckBox ID="chkRelevantDetail" runat="server" />  Relevant details of the work carried out and faults identified have been entered in the system log book.</span></td>                                             </tr>                                                                                                                                                                                                                             <tr>                                                 <td class="contentBody">                                                      </td>                                             </tr>                                                                                                                                                                                                                             <tr>                                                 <td class="contentBody" valign="middle">                                                     During the past 12 months                                                     <asp:TextBox ID="txtFalseAlarm" runat="server" Width="30px"></asp:TextBox>  false alarm  have occurred.</td>                                             </tr>                                                                                                                                                                                                                             <tr>                                                 <td class="contentBody" valign="middle">                                                      </td>                                             </tr>                                                                                                                                                                                                                             <tr>                                                 <td class="contentBody" valign="middle">                                                     The following work/action is considered necessary:</td>                                             </tr>                                                                                                                                                                                                                             <tr>                                                 <td class="contentBody" valign="middle">                                                     <asp:TextBox ID="txtActions" runat="server" Height="50px" TextMode="MultiLine"                                                          Width="100%" CssClass="contentBody"></asp:TextBox>                                                 </td>                                             </tr>                                                                                                                                                                                                                             <tr>                                                 <td class="contentBody">                                                     <asp:Button ID="btnFinish" runat="server" CssClass="contentBody"                                                          onclick="btnFinish_Click" Text="Save & Print >>" Width="100px" />                                                 </td>                                             </tr>                                                                                                                                                                                                                         </table>                                                                                                   </td>                             <td width="3" align="left" class="rightBorder">                             </td>                         </tr>                         <tr>                             <td valign="top" class="windowFooterBG">                                 <img alt="" src="../ImagesNew/Panels/Panle-footer-1.gif" /></td>                             <td class="windowFooterBG">                                  </td>                             <td valign="top" align="right" class="windowFooterBG">                                 <img src="../ImagesNew/Panels/Panle-footer-2.gif" /></td>                         </tr>                     </table>                 </td>                 <td valign="top" align="center">                  </td>             </tr>             <tr>                 <td colspan="2" valign="top">                     <uc1:footer ID="Footer1" runat="server" />                 </td>                 <td align="center" valign="top">                 </td>             </tr>         </table>     </form>     </form> </body> </html>

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BMS.Classes; using System.Data.SqlClient; using System.Data;  public partial class Tasks_NewSite : System.Web.UI.Page {     protected void Page_Load(object sender, EventArgs e)     {         if (Session["UserType"] == null) Response.Redirect("../index.aspx");         btnFinish.Enabled = new Utils().getSecurityModuelslevel(Convert.ToInt32(Session["UserID"]), "Site Certificates", "CanUpdate"); ; 	          if (!IsPostBack)         {             if (Request.Params["FACID"] != null)             {                 DbManager dbManager = new DbManager();                 SqlParameter[] param =  					{ 						dbManager.makeInParam("@FACID", SqlDbType.Int , 4, Convert.ToInt32(Request.Params["FACID"])) 					 					};                 SqlDataReader dr = new DbManager().GetDataReader("GetFACertificateByID", param);                  if (dr.Read())                 {                     txtName.Text = dr["Name"].ToString();                     lblCertificateNo.Text = dr["CertificateNumber"].ToString();                     txtPosition.Text = dr["Postion"].ToString();                     txtSignature.Text = dr["Signature"].ToString();                     calStartDate.SelectedDate = Convert.ToDateTime(dr["Date"]);                     txtDetails.Text = dr["Details"].ToString();                     chkQuarterly.Checked = Convert.ToBoolean(dr["Quarterly"]);                     chkSemiAnnaul.Checked = Convert.ToBoolean(dr["SemiAnnual"]);                     chkAnnaual.Checked = Convert.ToBoolean(dr["Annual"]);                     chkRelevantDetail.Checked = Convert.ToBoolean(dr["RelevantWork"]);                     txtFalseAlarm.Text = dr["FalseAlarm"].ToString();                     txtRecommendations.Text = dr["Recommendations"].ToString();                     txtActions.Text = dr["Actions"].ToString();                                      }                              }             hlinkBack.NavigateUrl = "SiteCertificates.aspx?SiteID=" + Request.Params["SiteID"];          }                              SqlDataReader dr2 = new ClientManager().GetClientSite(Convert.ToInt32(Request.Params["SiteID"]));           if (dr2.Read())         {             lblCustomerName.Text = dr2["AccountName"].ToString();             lblAddress.Text = dr2["Address"].ToString() + " " + dr2["Address2"].ToString() + ", " + dr2["City"].ToString() + ", " + dr2["County"].ToString() + ", " + dr2["PostCode"].ToString();          }      }      protected void btnFinish_Click(object sender, EventArgs e)     {         int intFACertificateID = 0;         string strCertificateNumber = "";          if (Request.Params["FACID"] != null)         {              intFACertificateID = new ClientManager().UpdateFireAlarmCertificate(                 Convert.ToInt32(Request.Params["FACID"]), txtName.Text, txtPosition.Text, txtSignature.Text,                 calStartDate.SelectedDate, txtDetails.Text, Convert.ToInt32(chkQuarterly.Checked), Convert.ToInt32(chkSemiAnnaul.Checked),                 Convert.ToInt32(chkAnnaual.Checked), Convert.ToInt32(chkRelevantDetail.Checked), txtFalseAlarm.Text, txtRecommendations.Text, txtActions.Text);              strCertificateNumber = lblCertificateNo.Text;          }         else         {              intFACertificateID = new ClientManager().AddFireAlarmCertificate(                 Convert.ToInt32(Request.Params["SiteID"]), txtName.Text, txtPosition.Text, txtSignature.Text,                 calStartDate.SelectedDate, txtDetails.Text, Convert.ToInt32(chkQuarterly.Checked), Convert.ToInt32(chkSemiAnnaul.Checked),                 Convert.ToInt32(chkAnnaual.Checked), Convert.ToInt32(chkRelevantDetail.Checked), txtFalseAlarm.Text, txtRecommendations.Text, txtActions.Text, Convert.ToInt32(Session["UserID"]));               strCertificateNumber = "FAS-" + string.Format("{0:000}", intFACertificateID);               DbManager dbmanager = new DbManager();             SqlParameter[] param =  					{ 						dbmanager.makeInParam("@AutoNumber", SqlDbType.VarChar , 100, strCertificateNumber),                         dbmanager.makeInParam("@FACertificateID", SqlDbType.Int , 4, intFACertificateID)                      };              int result = dbmanager.RunProc("UpdateFACAutoNumber", param);          }          string strQuarterly = "";         if (chkQuarterly.Checked) strQuarterly = "Checked";          string strSemiAnnual = "";         if (chkSemiAnnaul.Checked) strSemiAnnual = "Checked";          string strAnnual = "";         if (chkAnnaual.Checked) strAnnual = "Checked";          string strRelevantInfo = "";         if (chkRelevantDetail.Checked) strRelevantInfo = "Checked";          string str= "";         str = str + "<html><body><head><style>Body{font-family:Arial;font-size:11px;}</style></head><div><table id='Table33' cellspacing='0' cellpadding='2'  width='800px' border='0' bgcolor='#ffffff' align='left'>";                                              str = str + "<tr>";                                                 str = str + "<td>";                                                 str = str + "<img alt='CFS' src='http://localhost:4255/CRMvs2008/Images/cfs.JPG' style='width: 300px; height: 81px' /></td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                             str = str + "<td><p align=center><strong><big> <big>FIRE ALARM <br><br>INSPECTION  AND SERVICING CERTIFICATE</big></big></strong></p><br>";                                                 str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>";                                                     str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                             str = str + "<td>Certificate No: <b>" + strCertificateNumber + "</b></td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>Customer: <b>" + lblCustomerName.Text + "</b></td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>Certificate of Inspection for the fire alarm system at:</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>Address: <b>" + lblAddress.Text + "</b>";                                                                                                                                                     str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>";                                                     str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                             str = str + "<td style='font-size:11px;font-family:Arial;'><br>I/we being the competent person(s) responsible (as indicated by my/our signatures below) for the servicing of the fire alarm system, particulars of which are set out below. CERTIFY that the said work for which I/we have been responsible complies to the best of my/our knowledge and belief with the recommendations of Clause <b>45 </b>of BS 5839-1:2002 inspection of vented batteries/periodic inspection and test/inspection, except for the variations, if any, stated in this certificate.<br><br>";                                                      str = str + "</p>";                                                 str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td align='left'><br>";                                                 str = str + "<table cellspacing='0' cellpadding='2' align='left' width='100%'>";                                                         str = str + "<tr>";                                                         str = str + "<td>Name: <b>" + txtName.Text;                                                                  str = str + "</b></td>";                                                             str = str + "<td>";                                                                                                                              str = str + "</td>";                                                             str = str + "<td>Position:<b>" +txtPosition.Text;                                                                  str = str + "</b></td>";                                                             str = str + "<td>";                                                                                                                              str = str + "</td>";                                                         str = str + "</tr>";                                                         str = str + "<tr>";                                                         str = str + "<td>Signature:<b>" + txtSignature.Text;                                                                  str = str + "</b></td>";                                                             str = str + "<td>";                                                                                                                              str = str + "</td>";                                                             str = str + "<td>Date:<b>" + calStartDate.SelectedDate.ToString("d/MM/yyyy");                                                                  str = str + "</b></td>";                                                             str = str + "<td>";                                                             str = str + "</td>";                                                         str = str + "</tr>";                                                     str = str + "</table>";                                                 str = str + "</td>";                                             str = str + "</tr>";                                              str = str + "<tr>";                                                 str = str + "<td class='style2'><br>For and on behalf of: <b>CFS Fire & Security</b></td>";                                             str = str + "</tr>";                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     str = str + "<tr>";                                                 str = str + "<td>";                                                     str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td><br>Address: <b>5 Churchtown, St Newlyn East, Newquay, Cornwall, TR8 5LQ</b></td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>";                                                     str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td><br>The extent of liability of the signatory is limited to the system described below.</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                             str = str + "<td>";                                                     str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>";                                                    str = str +  "<br>Extent of system covered by this certificate: (Brief description of areas tested ";                                                    str = str +  "or tick relevant box below)</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td><b>" + txtDetails.Text;                                                     str = str + "</b></td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>";                                                                                                      str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>";                                                     str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td><table><tr><td><input type='checkbox' name='checkbox1'  " + strQuarterly  + " /></td><td>Quarterly</td></tr></table>";                                                  str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                             str = str + "<td><table><tr><td><input type='checkbox' name='checkbox2' value='checkbox' "+  strSemiAnnual + "/></td><td>Semi-Annual</td></tr></table>";                                                                                                      str = str + "</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                             str = str + "<td><table><tr><td><input type='checkbox' name='checkbox3' value='checkbox' " + strAnnual + "/></td><td>Annual</td></tr></table>";                                                                                                     str = str + " </td>";                                             str = str + "</tr>";                                              str = str + "<tr>";                                                 str = str + "<td>";                                                     str = str + "Variations from the recommendations of Clause 45 of BS 5839-1:2002 for periodic ";                                                     str = str + "or annual inspection and test (as applicable):</td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td><b>" + txtRecommendations.Text;                                                                                                      str = str + "</b></td>";                                             str = str + "</tr>";                                             str = str + "<tr>";                                                 str = str + "<td>";                                                     str = str + "</td>";                                             str = str + "</tr>";                                                                                                                                                                                                                             str = str + "<tr>";                                             str = str + "<td><table><tr><td><input name='checkbox' type='checkbox' value='checkbox' " + strRelevantInfo + "/></td><td>";                                                                                                                                                      str = str + "Relevant details of the work carried out and faults identified have been entered in the system log book.</td></tr></table>";                                             str = str + "</tr>";                                                                                                                                                                                                                             str = str + "<tr>";                                                 str = str + "<td>";                                                     str = str + "</td>";                                             str = str + "</tr>";                                                                                                                                                                                                                             str = str + "<tr>";                                                 str = str + "<td valign='middle'>";                                                     str = str + "<br>During the past 12 months <b>" + txtFalseAlarm.Text + "</b> false alarm have occurred.</td>";                                             str = str + "</tr>";                                                                                                                                                                                                                             str = str + "<tr>";                                                 str = str + "<td valign='middle'>";                                                     str = str + "</td>";                                             str = str + "</tr>";                                                                                                                                                                                                                             str = str + "<tr>";                                                 str = str + "<td valign='middle'>";                                                     str = str + "<br>The following work/action is considered necessary:</td>";                                             str = str + "</tr>";                                                                                                                                                                                                                             str = str + "<tr>";                                                 str = str + "<td valign='middle'><b>" +txtActions.Text;                                                  str = str + "</b></td>";                                             str = str + "</tr>";                                                                                                                                                                                                                                                                                                                                 str = str + "</table></div></body></HTML>";                                     string fileName = "FireAlarmCertificate.doc";         Response.AppendHeader("Content-Type", "application/word");         Response.AppendHeader ("Content-disposition", "attachment; filename="+ fileName);         Response.Write(str);     } }


    Sunday, January 10, 2010 12:51 PM

All replies

  • User594837732 posted

    Solved


    Sunday, January 10, 2010 6:26 PM
  • User-1381043622 posted

    Hi,

    Can you please tell me, how did you solve it ? I am having the same issue.


    Thanks,

    Pervaiz.

    Friday, November 26, 2010 2:35 AM