0

Hi to all,

I want to pass the below statement to a report... Kindly help me how to do it ...

select a.po_number,a.mr_number,b.item_code,c.item_desc,
b.qty,b.rate from po_head a,po_detail b,item_master c
where a.mr_number=b.mr_number and b.item_code=c.item_code and
po_number = ' & combopo.text & ';

kindly help...

2
Contributors
3
Replies
7
Views
5 Years
Discussion Span
Last Post by bilal_fazlani
0
Dim sqlcon As New SqlConnection("put your connection string here")
        sqlcon.Open()
        Dim sqlcom As New SqlCommand(String.Format("select a.po_number,a.mr_number,b.item_code,c.item_desc,b.qty,b.rate from po_head a,po_detail b, item_master(c) where(a.mr_number = b.mr_number And b.item_code = c.item_code and po_number = {0}", combopo.Text, sqlcon))
        Dim sqladapter As New SqlDataAdapter(sqlcom)
        Dim sqldt As New DataTable
        sqladapter.Fill(sqldt)

        Dim crystalreport As New ReportDocument
        crystalreport.Load("put your report path here")
        crystalreport.SetDataSource(sqldt)
        crystalreport.Refresh()
0

its very obvious

1> add reference to CrystalDecisions.Shared & CrystalDecisions.CrystalReports.Engine
2> add the following namespace on the top

Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.