vb.net 如何使用具有指定 db 值的 MS-access 生成水晶报告?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17434627/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 14:07:45  来源:igfitidea点击:

How do i generate crystal report using MS-access with specified db value?

vb.netms-accesscrystal-reports

提问by Shaikh Nadeem

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..

我有一个名为 bill 的表,我想生成用于发票目的的水晶报告,该报告将包含 Sr.No、ProductName、Weight、Rate、Total、VAT 和最终的 GrandTotal 作为多个产品的总和的最终金额总和.Bill 将基于来自不同形式的 SrNo 生成,Back 是 MS-Access。Billl 将像正式账单一样生成多个产品详细信息和增值税,最后这些产品和增值税的总和。有人请帮助我......提前致谢..

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

回答by dimis164

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