- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我无法将值传递给报表。
这是我的代码:
public void GLRPT()
{
try
{
ReportClass rptH = new ReportClass();
rptH.FileName = Server.MapPath("~/Rpts/G1.rpt");
rptH.Load();
string df = Session["fromdate"].ToString();
string dt = Session["todate"].ToString();
DateTime fromdate = DateTime.Parse(df);
DateTime todate = DateTime.Parse(dt);
rptH.SetParameterValue("?Date_From", fromdate);
rptH.SetParameterValue("?Date_To", todate);
rptH.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "GL");
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
我不知道为什么会看到这个错误:
无效索引。 (HRESULT 异常:0x8002000B (DISP_E_BADINDEX))
最佳答案
我们应该像这样传递参数值:
rptH.SetParameterValue("Date_From", fromdate); //correct
不
rptH.SetParameterValue("?Date_From", fromdate); //incorrect
然后我们必须授予报告数据库访问权限,因为如果不登录数据库,报告将无法打开。这是代码:
ReportDocument rptH = new ReportDocument();
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
rptH.Load(Server.MapPath("~/Rpts/G1.rpt"));
string df = Session["fromdate"].ToString();
string dt = Session["todate"].ToString();
DateTime fromdate = DateTime.Parse(df);
DateTime todate = DateTime.Parse(dt);
rptH.SetParameterValue("Date_From", fromdate);
rptH.SetParameterValue("Date_To", todate);
crConnectionInfo.ServerName = "YOUR SERVER NAME";
crConnectionInfo.DatabaseName = "YOUR DATABASE NAME";
crConnectionInfo.UserID = "YOUR DATABASE USERNAME";
crConnectionInfo.Password = "YOUR DATABASE PASSWORD";
CrTables = rptH.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
rptH.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "GL");
We must call the parameter's name without any additional character such as @ or ?, just only the parameter's name itself.
关于asp.net-mvc - Crystal 报表 : Invalid index.(HRESULT 异常:0x8002000B (DISP_E_BADINDEX)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35862733/
是否可以创建一个 sql 语句来动态生成 3 行而无需任何表..这些将包括 value1 : 10 | value2: 10 value2 : 11 | value2: 11 value3 : 12
近日,葡萄城正式发布了SpreadJS最新版本 V17.1,为前端表格控件市场带来了一系列令人瞩目的新特性和功能增强。本次更新旨在进一步提升用户在计算引擎、报表生成和分析等方面的体验,为各行业的开发者
我正在使用 Visual Studio 的 Crystal 报告,我创建了一个需要有背景图像的报告。我找不到像 Microsoft Report Viewer Report 这样的背景图像的方法。有办
我正在开发一个使用 Crystal Reports 生成 pdf、excel 和 word 报告文件的大型 C# 项目。 项目位于 SVN 存储库下,我们有主干和一个单独的分支。 我们每周都会将主干合
我以正确的格式放置了我的 super 语句,但我唯一的错误是它指出类 java.lang.object 中的构造函数对象不能应用于这部分代码的给定类型: super (openFile
我正在使用 Visual Studio 2008 并希望在报告中显示以下 SQL 查询: select name, count(*) from mytable group by name; 我可以通过
我使用 C# 在我的 CR 上正确地导入了一个图像。现在我需要在同一页面上显示包含 4 种不同产品的报告,类似这样: | P1 | P2 | | P3 | P4 | 为此,我创建了一个报告并将选项 R
我正在使用 C#.net 2010,我想使用两个表创建发票。一个表 Order 包含客户订购的东西,如类别、数量、费率、总金额,另一个表 Details 包含最终支付金额的详细信息,如 Vat、Fin
我正在使用 C# 创建一个 Crystal Report,我必须在 320 个不同的参数中复制一个简单的公式,但始终具有相同的条件,如下所示: if ({Precios.AhorroE1}[1] =
我在 vs2010 中创建了一个项目,然后创建了一个已部署的安装项目。当我在我的 PC 上运行应用程序时,它显然运行良好,但对于客户端计算机,应用程序运行良好,除了 crystal报道。我制作了安装项
我正在使用 Visual Studio、.NET 创建一个使用 Crystal 报表的 Web 应用程序,除了手动拖放之外,有什么方法可以让我以有组织的方式格式化这些报表? 谢谢 最佳答案 是的,报告
我正在使用 Visual Studio 2010 创建一个使用 Crystal Reports 的 Web 应用程序。 我目前使用 odp.NET 连接到 oracle 数据库并且一切正常,当我通过
我在 Windows 窗体应用程序 C# 中有 mysql 数据库,我想使用 Crystal 报告进行报告,但我想在没有报告向导的情况下连接到数据库,因为我希望我的应用程序独立于数据库服务器地址,并且
我正在开发一个超过 200 个表的大项目,我使用 MySQL(Percona)、Java 和 Crystal Report JRC。我有一些报告非常大并且多个表之间有很多连接。在Java客户端中,我通
我有一份报告和一份带有法语国际化资源包的子报告。没有抛出任何错误或警告,但是当我使用此报告创建 pdf 时,出现奇怪的字符,因为编码错误(É 代表 é 是一个例子)。 我仍在调查那个问题,但我猜它与子
我在让 Crystal Reports 与我们的应用程序很好地协同工作时遇到了一些问题。而且我似乎找不到任何资源来回答我的问题。 基本上,我们有一个 Crystal 报表,在 Crystal 报表应用
我正在为 Winform 使用 VS 2008。我在元素中有 Crystal 报表,我想在 CSS 的帮助下对其进行格式化。 谁能给我指出正确的教程来开始这个? 最佳答案 Visual Studio
我是java和crysal报告的新手。两天以来,我尝试使用 java 和 jsf 创建 Crystal 报告 pdf。一切正常,但是当我在代码中包含参数传递时,出现错误 *HTTP Status 5
我是这个工具的新手,所以我不知道如何获取类的数据并显示在报告中。 我没有数据库,我的信息存储在类内的变量中。像这样(文件夹 Objetos): 我的程序执行以下操作:读取 XML、使用 XSD 验证、
我需要在只有一个独立数据集(未连接到任何类型的数据库)的应用程序中使用 Crystal Reports 生成报告。此外,我需要根据 DataTable 中的值生成报告。 你能帮我看看吗,我是新手。我有
我是一名优秀的程序员,十分优秀!