#1
|
|||
|
|||
problem in use from visio viewer
hi
i in my project use from visio2007 for dispaly visio file using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.Design; namespace IEWebObjects { [ToolboxData("<{0}:ShowVisio runat=server></{0}:ShowVisio>")] public class ShowVisio : WebControl { #region "Declarations" private string mFilePath; #endregion #region "Properties" [Category("Source File")] [Browsable(true)] [Description("Set path to source file.")] [Editor(typeof(System.Web.UI.Design.UrlEditor), typeof(System.Drawing.Design.UITypeEditor))] public string FilePath { get { return mFilePath; } set { if(value == string.Empty) { mFilePath = string.Empty; } else { int tilde = -1; tilde = value.IndexOf('~'); if(tilde != -1) { mFilePath = value.Substring((tilde + 2)).Trim(); } else { mFilePath = value; } } } } // end FilePath property #endregion #region "Rendering" protected override void RenderContents(HtmlTextWriter writer) { try { StringBuilder sb = new StringBuilder(); sb.Append("<object classid=clsid:279D6C9A-652E-4833-BEFC-312CA8887857 id=vviewer "); sb.Append("codebase=http://download.microsoft.com/download/4/5/2/452f8090-413f-408f-83c0-edd66db786ee/vviewer.exe Width = " + 200 + " Height = " + 200 + " > "); sb.Append("<param name=SRC value=" + FilePath.ToString() + "> "); sb.Append("<param name=HighQualityRender value=1> "); sb.Append("<param name=BackColor value=#000000> "); sb.Append("<param name=PageColor value=#000000> "); sb.Append("<param name=PageVisible value=1> "); sb.Append("<param name=AlertsEnabled value=1> "); sb.Append("<param name=ContextMenuEnabled value=1> "); sb.Append("<param name=GridVisible value=1> "); sb.Append("<param name=PropertyDialogEnabled value=1> "); sb.Append("<param name=ScrollbarsVisible value=1> "); sb.Append("<param name=ToolbarVisible value=1> "); sb.Append("<param name=CurrentPageIndex value=1> "); sb.Append("<param name=Zoom value=-1> "); sb.Append("</object>"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write(sb.ToString()); writer.RenderEndTag(); } catch { // with no properties set, this will render "Display Visio Control" in a // a box on the page writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Display Visio Control"); writer.RenderEndTag(); } // end try-catch } // end RenderContents #endregion } // end class } // end namespace and in my page load create a instance from it and write this code : <cc1:ShowVisio ID="ShowVisio1" runat="server" /> and ShowVisio1.FilePath = @"D:\User\VisioFile\test1.vsd"; but when run it when open my browser IE ,just show a rectangle empty please help me for solve it thanks |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Format problem in ppt viewer | rybrns | PowerPoint | 4 | 01-19-2012 07:57 AM |
Powerpoint viewer 2010 problem | bernieraffe | PowerPoint | 0 | 12-22-2010 04:27 AM |
Viewer? | JoeBlack | Project | 1 | 12-08-2009 01:30 AM |
Power Point Viewer | sleuth | PowerPoint | 3 | 06-15-2009 04:51 AM |
Help: MS Project viewer | obenix | Office | 2 | 05-06-2005 01:28 AM |