0 Replies - 1219 Views - Last Post: 08 November 2012 - 09:52 PM Rate Topic: -----

#1 hiran1800  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 06-November 10

crystal report call from VB

Posted 08 November 2012 - 09:52 PM

I need to open report (create by crsytal report ) when the form load , but it still not work.
please recommend , I think have some mistake at :

Dim x As New frmRbudgetList1(report, sql, ReportPath)

Please advice.

 

Public Class frmRbudgetList1

    Private Sub frmRbudgetList1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    End Sub

    Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load

        Dim sql As String = ""

        sql = "SELECT Tb_BgMain.bgID, Tb_BgMain.bgIDcontrol, Tb_BgMain.bgFSyear, Tb_BgMain.bgDate, Tb_BgMain.bgNmMain, Tb_BgMain.bgNmTha, Tb_BgMain.bgExpecDT, Tb_BgMain.bgNoteUser, Tb_BgMain.bgDpNo, Tb_BgMain.bgCostNo, Tb_BgMain.bgType, Tb_BgMain.bgACNo, Tb_BgMain.bgpur, Tb_BgMain.bgCur, Tb_BgMain.bgUM, Tb_BgMain.bgQty, Tb_BgMain.bgUnPrice, Tb_BgMain.bgAmtCur, Tb_BgMain.bgExRate, Tb_BgMain.bgAmtTHB, Tb_BgMain.bgAllowGM, Tb_BgMain.bgNoteGM, Tb_BgMain.bgValUPTHB, Tb_BgMain.bgValidate, QBGUsage1.SumOfInTTBaht, Tb_ACCD.ACNM, Tb_BGType.TypeNM, Tb_Depart.DPNM, Tb_Section.SecNM "
        sql = sql & "FROM ((((Tb_BgMain INNER JOIN QBGUsage1 ON Tb_BgMain.bgID = QBGUsage1.BgNo) INNER JOIN Tb_ACCD ON Tb_BgMain.bgACNo = Tb_ACCD.ACNO) INNER JOIN Tb_BGType ON Tb_BgMain.bgType = Tb_BGType.TypeID) INNER JOIN Tb_Depart ON Tb_BgMain.bgDpNo = Tb_Depart.DPID) INNER JOIN Tb_Section ON Tb_BgMain.bgCostNo = Tb_Section.CCID "
        sql = sql & "  where  Tb_BgMain.bgValidate='1'"


        Dim report As New rBudgetList1
        Dim ReportPath As String = Application.StartupPath & "\rBudgetList1.rpt"

        Dim x As New frmRbudgetList1(report, sql, ReportPath)
        x.ShowDialog()


    End Sub
End Class




Is This A Good Question/Topic? 0
  • +

Page 1 of 1