Imports System.Data.SqlClient
Imports System.Data
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Enterprise
Imports CrystalDecisions.Shared
Imports CrystalDecisions.Web
Imports CrystalDecisions.ReportSource
Partial Class _Default
Inherits System.Web.UI.Page
' Dim ClientReport As New ClientReport()
Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("client").ConnectionString)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cmd As New SqlCommand("select_report", con)
Dim code As String
Dim dt As New DataTable
code = txttakenumber.Text
cmd.Parameters.AddWithValue("@hld_ac_code", code)
dt = GetDataItem("select_report", CommandType.StoredProcedure, "select_report")
Dim rpt As New ReportDocument
rpt.Load("E:\Websites\parameter\ClientReport.rpt")
CrystalReportViewer1.ReportSource = rpt
CrystalReportViewer1.RefreshReport()
End Sub
Protected Sub CrystalReportViewer1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Init
Dim ds As New DataSet
Dim dt As New DataTable
' Dim code As String
con.Open()
Dim cmd As New SqlCommand("select_report ", con)
cmd.CommandType = CommandType.StoredProcedure
Dim i As String
Dim dat As Integer
dat = 20090711
'code = txttakenumber.Text
Dim da As New SqlDataAdapter(cmd)
cmd.Parameters.AddWithValue("@hld_hold_date", dat)
i = cmd.ExecuteNonQuery()
da.Fill(dt)
ds.Tables.Add(dt)
CrystalReportViewer1.EnableDatabaseLogonPrompt = False
Dim rpt As New ReportDocument
rpt.Load("E:\Websites\parameter\ClientReport.rpt")
rpt.SetDataSource(dt)
CrystalReportViewer1.ReportSource = rpt
Response.ClearContent()
Response.ClearHeaders()
con.Close()
End Sub
Protected Sub CrystalReportViewer1_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Unload
CrystalReportViewer1.Dispose()
End Sub
End Class
Imports System.Data
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Enterprise
Imports CrystalDecisions.Shared
Imports CrystalDecisions.Web
Imports CrystalDecisions.ReportSource
Partial Class _Default
Inherits System.Web.UI.Page
' Dim ClientReport As New ClientReport()
Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("client").ConnectionString)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cmd As New SqlCommand("select_report", con)
Dim code As String
Dim dt As New DataTable
code = txttakenumber.Text
cmd.Parameters.AddWithValue("@hld_ac_code", code)
dt = GetDataItem("select_report", CommandType.StoredProcedure, "select_report")
Dim rpt As New ReportDocument
rpt.Load("E:\Websites\parameter\ClientReport.rpt")
CrystalReportViewer1.ReportSource = rpt
CrystalReportViewer1.RefreshReport()
End Sub
Protected Sub CrystalReportViewer1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Init
Dim ds As New DataSet
Dim dt As New DataTable
' Dim code As String
con.Open()
Dim cmd As New SqlCommand("select_report ", con)
cmd.CommandType = CommandType.StoredProcedure
Dim i As String
Dim dat As Integer
dat = 20090711
'code = txttakenumber.Text
Dim da As New SqlDataAdapter(cmd)
cmd.Parameters.AddWithValue("@hld_hold_date", dat)
i = cmd.ExecuteNonQuery()
da.Fill(dt)
ds.Tables.Add(dt)
CrystalReportViewer1.EnableDatabaseLogonPrompt = False
Dim rpt As New ReportDocument
rpt.Load("E:\Websites\parameter\ClientReport.rpt")
rpt.SetDataSource(dt)
CrystalReportViewer1.ReportSource = rpt
Response.ClearContent()
Response.ClearHeaders()
con.Close()
End Sub
Protected Sub CrystalReportViewer1_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Unload
CrystalReportViewer1.Dispose()
End Sub
End Class
0 comments: