繁体   English   中英

在Visual Studio 2008中从Crystal Report Viewer删除边框/背景

[英]Removing border/background from Crystal Report Viewer in Visual Studio 2008

有人可以解释一下如何从Visual Studio 2008中的嵌入式CrystalReportViewer控件中删除背景/边框。

我正在尝试删除浅灰色(在“晶体报告”标题下方),然后在其下方删除深灰色。 我想只留下白框和其中的报告。

这是我当前得到的输出:

http://img411.imageshack.us/my.php?image=screenshotml3.jpg

HTML代码段是:

<div>
 <h2>Crystal Report</h2>

    <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
    AutoDataBind="true" DisplayToolbar="False" />
</div>

C#代码段是:

string strReportName = "CrystalReport";
string strReportPath = Server.MapPath(strReportName + ".rpt");
ReportDocument rptDocument = new ReportDocument();
rptDocument.Load(strReportPath);
CrystalReportViewer1.HasCrystalLogo = false;
CrystalReportViewer1.HasDrilldownTabs = false;
CrystalReportViewer1.HasDrillUpButton = false;
CrystalReportViewer1.HasExportButton = false;
CrystalReportViewer1.HasGotoPageButton = false;
CrystalReportViewer1.HasPageNavigationButtons = false;
CrystalReportViewer1.HasPrintButton = false;
CrystalReportViewer1.HasRefreshButton = false;
CrystalReportViewer1.HasSearchButton = false;
CrystalReportViewer1.HasToggleGroupTreeButton = false;
CrystalReportViewer1.HasToggleParameterPanelButton = false;
CrystalReportViewer1.HasZoomFactorList = false;
CrystalReportViewer1.DisplayToolbar = false;
CrystalReportViewer1.EnableDrillDown = false;
CrystalReportViewer1.BestFitPage = true;
CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
CrystalReportViewer1.BackColor = System.Drawing.Color.Red;
CrystalReportViewer1.BorderColor = System.Drawing.Color.Green;
CrystalReportViewer1.CssClass
CrystalReportViewer1.Height = 200;
CrystalReportViewer1.Width = 500;
CrystalReportViewer1.ReportSource = rptDocument;

您的代码在Crystal Studios的Crystal Reports XI Release 2 Developer Edition(独立产品)中为我工作。 我没有可见的灰色条或背景。 实际上,报表本身的空白显示为分配的BackColor红色。 您是否在使用Visual Studio 2008附带的捆绑的CrystalReportViewer? 可能值得尝试将BorderStyle属性设置为BorderStyle.None,以查看是否有任何效果。

在MSDN上有一个关于自定义CrystalReportViewer控件的教程, 网址为: http : //msdn.microsoft.com/zh-cn/library/ms227538.aspx

这是VS2008 / .NET 3.5的版本,但是我不确定该教程与以前的版本实际发生了多少变化。

我有同样的问题。

这是由另一个CSS文件与控件的CSS文件冲突引起的。

制作完报告的主文件后,没有所有站点的CSS文件引用,背景和任务栏就很好了-它们具有白色背景。

尝试将DocumentView属性设置为WebLayout而不是PrintLayout:

代码隐藏

CrystalReportViewer.DocumentView = CrystalDecisions.Shared.DocumentViewType.WebLayout

Web.config文件

<configSections>
  <sectionGroup name="businessObjects">
    <sectionGroup name="crystalReports">
      <section name="printControl" type="System.Configuration.NameValueSectionHandler" />
      <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />
    </sectionGroup>
  </sectionGroup>
</configSections>
<businessObjects>
  <crystalReports>
    <crystalReportViewer>
      <add key="documentView" value="weblayout" />
    </crystalReportViewer>
  </crystalReports>
</businessObjects>

SAP注释1344534-如何更改Crystal Report Web查看器的documentView

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM