It is feasible based on the information you've given.
As long as that timestamp is exactly the same with all records entered in that session, you should be able to set a SelectionFormula for your CrystalReportViewer to only display rows that have that exact timestamp.
I guess I just thought you were in the process of trying your solution to see if it worked.
20 Replies - 910 Views - Last Post: 28 March 2013 - 06:23 AM
#16
Re: How to display the last inserted records in crystal report
Posted 21 March 2013 - 08:26 AM
#17
Re: How to display the last inserted records in crystal report
Posted 21 March 2013 - 08:38 AM
If the report has a parameter field, can you use the select expert to filter based on that. Then you pass that timestamp to this parameter field and your done. I don't have CR available here to test.
#18
Re: How to display the last inserted records in crystal report
Posted 21 March 2013 - 06:51 PM
But I said earlier that i don't know anything at all about timeStamp and how its gonna work. I did understand little bit that what timeStamp is doing but i can't do it right now so easily.
1). The way which i have shown, isn't it right?
and secondly, how to work with TimeStamp? I really want to learn it and i have to submit my project so immediately.
1). The way which i have shown, isn't it right?
and secondly, how to work with TimeStamp? I really want to learn it and i have to submit my project so immediately.
#19
Re: How to display the last inserted records in crystal report
Posted 21 March 2013 - 07:01 PM
Do a test for me.
Add 5 items.
Go to the database and do a screenshot of the last 5 items in the table.
Make sure we can see all the fields in the rows.
I need to see some real data because we're misunderstanding each other or something.
Add 5 items.
Go to the database and do a screenshot of the last 5 items in the table.
Make sure we can see all the fields in the rows.
I need to see some real data because we're misunderstanding each other or something.
#20
Re: How to display the last inserted records in crystal report
Posted 22 March 2013 - 02:43 AM
Hi. This is the attached file.
Attached image(s)
#21
Re: How to display the last inserted records in crystal report
Posted 28 March 2013 - 06:23 AM
This is my form load event code. The form on which the Crystal Report Viewer, a textbox and a button is there.
This code binds the last inserted record's Sale_Date in a textbox, Right.
After that i press the button (LoadMe), which is supposed to displayed the matched record on Crystal report.
this is my Button Click event code:
But it doesn't display anything. Please guide me that what is wrong with this code.
Dim sel As String = "select top 1 Sale_Date from SaleInfo order by Sale_ID Desc"
Dim cmdSql As New SqlCommand(sel, cnSql)
cmdSql.CommandType = CommandType.Text
daSql.SelectCommand = cmdSql
daSql.Fill(dsSql, "SaleInfo")
TextBox1.DataBindings.Add("text", dsSql, "SaleInfo.Sale_Date")
This code binds the last inserted record's Sale_Date in a textbox, Right.
After that i press the button (LoadMe), which is supposed to displayed the matched record on Crystal report.
this is my Button Click event code:
cnSql.Open()
Dim sel As String = "select * from SaleInfo where Sale_Date = '" & TextBox1.Text & "'"
Dim cmdSql As New SqlCommand(sel, cnSql)
cmdSql.CommandType = CommandType.Text
daSql.SelectCommand = cmdSql
daSql.Fill(dsSql2, "SaleInfo")
Dim objRpt As New CrystalReport1
objRpt.SetDataSource(dsSql2.Tables("SaleInfo"))
CrystalReportViewer2.ReportSource = objRpt
CrystalReportViewer2.Refresh()
cnSql.Close()
But it doesn't display anything. Please guide me that what is wrong with this code.
|
|

New Topic/Question
Reply





MultiQuote



|