امتیاز موضوع:
  • 0 رأی - میانگین امتیازات: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Crystal report in vb.net
نویسنده پیام
Komak آفلاین
تازه وارد

ارسال‌ها: 1
موضوع‌ها: 1
تاریخ عضویت: شهریور ۱۳۸۷

تشکرها : 0
( 0 تشکر در 0 ارسال )
ارسال: #1
Crystal report in vb.net
Salam,
Bache ha man 2 ta moshkel peyda karadam to barname nevisi goftam shayad shoma ha balad bashid betounid komakam koni.

avali baraye parameter pass kardan be Crystal reporte to vb.net.Albate man az crystal viewer khode .net estefade kardam vali nemitounam parameteramo be reportam pass konam.
کد:
Dim rpt As New rptIntervals()

        Dim con As SqlConnection

        Dim sql As String

        Dim da As New SqlDataAdapter

        Dim ds As New DataSet

        Dim dc As CrystalDecisions.Shared.DiscreteOrRangeKind

        con = New SqlConnection(strCon)

        con.Open()

        Sql = " SELECT     WorDescription, isnull(d14,'') as d14 ,"

        Sql &= " isnull(d29,'') as d29, isnull(d44,'') as d44,"

        Sql &= " isnull(d59,'') as d59, isnull(d74,'') as d74,"

        Sql &= " isnull(d89,'') as d89, isnull(d90,'') as d90"

        Sql &= " FROM dbo.vIntervals "

  

        da = New SqlDataAdapter(Sql, con)

        da.Fill(ds)

        rpt.Refresh()

        rpt.SetDataSource(ds.Tables(0))

        rpt.SetParameterValue("@Test", txtStartdate.Text) ***

        rpt.Refresh()

        CrystalReportViewer1.ReportSource = rpt

        rpt.Refresh()

        CrystalReportViewer1.Zoom(75)

        Publicds = ds.Copy()
In codame va un khaty ke *** dare kar nemikoneh shayad ham man balad nistam va bayad chiz digey bashe.



Lotfan age rahi baladin behem begin.Alabate bayad begam hamon joor ke mibinid man ba SQL Query reportam ro ejra mikonam.



Domin moshkelam male Subreporte. Man az yek reporte dige be unvane subreport to yek reprt estefade kardam. Data sub report hich rabty be reporte esli nadare.Vaghty run mikonam subreport khali miad.vali hamon subreport ro ke joda run mikonam dorost kar mikoneh.

in code moshkele subreportame:
کد:
Private Sub btnNewSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewSearch.Click
Dim rpt As New rptActiveCase()
Dim rptSub As New rptActiveCaseIssue()
Dim subReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim con As SqlConnection
Dim sql As String
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Dim sqlSub As String
Dim daSub As New SqlDataAdapter
Dim dsSub As New DataSet
con = New SqlConnection(strCon)
con.Open()
sql = " SELECT [Case ID], [Open Date], Name, Worker, Service, [Issue Type], Fee,OD"
Sql &= " FROM dbo.vOpenCase "
If txtStartdate.Text <> "" And txtEndDate.Text <> "" Then sql &= " WHERE (OD BETWEEN '" & txtStartdate.Text & "' AND '" & txtEndDate.Text & "')"
da = New SqlDataAdapter(Sql, con)
da.Fill(ds)
rpt.Refresh()
rpt.SetDataSource(ds.Tables(0))

sqlSub = "SELECT [Issue Type], COUNT([Issue Type]) AS Iss"
sqlSub &= " FROM dbo.vOpenCase "
If txtStartdate.Text <> "" And txtEndDate.Text <> "" Then sqlSub &= " WHERE (OD BETWEEN '" & txtStartdate.Text & "' AND '" & txtEndDate.Text & "') AND ([Issue Type] IS NOT NULL)"
sqlSub &= " GROUP BY [Issue Type]"
sqlSub &= " UNION ALL "
sqlSub &= " SELECT 'ServiceDecsription' AS Expr1, '99999' AS counting"
sqlSub &= " UNION ALL "
sqlSub &= " SELECT Service AS Description, COUNT(Service) AS counting"
sqlSub &= " FROM dbo.vOpenCase AS vOpenCase_1"
If txtStartdate.Text <> "" And txtEndDate.Text <> "" Then sqlSub &= " WHERE (OD BETWEEN '" & txtStartdate.Text & "' AND '" & txtEndDate.Text & "') AND ([Service] IS NOT NULL)"
sqlSub &= " GROUP BY Service"
sqlSub &= " UNION ALL "
sqlSub &= " SELECT 'Fee' AS Expr1, '99999' AS counting"
sqlSub &= " UNION ALL "
sqlSub &= " SELECT Fee AS Description, COUNT(Fee) AS counting"
sqlSub &= " FROM dbo.vOpenCase AS vOpenCase_1"
If txtStartdate.Text <> "" And txtEndDate.Text <> "" Then sqlSub &= " WHERE (OD BETWEEN '" & txtStartdate.Text & "' AND '" & txtEndDate.Text & "') AND ([Fee] IS NOT NULL)"
sqlSub &= " GROUP BY Fee"


daSub = New SqlDataAdapter(sqlSub, con)
daSub.Fill(dsSub)
rptSub.Refresh()
rptSub.SetDataSource(dsSub.Tables(0))
rptSub.Refresh()
subReport = rpt.OpenSubreport("rptActiveCaseIssue")
subReport.SetDataSource(dsSub)
rpt.Refresh()
CrystalReportViewer1.Zoom(75)
Publicds = ds.Copy()
CrystalReportViewer1.ReportSource = rpt
rpt.OpenSubreport("rptActiveCaseIssue")
CrystalReportViewer1.RefreshReport()
End Sub



Man kheili vaghte ba crystal report kar nakarde boodam shayad yek chizi bashe ke man yadam rafte.I

midounam ke taghazay ziady hast vali age mishe komakam konid.
۱۶-شهریور-۱۳۸۷, ۰۷:۱۰:۲۸
ارسال‌ها
پاسخ


موضوعات مرتبط با این موضوع...
موضوع نویسنده پاسخ بازدید آخرین ارسال
  سوال در مورد Data Report shedayat 4 4,270 ۱۴-اسفند-۱۳۸۸, ۲۲:۵۷:۲۸
آخرین ارسال: skh1300
  در خواست آموزش Data Report ؟؟ saeedvir 0 2,753 ۲۳-آبان-۱۳۸۸, ۲۲:۲۵:۲۳
آخرین ارسال: saeedvir
  یه سوال ساده در مورد Data Report hamed_Arfaee 3 3,631 ۲۱-مهر-۱۳۸۸, ۰۰:۰۲:۳۲
آخرین ارسال: hamed_Arfaee
  یه سوال در مورد Data Report shedayat 0 1,639 ۱۲-شهریور-۱۳۸۸, ۱۷:۰۳:۱۸
آخرین ارسال: shedayat
  سوالی از data report evilbaby 1 2,086 ۲۳-تير-۱۳۸۸, ۱۲:۳۵:۲۷
آخرین ارسال: evilbaby
  آموزش کامل نحوه ایجاد ارتباط بین VB6 و Crystal Report 10 با نکات مهم sayberiya 0 3,745 ۲۵-خرداد-۱۳۸۷, ۱۳:۲۸:۳۸
آخرین ارسال: sayberiya
  معرفي كتاب در مورد Active report سولماز 3 3,886 ۰۲-مهر-۱۳۸۵, ۱۰:۴۹:۱۱
آخرین ارسال: tanhatarin
  کمک فوری - مشکل Data Report با SETUP afshin20060 3 2,305 ۲۸-شهریور-۱۳۸۵, ۰۳:۲۰:۴۰
آخرین ارسال: arashrj
  add dataو data report ensi 1 1,774 ۲۴-شهریور-۱۳۸۵, ۰۳:۴۴:۱۷
آخرین ارسال: arashrj
  Data report rasool_pa 9 5,768 ۰۶-تير-۱۳۸۴, ۱۶:۱۶:۳۳
آخرین ارسال: MasoudSobhi

پرش به انجمن:


کاربرانِ درحال بازدید از این موضوع: 1 مهمان

صفحه‌ی تماس | IranVig | بازگشت به بالا | | بایگانی | پیوند سایتی RSS