PDA

View Full Version : کریستال ریپورت



shahram197070
یک شنبه 09 اسفند 1388, 20:44 عصر
با سلام
دوستان محترم
از تابع زیر برای نمایش گزارشام استفاده می کنم در هنگام بارگزاری گزارش در بهترین حالت حدود 40 ثانیه طول می کشه !!!!!
کسی می دونه مشکل کد زیر چیه ؟


Public Function DatabaseLogon(ByRef ViewReport As ReportDocument) As ReportDocument
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As New CrystalDecisions.Shared.TableLogOnInfo
Dim ConnectInfo As New CrystalDecisions.Shared.ConnectionInfo
With ConnectInfo
.ServerName = ServerName
.UserID = UserName
.Password = UserPass
.DatabaseName = DataBase
End With
Try
'Resetting connection information for each table that your report will be using.
For Each tbCurrent In ViewReport.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
tliCurrent.ConnectionInfo = ConnectInfo
tbCurrent.ApplyLogOnInfo(tliCurrent)
'Important 1: This code below very important, it will help your program re-setting location for connection.
If (tbCurrent.TestConnectivity() = False) Then
Return Nothing
Else
If (tbCurrent.Location.IndexOf(".") > 0) Then
tbCurrent.Location = tbCurrent.Location.Substring(tbCurrent.Location.La stIndexOf(".") + 1)
Else
tbCurrent.Location = tbCurrent.Location
End If
End If
'End - Important 1
Next tbCurrent
Return ViewReport
Catch ex As Exception
MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Information)
Finally

End Try
End Function

bad_boy_2007
یک شنبه 09 اسفند 1388, 21:52 عصر
بصورت كلي گزارشات كريستال كمي كند اند ، البته عموما در اولين بار اجرا ولي دفعات بعدي كمي سريع تر كار ميكنند . به نظر من StimulReport كمي از كريستال سريع تر كار ميكند .

ولي تا به حال پيش نيامده كه كريستال تا 40 ثانيه طول بكشد ، حتما بخشي از كدهايتان مشكل دارد و داده هاي اضافي را واكشي ميكند .

توصيه ميكنم با هر ابزار گزارش سازي كه ميخواهيد كار كنيد حتما از StoredProcedure ها استفاده نماييد