473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

executing a report takes a very long time

Hello All

I have designed a dotnet application using VB which basically takes a
selection and passes value to a crystal report which in turn passes the
value to a Stored procedure. After the report gets generated it is PDF'ed -
all this is done thru a single click in my program.

Now the catch here is that through the program all these tasks of generating
the report and PDF'ing 1400 records (about 25 pages) takes 15 minutes.

I executed the SP through analyzer and to generate the 1300 records it takes
about 4 seconds. I executed the information thru Crystal Reports 8.5 and to
generate the report with the parameters it takes less than a minute. To
export to a PDF version from the Drop Down Menu choice, it took about 15
seconds.

It seems to me that when I add the .Net app layer it adds on the extra time.
I am a newbie to dot net. Please advise.. Below is the code that I am using.

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.IO
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Data.SqlClient
Public Class frmCRReport
Inherits System.Windows.Forms.Form
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterDiscreteValue As ParameterDiscreteValue
Dim crParameterValues As ParameterValues
Dim crParameterValues2 As ParameterValues
Dim crParameterValues3 As ParameterValues
Dim crParameterValues4 As ParameterValues
Dim crConnectionInfo As ConnectionInfo
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim crLogonInfo As TableLogOnInfo
Dim response As Integer
Dim response1 As Integer
Dim msg As Integer
Dim msg1 As Integer
Dim oRpt As ReportDocument
Dim crview As New CRView()
Dim i As Integer
Dim BegDate As Date
Dim DateVal As Date
Dim YTD As String
Dim disptext As String
Dim dtFolder As String
Dim Exportpath As String
Dim exportFilePath As String
Dim ExportFileName As String
Dim dlg As System.IO.DirectoryInfo
Dim dlg1 As New OpenFileDialog()
Dim dlg2 As New SaveFileDialog()
Dim dirpath As String
Dim undwrtr As String
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents CheckedListBox1 As System.Windows.Forms.CheckedListBox
Friend WithEvents cmdEnd As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents DateTimePicker1 As System.Windows.Forms.DateTimePicker
Friend WithEvents DateTimePicker2 As System.Windows.Forms.DateTimePicker
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents cboMonth As System.Windows.Forms.ComboBox
Friend WithEvents lblDirPath As System.Windows.Forms.Label
Friend WithEvents btnDirPath As System.Windows.Forms.Button
Friend WithEvents RichTextBox1 As System.Windows.Forms.RichTextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents btnSavRpt As System.Windows.Forms.Button
Friend WithEvents lblSavPath As System.Windows.Forms.Label
Friend WithEvents CheckedListBox2 As System.Windows.Forms.CheckedListBox
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents btnRunReports As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.CheckedListBox1 = New System.Windows.Forms.CheckedListBox()
Me.cmdEnd = New System.Windows.Forms.Button()
Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker()
Me.DateTimePicker2 = New System.Windows.Forms.DateTimePicker()
Me.Label3 = New System.Windows.Forms.Label()
Me.cboMonth = New System.Windows.Forms.ComboBox()
Me.lblDirPath = New System.Windows.Forms.Label()
Me.btnDirPath = New System.Windows.Forms.Button()
Me.RichTextBox1 = New System.Windows.Forms.RichTextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label8 = New System.Windows.Forms.Label()
Me.btnSavRpt = New System.Windows.Forms.Button()
Me.lblSavPath = New System.Windows.Forms.Label()
Me.CheckedListBox2 = New System.Windows.Forms.CheckedListBox()
Me.Label6 = New System.Windows.Forms.Label()
Me.btnRunReports = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'CheckedListBox1
'
Me.CheckedListBox1.Items.AddRange(New Object() {"1400 - Test"})
Me.CheckedListBox1.Location = New System.Drawing.Point(112, 176)
Me.CheckedListBox1.Name = "CheckedListBox1"
Me.CheckedListBox1.Size = New System.Drawing.Size(272, 229)
Me.CheckedListBox1.Sorted = True
Me.CheckedListBox1.TabIndex = 5
'
'cmdEnd
'
Me.cmdEnd.BackColor = System.Drawing.Color.LightGray
Me.cmdEnd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.cmdEnd.ForeColor = System.Drawing.Color.Maroon
Me.cmdEnd.Location = New System.Drawing.Point(512, 368)
Me.cmdEnd.Name = "cmdEnd"
Me.cmdEnd.Size = New System.Drawing.Size(168, 32)
Me.cmdEnd.TabIndex = 24
Me.cmdEnd.Text = "End"
'
'DateTimePicker1
'
Me.DateTimePicker1.CustomFormat = "mm/dd/yyyy"
Me.DateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short
Me.DateTimePicker1.Location = New System.Drawing.Point(392, 312)
Me.DateTimePicker1.Name = "DateTimePicker1"
Me.DateTimePicker1.Size = New System.Drawing.Size(104, 20)
Me.DateTimePicker1.TabIndex = 7
Me.DateTimePicker1.Value = New Date(2003, 4, 16, 0, 0, 0, 0)
'
'DateTimePicker2
'
Me.DateTimePicker2.Format = System.Windows.Forms.DateTimePickerFormat.Short
Me.DateTimePicker2.Location = New System.Drawing.Point(520, 312)
Me.DateTimePicker2.Name = "DateTimePicker2"
Me.DateTimePicker2.Size = New System.Drawing.Size(96, 20)
Me.DateTimePicker2.TabIndex = 9
'
'Label3
'
Me.Label3.BackColor = System.Drawing.Color.DarkGreen
Me.Label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Label3.Font = New System.Drawing.Font("Arial Black", 26.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.Label3.ForeColor = System.Drawing.Color.LightGoldenrodYellow
Me.Label3.Location = New System.Drawing.Point(-8, 0)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(936, 72)
Me.Label3.TabIndex = 1
Me.Label3.Text = "REPORTS"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.TopCenter
'
'cboMonth
'
Me.cboMonth.Items.AddRange(New Object() {"January", "February", "March",
"April", "May", "June", "July", "August", "September", "October",
"November", "December"})
Me.cboMonth.Location = New System.Drawing.Point(392, 344)
Me.cboMonth.Name = "cboMonth"
Me.cboMonth.Size = New System.Drawing.Size(112, 21)
Me.cboMonth.TabIndex = 20
Me.cboMonth.Text = "Select a Month"
'
'lblDirPath
'
Me.lblDirPath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblDirPath.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.lblDirPath.ForeColor = System.Drawing.Color.DarkBlue
Me.lblDirPath.Location = New System.Drawing.Point(296, 80)
Me.lblDirPath.Name = "lblDirPath"
Me.lblDirPath.Size = New System.Drawing.Size(536, 32)
Me.lblDirPath.TabIndex = 3
Me.lblDirPath.Text = "M:\MIS\Programming\Reports"
'
'btnDirPath
'
Me.btnDirPath.BackColor = System.Drawing.Color.LightGray
Me.btnDirPath.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.btnDirPath.ForeColor = System.Drawing.Color.Maroon
Me.btnDirPath.Location = New System.Drawing.Point(104, 80)
Me.btnDirPath.Name = "btnDirPath"
Me.btnDirPath.Size = New System.Drawing.Size(192, 32)
Me.btnDirPath.TabIndex = 2
Me.btnDirPath.Text = "Set Report Location Path"
'
'RichTextBox1
'
Me.RichTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.RichTextBox1.Location = New System.Drawing.Point(104, 512)
Me.RichTextBox1.Name = "RichTextBox1"
Me.RichTextBox1.Size = New System.Drawing.Size(784, 160)
Me.RichTextBox1.TabIndex = 25
Me.RichTextBox1.Text = ""
'
'Label2
'
Me.Label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.Label2.ForeColor = System.Drawing.Color.DarkBlue
Me.Label2.Location = New System.Drawing.Point(392, 288)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(72, 16)
Me.Label2.TabIndex = 6
Me.Label2.Text = "Begin Date"
'
'Label4
'
Me.Label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.Label4.ForeColor = System.Drawing.Color.DarkBlue
Me.Label4.Location = New System.Drawing.Point(520, 288)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(64, 16)
Me.Label4.TabIndex = 8
Me.Label4.Text = "End Date"
'
'Label5
'
Me.Label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.Label5.ForeColor = System.Drawing.Color.DarkBlue
Me.Label5.Location = New System.Drawing.Point(112, 152)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(96, 16)
Me.Label5.TabIndex = 4
Me.Label5.Text = "Select Group(s)"
'
'Label8
'
Me.Label8.BackColor = System.Drawing.Color.DarkGreen
Me.Label8.Location = New System.Drawing.Point(0, 72)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(96, 680)
Me.Label8.TabIndex = 41
'
'btnSavRpt
'
Me.btnSavRpt.BackColor = System.Drawing.Color.LightGray
Me.btnSavRpt.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.btnSavRpt.ForeColor = System.Drawing.Color.Maroon
Me.btnSavRpt.Location = New System.Drawing.Point(104, 112)
Me.btnSavRpt.Name = "btnSavRpt"
Me.btnSavRpt.Size = New System.Drawing.Size(192, 32)
Me.btnSavRpt.TabIndex = 42
Me.btnSavRpt.Text = "Set Report Export Path"
'
'lblSavPath
'
Me.lblSavPath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblSavPath.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.lblSavPath.ForeColor = System.Drawing.Color.DarkBlue
Me.lblSavPath.Location = New System.Drawing.Point(296, 112)
Me.lblSavPath.Name = "lblSavPath"
Me.lblSavPath.Size = New System.Drawing.Size(536, 32)
Me.lblSavPath.TabIndex = 43
'
'CheckedListBox2
'
Me.CheckedListBox2.Items.AddRange(New Object() {"Class Statistical Report -
All Funds"})
Me.CheckedListBox2.Location = New System.Drawing.Point(392, 176)
Me.CheckedListBox2.Name = "CheckedListBox2"
Me.CheckedListBox2.Size = New System.Drawing.Size(256, 109)
Me.CheckedListBox2.TabIndex = 44
'
'Label6
'
Me.Label6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
Me.Label6.ForeColor = System.Drawing.Color.DarkBlue
Me.Label6.Location = New System.Drawing.Point(392, 152)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(144, 16)
Me.Label6.TabIndex = 45
Me.Label6.Text = "Select Report(s) to Run"
'
'btnRunReports
'
Me.btnRunReports.BackColor = System.Drawing.Color.LightGray
Me.btnRunReports.Font = New System.Drawing.Font("Microsoft Sans Serif",
8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
CType(0, Byte))
Me.btnRunReports.ForeColor = System.Drawing.Color.Maroon
Me.btnRunReports.Location = New System.Drawing.Point(512, 336)
Me.btnRunReports.Name = "btnRunReports"
Me.btnRunReports.Size = New System.Drawing.Size(168, 32)
Me.btnRunReports.TabIndex = 46
Me.btnRunReports.Text = "Run Selected Reports"
'
'frmCRReport
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.AutoScroll = True
Me.AutoScrollMargin = New System.Drawing.Size(10, 10)
Me.BackColor = System.Drawing.Color.PaleGoldenrod
Me.ClientSize = New System.Drawing.Size(774, 555)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnRunReports,
Me.Label6, Me.CheckedListBox2, Me.lblSavPath, Me.btnSavRpt, Me.Label8,
Me.Label5, Me.Label4, Me.Label2, Me.RichTextBox1, Me.btnDirPath,
Me.lblDirPath, Me.cboMonth, Me.Label3, Me.cmdEnd, Me.CheckedListBox1,
Me.DateTimePicker1, Me.DateTimePicker2})
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
Me.Name = "frmCRReport"
Me.Text = "Benesys Eldorado Special Processing Reports"
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub frmCRReport_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim myConnectionString As String
Dim dataset1 As DataSet
CheckedListBox1.CheckOnClick = True
CheckedListBox2.CheckOnClick = True

End Sub

Public Sub connectDB()
crLogonInfo = oRpt.Database.Tables(0).LogOnInfo
crLogonInfo.ConnectionInfo.ServerName = "XXXX"
crLogonInfo.ConnectionInfo.UserID = "XXXXXXXXXXX"
crLogonInfo.ConnectionInfo.Password = "XXXXXXXX"
crLogonInfo.ConnectionInfo.DatabaseName = "XXXXXXXXXXX"
oRpt.Database.Tables(0).ApplyLogOnInfo(crLogonInfo )
End Sub

Public Sub PDFDoc()
crDiskFileDestinationOptions = New DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = exportFilePath
crExportOptions = oRpt.ExportOptions
With crExportOptions
..DestinationOptions = crDiskFileDestinationOptions
..ExportDestinationType = ExportDestinationType.DiskFile
..ExportFormatType = ExportFormatType.PortableDocFormat
End With
oRpt.Export()
End Sub

Public Function checkFund()
If CheckedListBox1.CheckedItems.Count = 0 Then
MsgBox("No Group has been selected. You must select atleast one group to run
the report", MsgBoxStyle.OKOnly)
CheckedListBox1.Focus()
checkFund = 1
Exit Function
End If
checkFund = 0
End Function
Public Sub FundBegDates()
YTD = ""
If Mid(CheckedListBox1.CheckedItems(i), 1, 4) = "1400" Then
YTD = "05/01/"
End If
End Sub

Public Sub getParams(ByVal BegDate As Date, ByVal EndDate As Date, ByVal
GroupNum As String)
crParameterFieldDefinitions = oRpt.DataDefinition.ParameterFields
'Access the specified parameter from the collection
crParameterValues =
crParameterFieldDefinitions.Item("@BegDate").Curre ntValues
crParameterValues2 =
crParameterFieldDefinitions.Item("@EndDate").Curre ntValues
crParameterValues3 =
crParameterFieldDefinitions.Item("@GRNUM").Current Values
crParameterDiscreteValue = New ParameterDiscreteValue()
crParameterDiscreteValue.Value = GroupNum
crParameterValues3.Add(crParameterDiscreteValue)
crParameterFieldDefinitions.Item("@GRNUM").ApplyCu rrentValues(crParameterVal
ues3)
'Set the current values for the numeric parameter field
crParameterDiscreteValue = New ParameterDiscreteValue()
crParameterDiscreteValue.Value = BegDate
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinitions.Item("@BegDate").Apply CurrentValues(crParameterV
alues)
crParameterDiscreteValue = New ParameterDiscreteValue()
crParameterDiscreteValue.Value = EndDate
crParameterValues2.Add(crParameterDiscreteValue)
crParameterFieldDefinitions.Item("@EndDate").Apply CurrentValues(crParameterV
alues2)

undwrtr = "001"
End Sub

Public Sub ProcFund()
If msg = MsgBoxResult.Yes Then
disptext = disptext & "Exporting Report " & ExportFileName & " to PDF in " &
exportFilePath & vbCrLf
RichTextBox1.Text = disptext
Call PDFDoc()
disptext = disptext & "Report(s) exported to: '" & exportFilePath & "'" &
vbCrLf
RichTextBox1.Text = disptext
ElseIf msg = MsgBoxResult.No Then
response = MsgBox("Do you want to view " & ExportFileName,
MsgBoxStyle.YesNo)
If response = MsgBoxResult.Yes Then
crview.Show()
crview.CrystalReportViewer1.ReportSource = oRpt
response1 = MsgBox("Do you want to PDF " & ExportFileName,
MsgBoxStyle.YesNo)
If response1 = MsgBoxResult.Yes Then
disptext = disptext & "Exporting Report " & ExportFileName & " to PDF in " &
exportFilePath & vbCrLf
RichTextBox1.Text = disptext
Call PDFDoc()
End If
ElseIf response = MsgBoxResult.No Then
response1 = MsgBox("Do you want to PDF " & ExportFileName,
MsgBoxStyle.YesNo)
If response1 = MsgBoxResult.Yes Then
disptext = disptext & "Exporting Report " & ExportFileName & " to PDF in " &
exportFilePath & vbCrLf
RichTextBox1.Text = disptext
Call PDFDoc()
End If
End If
RichTextBox1.Text = disptext & "Report(s) exported to: '" & exportFilePath &
"'" & vbCrLf
End If
End Sub

Public Sub LoadRpt(ByVal rptname As String)
oRpt = New ReportDocument()
disptext = "" & vbCrLf
oRpt.Load(lblDirPath.Text & "\" & rptname,
OpenReportMethod.OpenReportByTempCopy)
Call connectDB()
End Sub
Public Sub procReports(ByVal Dateval1 As String, ByVal Dateval2 As Date,
ByVal expfname As String, ByVal YTDFlag As Integer)
msg = MsgBox("Do you just want to PDF all selected fund reports or view the
fund reports individually. Yes will PDF all the Funds without displaying and
No will display further options", MsgBoxStyle.YesNoCancel)
For i = 0 To CheckedListBox1.CheckedItems.Count - 1
RichTextBox1.Text = "Processing Group # " & CheckedListBox1.CheckedItems(i)
& ". Please Wait" & vbCrLf
If YTDFlag = 1 Then
Call FundBegDates()
BegDate = YTD & Year(Today)
If Today > BegDate Then
If Month(Today) = Month(BegDate) And Year(Today) = Year(BegDate) Then
Dateval1 = YTD & (Year(Today) - 1)
Else
Dateval1 = BegDate
End If
ElseIf Today < BegDate Then
Dateval1 = YTD & (Year(Today) - 1)
End If
End If
Call getParams(CDate(Dateval1), Dateval2,
Mid(CheckedListBox1.CheckedItems(i), 1, 3))
ExportFileName = Mid(CheckedListBox1.CheckedItems(i), 1, 4) & "_CLASS
STATISTICAL_" & expfname & ".pdf"
dtFolder = DateFunc(Year(LastDayOfMonth(Today)),
Month(LastDayOfMonth(Today)),
Microsoft.VisualBasic.Day(LastDayOfMonth(Today)))
If lblSavPath.Text <> "" Then
Exportpath = lblSavPath.Text
exportFilePath = Exportpath & "\" & ExportFileName
Else
Exportpath = "L:\" & Mid(CheckedListBox1.CheckedItems(i), 1, 4) & "\E2\" &
dtFolder & "\"
Call CheckDir()
End If
Call ProcFund()
Next
RichTextBox1.Text = disptext & "Finished processing All Groups"
End Sub

Public Function FirstDayOfMonth(ByVal CurDate)
FirstDayOfMonth = DateSerial(Year(CurDate), Month(CurDate) - 1, 1)
End Function
Public Function LastDayOfMonth(ByVal CurDate)
LastDayOfMonth = DateSerial(Year(CurDate), Month(CurDate), 0)
End Function
Private Sub btnDirPath_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnDirPath.Click
dlg1.Title = "Set Report Folder"
dlg1.Filter = "Crystal Reports (*.rpt)|*.rpt|All Files (*.*)|*.*"
dlg1.InitialDirectory = "M:\MIS\Programming\Reports\"
If dlg1.ShowDialog() = DialogResult.OK Then
lblDirPath.Text = UCase(Path.GetDirectoryName(dlg1.FileName))
End If
End Sub
Private Sub btnSavRpt_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSavRpt.Click
dlg2.Title = "Save Report"
dlg2.Filter = "Adobe Acrobat (*.pdf)|*.pdf|All Files (*.*)|*.*"
dlg2.InitialDirectory = "L:\"
If dlg2.ShowDialog() = DialogResult.OK Then
lblSavPath.Text = UCase(Path.GetDirectoryName(dlg2.FileName))
End If
End Sub

Public Function DateFunc(ByVal YYYY As String, ByVal MM As String, ByVal DD
As String)
If MM < 10 Then
MM = "0" & MM
ElseIf DD < 10 Then
DD = "0" & DD
End If
DateFunc = YYYY & MM & DD
End Function
Public Sub CheckDir()
If Directory.Exists(Exportpath) Then
exportFilePath = Exportpath & ExportFileName
Else
Directory.CreateDirectory(Exportpath)
exportFilePath = Exportpath & ExportFileName
End If
End Sub
Private Sub cmdEnd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdEnd.Click
End
End Sub

Public Sub procClassStat()
If checkFund() = 1 Then
Exit Sub
End If
Call LoadRpt("AllProductsMonthlyClassStatisticalReport_ V1.rpt")
Call procReports(FirstDayOfMonth(Today), LastDayOfMonth(Today), _
(Month(LastDayOfMonth(Today)) & "-" &
Microsoft.VisualBasic.Day(LastDayOfMonth(Today)) & "-" &
Year(LastDayOfMonth(Today))), 0)
End Sub
Public Sub procClassStatByDate()
If checkFund() = 1 Then
Exit Sub
End If
Call LoadRpt("AllProductsMonthlyClassStatisticalReport_ V1.rpt")
Call procReports(DateTimePicker1.Value, DateTimePicker2.Value, _
(Month(DateTimePicker1.Value) & "-" &
Microsoft.VisualBasic.Day(DateTimePicker1.Value) _
& "-" & Year(DateTimePicker1.Value) & _
"_TO_" & Month(DateTimePicker2.Value) & "-" &
Microsoft.VisualBasic.Day(DateTimePicker2.Value) & _
"-" & Year(DateTimePicker2.Value)), 0)
End Sub
Public Sub procClassStatYTD()
If checkFund() = 1 Then
Exit Sub
End If
Call LoadRpt("AllProductsMonthlyClassStatisticalReport_ V1.rpt")
Call procReports("", LastDayOfMonth(Today), _
("YTD_" & Month(LastDayOfMonth(Today)) & "-" &
Microsoft.VisualBasic.Day(LastDayOfMonth(Today)) & "-" &
Year(LastDayOfMonth(Today))), 1)
End Sub

Public Sub procPPOAnalysis()
If checkFund() = 1 Then
Exit Sub
End If
Call LoadRpt("PPOReport.rpt")
Call procReports(DateTimePicker1.Value, DateTimePicker2.Value, _
(Month(DateTimePicker1.Value) & "-" &
Microsoft.VisualBasic.Day(DateTimePicker1.Value) _
& "-" & Year(DateTimePicker1.Value) & _
"_TO_" & Month(DateTimePicker2.Value) & "-" & Microsoft.VisualBasic.Day(Date
TimePicker2.Value) & _
"-" & Year(DateTimePicker2.Value)), 0)
End Sub
Private Sub btnRunReports_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnRunReports.Click
If CheckedListBox2.CheckedItems.Count = 0 Then
MsgBox("You must select at least one report to run", MsgBoxStyle.OKOnly, "
Alert")
CheckedListBox2.Focus()
Exit Sub
End If
For i = 0 To CheckedListBox2.CheckedItems.Count - 1
If CheckedListBox2.CheckedItems(i) = "Class Statistical Report - All Funds"
Then
Call procClassStat()
End If
Next
End Sub

End Class
Nov 20 '05 #1
0 1793

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to...
1
by: Andrew | last post by:
Hi All: I am using Access2000 and I find that the command to open an Access report in preview mode is very slow: DoCmd.OpenReport rptABC, acViewPreview, "", "" The scenario is this: - The...
6
by: pnp | last post by:
Hi all, I've developed an app (C#) that connects to SQL Server 2000 without using thread pooling (using SqlConnection) and I run a query that returns ~4000 tuples each time it runs and displays...
6
by: veenakj | last post by:
Hi, I have a asp.net webpage which has aroud 20 steps as hyperlink. when start button is clicked, then step1 starts which does some operation in db and returns some value, based on that value...
8
by: Daz | last post by:
Hi everyone. I was faced with the choice of whether my problem is indeed a PHP problem or a MySQL. I have decided it's a PHP problem as I don't experience the same problem when I execute the...
0
by: John Smith | last post by:
Hello, I have 7 different crystal reports that need to be collated. Since I want to end up with a page of each (which all together make a single report), I created a blank main report and then...
4
by: Jana | last post by:
Hi! I have an Access 97 report based on tables linked to an SQL back end. The report has 5 subreports in it (unfortunately unavoidable due to the nature of the report) and performance is quite...
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
4
by: D.Stone | last post by:
I am having problems formatting an Access 2003 report which is trivial in the extreme (tabular layout, 9 fields from 1 table per row in the detail section, no groups/totals). One field (only) in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.