关于C#调用水晶报表的问题

cq520happy 2005-03-01 11:14:11
怎么调用水晶报表?C#
...全文
194 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
chen_5105209 2005-03-01
  • 打赏
  • 举报
回复
Response.Expires = -1
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-control", "no-store"

reportname = Server.MapPath(Request("url"))

If Not IsObject(session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.9")
session("oApp").LogOnServer "pdssql.dll", "tom", "cyoa", "sa", ""
End If

If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if

Set session("oRpt") = session("oApp").OpenReport(reportname, 1)

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False

session("oRpt").DiscardSavedData
session("oRpt").RecordSelectionFormula = GetDecodeStr(Request("sf"))

'Set Value for Parameter Field
strParams = Request("params")
arrParams = split(strParams, ",")
set oParamCollection = Session("oRpt").Parameterfields
for i = 1 to oParamCollection.Count
if i <= (UBound(arrParams)+1) then
set oParam = oParamCollection.Item(i)
oParam.SetCurrentValue GetDecodeStr(CStr(arrParams(i-1))), 12
end if
next

On Error Resume Next
session("oRpt").ReadRecords
If Err.Number <> 0 Then
Response.Write err.description
Response.Write "An Error has occured on the server in attempting to access the data source"
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If

111,092

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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