没有有效的报告来源。 ASP.NET 2010 [英] No valid report source is available. ASP.NET 2010

查看:61
本文介绍了没有有效的报告来源。 ASP.NET 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用动态数据源创建Crystal Report。当我单击报告按钮时,水晶报告显示正常,但是当我单击任何按钮时,Crystal Report工具栏(即下一页,导出到等),我得到一个错误无效报告源的弹出窗口可用。

我的报告查看器编码:



Imports System.IO

Imports System.Data

Imports System.Data.SqlClient

Imports System.Web.HttpApplication

Imports CrystalDecisions.CrystalReports.Engine

进口CrystalDecisions.Shared

Imports CrystalDecisions.Web

Imports CrystalDecisions.ReportSource



Partial Class Reportviewer

继承System.Web.UI.Page

Public str As String

Public rptname As String

Public sf As String

受保护的子Page_Load(ByVal sender As Object,ByVal e As System.EventArgs)处理Me.Load

如果Page.IsPostBack = False那么

D im printModeList As ArrayList = New ArrayList()

printModeList.Add(ActiveX)

Dim con As New ConnectionInfo

Dim con1 As New ConnectionInfo

Dim db1 As Database

Dim dbs As Tables

Dim db As Table

Dim tab As TableLogOnInfo

rptname = Session(rptname)

str = Convert.ToString(Session(Str))'

Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument



带con

.UserID =sa

.Password = sa

.DatabaseName =TASHEEL

'.ServerName =Develope-PC

.ServerName =TASHEEL



结束

如果rptname =inv_rep.rpt那么

rpt.Load(Server.MapPath(.. \ _Report \ CrystalReport.rpt))

结束如果

db1 = rpt.Database

dbs = db1.Tables

For each db in dbs

tab = db.LogOnInfo

tab.ConnectionInfo = con
db.ApplyLogOnInfo(tab)

Next

CrystalReportViewer1.SelectionFormula = str

'rptname = Session(rptname) 'INV_LIST.rpt

CrystalReportViewer1.ReportSource = rpt

CrystalReportViewer1.ShowFirstPage()

'CrystalReportViewer1.RefreshReport()

会话(Str)=

会话(rptname)=



结束如果

结束子



结束类

解决方案

FIX:Crystal Report,没有有效的报告源。 [ ^

I am trying to create a Crystal Report with a dynamic data source. When i click the report button, the crystal report shows up just fine, but when i click any button the Crystal Report tool bar (i.e. Next page, Export To, etc.), i get a pop with the Error "No valid report source is available."
My Report viewer coding:

Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.HttpApplication
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.Web
Imports CrystalDecisions.ReportSource

Partial Class Reportviewer
Inherits System.Web.UI.Page
Public str As String
Public rptname As String
Public sf As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
Dim printModeList As ArrayList = New ArrayList()
printModeList.Add("ActiveX")
Dim con As New ConnectionInfo
Dim con1 As New ConnectionInfo
Dim db1 As Database
Dim dbs As Tables
Dim db As Table
Dim tab As TableLogOnInfo
rptname = Session("rptname")
str = Convert.ToString(Session("Str")) '"
Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument

With con
.UserID = "sa"
.Password = "sa"
.DatabaseName = "TASHEEL"
' .ServerName = "Develope-PC"
.ServerName = "TASHEEL"

End With
If rptname = "inv_rep.rpt" Then
rpt.Load(Server.MapPath("..\Report\CrystalReport.rpt"))
End If
db1 = rpt.Database
dbs = db1.Tables
For Each db In dbs
tab = db.LogOnInfo
tab.ConnectionInfo = con
db.ApplyLogOnInfo(tab)
Next
CrystalReportViewer1.SelectionFormula = str
'rptname = Session("rptname") '"INV_LIST.rpt"
CrystalReportViewer1.ReportSource = rpt
CrystalReportViewer1.ShowFirstPage()
'CrystalReportViewer1.RefreshReport()
Session("Str") = ""
Session("rptname") = ""

End If
End Sub

End Class

解决方案

FIX:Crystal Report, "No valid report source is available."[^]


这篇关于没有有效的报告来源。 ASP.NET 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆