0
votes

I am having a table named as bill and i wanted to generate crystal report for invoice purpose,and report will contain Sr.No,ProductName, Weight, Rate, Total ,VAT and a final GrandTotal as final amount sum of the Total of multiple product.Bill will be generating based on SrNo which will be coming from a different form, Back is MS-Access. Billl will be generating like a formal bill with multiple product details and vat and sum of those products and VAT at the end .someone plz help me ...Thanks in advance..

adp = New OleDbDataAdapter("Select * from Bills where [SrNo]=" + Sales.txtSrNo.Text + "", con) 

dt.Tables.Clear() 
adp.Fill(dt, "Bills") 

Dim rpt As ReportClass 
rpt = New CrystalReportBill 
rpt.SetDataSource(dt) 

CrystalReportViewer1.ReportSource = rpt
1
I have created a report and using reportviewer i called on the new page and code behind is : adp = New OleDbDataAdapter("Select * from Bills where [SrNo]=" + Sales.txtSrNo.Text + "", con) dt.Tables.Clear() adp.Fill(dt, "Bills") Dim rpt As ReportClass rpt = New CrystalReportBill rpt.SetDataSource(dt) CrystalReportViewer1.ReportSource = rptShaikh Nadeem
Search the web for how to use 'parameters' in Crystal Reports.PowerUser
Also, it's been awhile, but I think you can use parameterized access queries as a source for Crystal Reports. So, when you run the Crystal Report, the Access query prompts the user for a value. (someone please correct me if I'm wrong)PowerUser
can anyone help me ho do i fill report with data set based on that where clause?\Shaikh Nadeem

1 Answers

0
votes

add parameters to your report and also add subreport for the bill details.

you can pass the parameters to the crystal by this way:

  Dim MyReport As New CrystalReport1

  With MyReport 
      .SetDatabaseLogon("yourusername", "yourpassword")
      .SetParameterValue(0, "Invoice")
      .SetParameterValue(1, "9999099")
  End With

  CrystalReportViewer1.ReportSource = MyReport