我在数据库字段中保存了一些文本、以及字体格式(是RTF格式的),我想让它在报表中显示,有什么办法。
有没有一种控件,能在报表中显示RTF或DOC之类的文本。RTF格式的保存在数据库中是一种转译了的格式,如何才能让它正常显示。

解决方案 »

  1.   

    闭上眼睛顶一下.不能连续顶三次呀,真是气死人.//ResourceEnumerationScope枚举:Specifies a DWORD value that contains the scope of the enumeration.
    public enum ResourceEnumerationScope
    {
    RESOURCE_CONNECTED=0x00000001, /*Enumerate currently connected resources. The dwUsage member cannot be specified. */
    RESOURCE_GLOBALNET=0x00000002, /*Enumerate all resources on the network. The dwUsage member is specified. */
    RESOURCE_REMEMBERED=0x00000003 /*Enumerate remembered (persistent) connections. The dwUsage member cannot be specified. */
    } //ResourceType枚举:Specifies a DWORD value that contains a set of bit flags identifying the type of resource. 
    public enum ResourceType
    {
    RESOURCETYPE_ANY=0x00000000, /*All resources*/ 
    RESOURCETYPE_DISK=0x00000001, /*Disk resources*/ 
    RESOURCETYPE_PRINT=0x00000002 /*Print resources*/
    } //ResourceDisplayType枚举:Specifies a DWORD value that indicates how the network object should be displayed in a network browsing user interface. 
    public enum ResourceDisplayType
    {
    RESOURCEDISPLAYTYPE_DOMAIN=0x00000001, /*The object should be displayed as a domain. */
    RESOURCEDISPLAYTYPE_SERVER=0x00000002, /*The object should be displayed as a server. */
    RESOURCEDISPLAYTYPE_SHARE=0x00000003, /*The object should be displayed as a share. */
    RESOURCEDISPLAYTYPE_GENERIC=0x00000000 /*The method used to display the object does not matter. */
    } //ResourceUsage枚举:Specifies a DWORD value that contains a set of bit flags describing how the resource can be used. Note that this member can be specified only if the dwScope member is equal to RESOURCE_GLOBALNET. 
    public enum ResourceUsage
    {
    RESOURCEUSAGE_CONNECTABLE=0x00000001, /*The resource is a connectable resource; the name pointed to by the lpRemoteName member can be passed to the WNetAddConnection function to make a network connection. */
    RESOURCEUSAGE_CONTAINER=0x00000002 /*The resource is a container resource; the name pointed to by the lpRemoteName member can be passed to the WNetOpenEnum function to enumerate the resources in the container. */
    } //ConnectionOption枚举:Specifies a DWORD value that describes connection options. 
    public enum ConnectionOption
    {
    CONNECT_INTERACTIVE=0x00000008, /*If this flag is set, the operating system may interact with the user for authentication purposes. */
    CONNECT_PROMPT=0x00000010, /*This flag instructs the system not to use any default settings for user names or passwords without offering the user the opportunity to supply an alternative. This flag is ignored unless CONNECT_INTERACTIVE is also set. */
    CONNECT_REDIRECT=0x00000080, /*This flag forces the redirection of a local device when making the connection.
    If the lpLocalName member of NETRESOURCE specifies a local device to redirect, this flag has no effect, because the operating system still attempts to redirect the specified device. When the operating system automatically chooses a local device, the lpAccessName parameter must point to a return buffer and the dwType member must not be equal to RESOURCETYPE_ANY.
    If this flag is not set, a local device is automatically chosen for redirection only if the network requires a local device to be redirected.
    Windows XP: When the system automatically assigns network drive letters, letters are assigned beginning with Z:, then Y:, and ending with C:. This reduces collision between per-logon drive letters (such as network drive letters) and global drive letters (such as disk drives). Note that previous releases assigned drive letters beginning with C: and ending with Z:. */
    CONNECT_UPDATE_PROFILE=0x00000001, /*The network resource connection should be remembered. 
    If this bit flag is set, the operating system automatically attempts to restore the connection when the user logs on.
    The operating system remembers only successful connections that redirect local devices. It does not remember connections that are unsuccessful or deviceless connections. (A deviceless connection occurs when the lpLocalName member is NULL or points to an empty string.)
    If this bit flag is clear, the operating system does not automatically restore the connection at logon.*/
    CONNECT_COMMANDLINE=0x00000800, /*Windows XP: If this flag is set, the operating system prompts the user for authentication using the command line instead of a graphical user interface (GUI). This flag is ignored unless CONNECT_INTERACTIVE is also set.  */
    CONNECT_CMD_SAVECRED=0x00001000 /*Windows XP: If this flag is set, and the operating system prompts for a credential, the credential should be saved by the credential manager. If the credential manager is disabled for the caller's logon session, or if the network provider does not support saving credentials, this flag is ignored. This flag is also ignored unless you set the CONNECT_COMMANDLINE flag.  */
    }
    #endregion
      

  2.   

    图片到是可以,不过一般都是生成报表的时候直接生成doc rtf ,
      

  3.   

    CrystalDecisions.Shared.DiskFileDestinationOptions  DiskOpts=new CrystalDecisions.Shared.DiskFileDestinationOptions();
    mlmc.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
    mlmc.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows;
    DiskOpts.DiskFileName = "D://d.doc";
    mlmc.ExportOptions.DestinationOptions = DiskOpts;
    mlmc.Export();
      

  4.   

    图片和数据都可以显示的。不过你必须在你的报表里面有blob 字段 是显示图片 文字就更好办了。你可以动态的往里面写数据,图片必须转换成byte 然后再在给报表
      

  5.   

    TextObject gettextobject; gettextobject = Xunwen.ReportDefinition.ReportObjects["tabname"] as TextObject;
    gettextobject.Text="讯问笔录";
    报表动态给值
      

  6.   

    我把RTF或DOC之类内容用String型保存在表中。
    再在报表中显示字段。