ASP中如何调用水晶报表?能给出一个比较简单的例子吗?

xuehf 2003-10-10 08:54:10
ASP中如何调用水晶报表?

有没有比较简单的例子?
水晶报表中自带的那个太复杂,而且又不能运行?

我现在想实现的功能是:

数据库表tbluser
noid 编号
usercode 用户代码
username 用户名称

记录如下:

noid usercode username
1 zs 张三
2 ls 李四

我想实现如下的报表
用户代码:__________
用户名称:__________

ASP中根据request("noid")的值从表中找出相应的记录,填到对应的表格中。请问如何实现?




...全文
67 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
wzh815 2003-11-04
  • 打赏
  • 举报
回复
谢谢,非常感谢。
yonghengdizhen 2003-10-10
  • 打赏
  • 举报
回复
ActiveReport我不知道,没用过
xuehf 2003-10-10
  • 打赏
  • 举报
回复
水晶报表web用起来太复杂,那我想问一下,用ActiveReport能不能实现以上的功能?
yonghengdizhen 2003-10-10
  • 打赏
  • 举报
回复
rptServer.asp是有很多不必要的代码,它考虑了太多客户端兼容性的问题..

但是,如果需要自己重写rptServer.ASP中对于ActiveX Viewer部分支持的代码需要对于rdc对象模型有很深刻的理解,且部分对象crystal 不提供对象参考,因此是非常困难的.

你需要的是理解那一部分的实现,并直接使用它.


真正的外部框架在其余文件中,rptserver.asp只是提供数据渲染及数据分页功能,并不提供数据的存取.因此该文件是不能独立运行的(如果你的目的只是数据导出,提供一定的输入参数也可以实现,但并不会出现任何界面)
xuehf 2003-10-10
  • 打赏
  • 举报
回复
期待高手
yangsm 2003-10-10
  • 打赏
  • 举报
回复
没用过。帮一下!
xuehf 2003-10-10
  • 打赏
  • 举报
回复
水晶报表自带的那个我不能运行
它取的数据是来自rptServer.asp文件,那里面有太多的东西,而且又不能运行
最好是写一个特别简单的就好了
yonghengdizhen 2003-10-10
  • 打赏
  • 举报
回复
cr自带的那个可是最简单的框架了.有什么疑问
piccologoo 2003-10-10
  • 打赏
  • 举报
回复
<%@ LANGUAGE="VBSCRIPT" %>
<%
'Version:01.00.0009.0003
%>
<!-- #include file="INC\Common.inc" -->
<title>PrintEnvelope</title>
<%
dim strConMasterId,strVal
dim objMaster,recMaster
set objMaster = Server.CreateObject("ContactMaster.clsMaster")
set recMaster = Server.CreateObject("adodb.recordset")
set recMaster=objMaster.GetAllContact(2,0,Session("txtComName"),Session("txtCEName"),Session("txtKind"),Session("txtCreateDate"),Session("txtCreateDate2"))


for i=0 to recMaster.RecordCount-1
if cstr(Session("isSelectAllMail"))="1" then
if cstr(Session("shouldClearMailDisSelectAll"))="1" and cstr(Session("isReallySelectAllMail"))="1" then
Session("MailDisSelected")=""
strConMasterId = strConMasterId & trim(cstr(recMaster("ContactID"))) & ";"
elseif isThisOneHasBeenSelected(recMaster("ContactID"),0) then
strConMasterId = strConMasterId & trim(cstr(recMaster("ContactID"))) & ";"
elseif isThisOneHasBeenDisSelected(recMaster("ContactID"), 0) then
else
strConMasterId = strConMasterId & trim(cstr(recMaster("ContactID"))) & ";"
end if
elseif cstr(Session("isDisSelectAllExport"))="1" then
if isThisOneHasBeenSelected(recMaster("ContactID"), 0) then
strConMasterId = strConMasterId & trim(cstr(recMaster("ContactID"))) & ";"
end if
elseif isThisOneHasBeenSelected(recMaster("ContactID"), 0) then
strConMasterId = strConMasterId & trim(cstr(recMaster("ContactID"))) & ";"
elseif isThisOneHasBeenDisSelected(recMaster("ContactID"), 0) then
else
end if
recMaster.MoveNext
next

if len(trim(strConMasterId)) = 0 then
Response.Write "<script language=javascript>alert('請至少選擇一條紀錄.');window.close();</script> "
Response.End
end if

'if isEmpty(Session("MailSelected"))=true then
' Response.Write "<script language=javascript>alert('請至少選擇一條紀錄.');window.close();</script> "
' Response.End
'elseif Session("MailSelected")="" then
' Response.Write "<script language=javascript>alert('請至少選擇一條紀錄.');window.close();</script> "
' Response.End
'end if



'strConMasterId = Session("MailSelected")

strConMasterId = Mid(strConMasterId,1,len(strConMasterId)-1)
strConMasterId =Replace(strConMasterId,";",",")
strVal = Request.QueryString("RptStyle")
if strVal ="0" then
reportname = "rptConMaster.rpt" '23*11.5(cm)規格
else
reportname = "rptConMasterBig.rpt" '27*18.6(cm)規格
end if

%>

<!-- #include file="AlwaysRequiredSteps.asp" -->


<%
strDSN ="ContactMaster"
session("User_ID") ="sa"
session("PWD") ="ip3"

Set ReportDatabase = session("oRpt").Database
set crdatabasetables = ReportDatabase.Tables
set crtable1 = crdatabasetables.Item(1)

crtable1.SetLogonInfo strDSN,,session("User_ID"),session("PWD")

strsql = "select contactId from conEnvelope where contactid in(" & strConMasterId & ")"
'response.end
session("oRpt").SQLQueryString = strsql
'response.write("ok")
'response.end
%>

<!-- #include file="MoreRequiredSteps.asp" -->

<!-- #include file="SmartViewerActiveX.asp" -->



xuehf 2003-10-10
  • 打赏
  • 举报
回复
帮忙呀

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧