小弟才开始接触水晶报表,想找个在winform和webform下的水晶报表示例,简单明了的,越基础越好,谢谢!!!!!
解决方案 »
- webbrowser 控件发送POST数据老是失败!
- serialport的datareceived事件响应次数有问题
- c# access数据库,字段自动编号
- 请高手写一个正则表达式,关于日期年月日验证的??
- 自己如何规划空间,自己若规划空间,如何将空间分级或分层呢?解决方案是顶空间吗?例如,在C#开发环境中,如何在当前顶级项目空间namespaceGl下添加子空间GyG呢,即成为namespaceGl.GyG?
- 请各位帮我看看这个功能为什么实现不了?
- C#中怎样循环打开一个不同参数的网址
- 请问一下如何让系统放弃现有的显示布局,重新绘制!
- 高手请进:如何用 gdi+ 实现 winform 类似任务管理器中的cpu占有率图或者内存使用率图,多谢了,向你致敬
- 关于在精简版中DataTable的Select方法的问题?
- 怎样获取表中的数据信息呀
- winform 处理datagrid:如何屏蔽某一行中的按钮控件
[email protected]
mail: [email protected]
謝謝!!!
[email protected]
[email protected]
Mail:[email protected]
mail: [email protected]謝謝!!!
mail: [email protected]謝謝!!!
mail: [email protected]謝謝!!!
我在这里谢谢高手了。
mail:[email protected]
我不晓得哪里出了问题,请各位指点!!!谢谢!!
crConnectionInfo = crReportDocument.Database.Tables[0].LogOnInfo.ConnectionInfo; /* Populate the ConnectionInfo Objects Properties with the appropriate values for
the ServerName, User ID, Password and DatabaseName. However, since Oracle
works on Schemas, Crystal Reports does not recognize or store a DatabaseName.
Therefore, the DatabaseName property must be set to a BLANK string. */
crConnectionInfo.DatabaseName = "";
crConnectionInfo.ServerName = "Your Server Name";
crConnectionInfo.UserID = "Your User ID";
crConnectionInfo.Password = "Your Password"; //Set the CrDatabase Object to the Report's Database
crDatabase = crReportDocument.Database; //Set the CrTables object to the Tables collection of the Report's dDtabase
crTables = crDatabase.Tables; //Loop through each Table object in the Tables collection and apply the logon info
//specified ealier. Note this sample only has one table so the loop will only execute once
foreach (Table crTable in crTables)
{
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo (crTableLogOnInfo); // if you wish to change the schema name as well, you will need to set Location property as follows:
// crTable.Location = "<new schema name>." + crTable.Name;
} //Set the ReportSource of the CrystalReportViewer to the strongly typed Report included in the project
crystalReportViewer1.ReportSource = crReportDocument; 还有一点要注意:
如果你用到了子报表,一定要处理://Go through each sections in the main report and identify the subreport by name
crSections = crReportDocument.ReportDefinition.Sections; foreach(Section crSection in crSections)
{
crReportObjects = crSection.ReportObjects;
//loop through all the report objects to find all the subreports
foreach(ReportObject crReportObject in crReportObjects)
{
if (crReportObject.Kind == ReportObjectKind.SubreportObject)
{
//you will need to typecast the reportobject to a subreport
//object once you find it
crSubreportObject = (SubreportObject)crReportObject; //open the subreport object
crSubReportDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
//Once the correct subreport has been located pass it the
//appropriate dataset
if(crSubReportDoc.Name == "FirstSub")
{
//crSubReportDoc.Database.Tables[0].SetDataSource(ds);
crSubReportDoc.SetDataSource(ds);
}
}
}
}
crystalReportViewer1.ReportSource = crReportDocument;同样crSubReportDoc.SetDataSource(ds);改为:crSubReportDoc.SetDataSource(ds.Tables["tablename"]);
不好意思,小弟真的愚吨请问什么是推模式什么是拉模式,有这方面的资料吗?拜托了!!!!
[email protected]
为了向开发人员提供最灵活的数据访问方法,Crystal Reports 数据库驱动程序被设计为可同时提供数据访问的拉模型和推模型。 拉模型
在拉模型中,驱动程序将连接到数据库并根据需要将数据“拉”进来。使用这种模型时,与数据库的连接和为了获取数据而执行的 SQL 命令都同时由 Crystal Reports 本身处理,不需要开发人员编写代码。如果在运行时无须编写任何特殊代码,则使用拉模型。推模型
相反,推模型需要开发人员编写代码以连接到数据库,执行 SQL 命令以创建与报表中的字段匹配的记录集或数据集,并且将该对象传递给报表。该方法使您可以将连接共享置入应用程序中,并在 Crystal Reports 收到数据之前先将数据筛选出来。
具体的你到论坛搜索一下,很容易找到的.
[email protected]
谢谢前辈了!
终于有人问这个问题了,流泪呀
[email protected]
Email:[email protected]