15,893,644 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Chester Costa (Top 18 by date)
Chester Costa
9-Jul-14 4:46am
View
i've done it already sir,i just removed the part where i add another full join using the third table.then that's it. i just used the subreport linking with my parameter on main report.
Chester Costa
19-Jun-14 21:30pm
View
thanks for your reply sir..but may i ask about the do loop?
this is the code you gave me:
this is where i put the the string:
txtORNumber.Text = "OR" & Date.Today.ToString("MMddyy") & fBase26Encode(ornum).ToString & ornum.ToString.PadLeft(4, "0")
"where ornum comes from the total count of data in my table which is in my case,when it reach two data in my table for example then next to my date string will add "A" and so on
Function fBase26Encode(ByRef lngNumToConvert As Long) As String
Dim s As New StringBuilder
Dim abc As Char() = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray
If lngNumToConvert > 2 Then
Do While lngNumToConvert <> 0
s.Append(abc(lngNumToConvert Mod 26))
lngNumToConvert = lngNumToConvert \ 26
Loop
End If
Return StrReverse(s.ToString)
End Function
Chester Costa
11-Oct-13 6:07am
View
i used totext function in my crystal report formula sir.
Chester Costa
11-Oct-13 5:51am
View
i just used this totext function:
totext('E04') + totext({actualguesting.datecheckin},"mmddyy") +
totext({actualguesting.foilionum},0,'4')
but the result given to me is "E041011131"
it should be like this "E0410111300001"
Chester Costa
28-Jun-13 19:56pm
View
because i have a tow tables to display in my crystal report,,table1 is actualguesting and table2 foodordertbl.i use folionumber in actualguesting while in foodordertbl i use ornumber
Chester Costa
26-Jun-13 4:12am
View
by the way sir,do you know or have an idea how to set up a print server?
Chester Costa
25-Jun-13 22:40pm
View
i just found out that the name of my 2nd printer is "EPSON TM-T88IV ReceiptE4" and the first one is "EPSON TM-T88IV Receipt".i'm goint to try this code like this:
Public Sub printing()
Dim rpt As New orderrpt() 'The report you created.
Dim MyCommand As New SqlCommand()
Dim myDA As New SqlDataAdapter()
Dim myDS As New DataSet1() 'The DataSet you created.
Dim cn As New SqlConnection(ConnectString())
Try
MyCommand.Connection = cn
MyCommand.CommandText = "SELECT * FROM foodordertbl where foilionum=" + folioid
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "foodordertbl")
myDS.EnforceConstraints = False
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
rpt.PrintOptions.PrinterName = "EPSON TM-T88IV Receipt"
rpt.PrintOptions.PrinterName = "EPSON TM-T88IV ReceiptE4"
rpt.PrintToPrinter(1, False, 0, 0)
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
End Sub
Chester Costa
25-Jun-13 21:39pm
View
so is it possible to do that sir with the same printer name?i'll try the same code
Chester Costa
25-Jun-13 21:28pm
View
sorry sir but i do not know how to set that code in config file. anyway, i need to print the reports in two printer,the first printer is connected to the cashier while the other one is connected to the kitchen by using a printer server.how am i to do that?
Chester Costa
25-Jun-13 20:49pm
View
thank you sir..that was a great idea.it really helps me
Chester Costa
20-Jun-13 20:18pm
View
if my join or link isn't correct,then what is the right way for joining the two tables in single datasets?yes everytime i login the amount increase.
i manage to do this report not using the loghistory and it works,now i'm wondering,how can i get the username/fullname in my table if i'm not going to use the loghistory
Chester Costa
14-Jun-13 4:39am
View
i want to sum records between 8:00Am to 2:00PM. there are three shifts in a day so i was trying to sum the records between the first record.
Chester Costa
13-Jun-13 22:03pm
View
i updated my code like this:
If ComboBox1.Text = "Shift 1" Then
Dim rpt As New EndofShift() 'The report you created.
Dim MyCommand As New SqlCommand()
Dim myDS2 As New loghistory() 'The DataSet you created.
Dim myDA2 As New SqlDataAdapter()
Dim myDS As New DSactualguesting() 'The DataSet you created.
Dim myDA As New SqlDataAdapter()
Dim cn As New SqlConnection(ConnectString())
Dim dt As DateTime = "06:00:00AM"
Dim dt2 As DateTime = "02:00:00PM"
Try
MyCommand.Connection = cn
MyCommand.CommandText = "Select * from actualguesting"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "actualguesting")
myDA.SelectCommand.CommandText = "Select username,loggedin,loggedout from loghistory where username='" + Login.txtuser.Text + "' order by loggedin "
myDA.Fill(myDS, "loghistory")
myDS.EnforceConstraints = False
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End If
my formula in summing up the total sales between 6AM to 2pm is like this:
if {loghistory.username}='ches' and
{loghistory.loggedin}>= datetimevalue(CurrentDate,Time (05,59 ,59 )) to
datetimevalue(CurrentDate,Time (13,59 ,59 ))
and
{actualguesting.paymentmode}='CASH'
then
sum({actualguesting.totalamount})
when i run the report,it sum up all the records but not in the time i logged in
Chester Costa
2-Jun-13 22:51pm
View
i solved my own problem.my problem is,i have two tables in my rpt. so i add another code like this
myDA.SelectCommand.CommandText = "Select * from roomtbl where irsno="+ irsn
myDA.Fill(myDS, "roomtbl")
Chester Costa
22-May-13 5:44am
View
im stuck in displaying the values from my data table. and this code "cryRpt.SetDataSource(ds.Tables(0))" says that invalid path file
Chester Costa
22-May-13 2:21am
View
i used vb.net2010
Dim cryRpt As New ReportDocument
cryRpt.Load("C:-----\Reports\orderrpt.rpt")
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
Dim param As New ParameterDiscreteValue
param.Value = txtAMOUNT.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("total")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(param)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
param.Value = txtfoodrate.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("price")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(param)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
param.Value = txtordered.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("foodorder")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(param)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
param.Value = quantity.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("quantity")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(param)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
crParameterDiscreteValue.Value = TextBox5.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("folioid")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
-----------------------------------------
this are the formula under the parameters that will be displayed on the reports
{foodordertbl.folioid}&','& {foodordertbl.foodorder}&','& {foodordertbl.quantity}&','&{foodordertbl.price}&','&{foodordertbl.total}= {?folioid}
Chester Costa
22-May-13 2:19am
View
Deleted
Dim cryRpt As New ReportDocument
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table
cryRpt.Load("C:\Users\Frontliner0102\Desktop\newRSVSYSTEM\ReservationSys\ReservationSys\ReservationSys\Reports\orderrpt.rpt")
With crConnectionInfo
.ServerName = "192.168.1.20"
.DatabaseName = "irsDB"
.UserID = "hposadmin"
.Password = "1zones"
End With
CrTables = cryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
Dim cryRpt As New ReportDocument
cryRpt.Load("C:\Users\Frontliner0102\Desktop\newRSVSYSTEM\ReservationSys\ReservationSys\ReservationSys\Reports\orderrpt.rpt")
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
cryRpt.PrintToPrinter(1, False, 0, 0)
Dim cnn As SqlConnection
Dim connectionString As String
Dim sql As String
connectionString = "data source=192.168.1.20\SQLEXPRESS,49172; Initial Catalog=irsdb;User Id=hposadmin;Password=1zones;"
cnn = New SqlConnection(connectionString)
cnn.Open()
sql = "select * from foodordertbl"
Dim dscmd As New SqlDataAdapter(sql, cnn)
Dim ds As New DataSet1
dscmd.Fill(ds, "foodordertbl")
Dim cryRpt As New ReportDocument
cryRpt.SetDataSource(ds.Tables())
cryRpt.Load("C:\Users\Frontliner0102\Desktop\newRSVSYSTEM\ReservationSys\ReservationSys\ReservationSys\Reports\orderrpt.rpt")
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
cryRpt.PrintToPrinter(1, False, 0, 0)
Dim cryRpt As New ReportDocument
cryRpt.Load("C:\Users\Frontliner0102\Desktop\newRSVSYSTEM\ReservationSys\ReservationSys\ReservationSys\Reports\orderrpt.rpt")
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
crParameterDiscreteValue.Value = TextBox5.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("folioid")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
Chester Costa
22-May-13 1:48am
View
i'm done with this problem sir.. reports and parameter are working fine. but it seems that whenever i i ordered two items,it only display the first item..i dont know what to do here because i'm a newbie
Show More