Torna al Thread
Imports System.Data
Imports System.Data.SqlClient
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Partial Class Statistica1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'MsgBox("Page_Load")
If Not Page.IsPostBack Then
Try
Dim myreport As New ReportDocument()
myreport.Load(Server.MapPath("CrystalReport2.rpt"))
myreport.DataSourceConnections.Item(0).SetLogon("****", "****")
myreport.SetParameterValue("UserId", "RISORSE\F****")
CrystalReportViewer1.ReportSource = myreport
Catch ex As Exception
'MsgBox(ex.Message)
End Try
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim myreport As New ReportDocument()
myreport.Load(Server.MapPath("CrystalReport2.rpt"))
myreport.DataSourceConnections.Item(0).SetLogon("****", "****")
myreport.SetParameterValue("UserId", DropDownList1.SelectedValue)
CrystalReportViewer1.ReportSource = myreport
Catch ex As Exception
'MsgBox(ex.Message)
End Try
End Sub
End Class