VS2010/sqlserver/crystalreport13
Sir,
I have a report which is runnin fine as it is using singe table Dataset(.xsd) . I want to expand the report and use more tables in it to show more information .
How can I do so. I am attaching my present code with this.
Pl. guide
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim stdate, enddate As Date
Dim sql As String
start_date.Text = Session("startdate")
end_date.Text = Session("endate")
Dim dt As DateTime = DateTime.Parse(start_date.Text, System.Globalization.CultureInfo.GetCultureInfo("en-gb"))
'Get only Datepart from the above converted value
Dim dt1 As DateTime = DateTime.Parse(end_date.Text, System.Globalization.CultureInfo.GetCultureInfo("en-gb"))
'Get only Datepart from the above converted value
stdate = Convert.ToDateTime(dt.ToShortDateString())
enddate = Convert.ToDateTime(dt1.ToShortDateString())
Dim conStr As New SqlConnection("Data Source=MyServer;Initial Catalog=Books_DB;Integrated Security=True;")
' if using Sql server authentication then create the connectionstring as
'SqlConnection conStr = new SqlConnection("Server=MyServer;uid=sa;pwd=nothing;Database=Books_DB;");
Dim connectionString As String
Dim connection As SqlConnection
Dim ds As New DataSet()
connectionString = ConfigurationManager.ConnectionStrings("accountsConnectionString").ToString
connection = New SqlConnection(connectionString)
Dim cmd As New SqlCommand("select a.code,firmname,tr_date,chno,vno,bill_amt,tds,vat,srtax,net_pay from firmdt a, firm b where a.code=b.code and a.code=" & Session("firmcode") & " and a.TR_DATE between '" & stdate & "' and '" & enddate & "' order by tr_date desc", connection)
Dim adp As New SqlDataAdapter(cmd)
adp.Fill(ds, "firmdt")
Dim firmsReport As New ReportDocument()
firmsReport.Load(Server.MapPath("firmdt.rpt"))
firmsReport.SetDataSource(ds.Tables("firmdt"))
CrystalReportViewer1.ReportSource = firmsReport
CrystalReportViewer1.HasPrintButton = True
CrystalReportViewer1.HasSearchButton = True
CrystalReportViewer1.HasToggleGroupTreeButton = False
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.DataBind()
End Sub
End Class