Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing checks from asp.nete

Status
Not open for further replies.

123ASP

MIS
Nov 2, 2002
239
0
0
US
hi, I have created a table that capture profit distributions from projets, what I need to do is to create a bottom to iterate throw profit distribution table and print checks to the investors, can I do that in asp.net?
and if I can what approach I can take. thanks
Al
 
Do you have reporting software like Crystal? If not you could build a separate HTML page and send that to the printer. The formatting and positioning may be a little tricky. Just a thought.
 
Yes, I have crystal report, would you guide me to be able to print checks.

thanks
Al
 
I'll try. Most likely you will be using preprinted laser checks. Is this correct?
 
I just re-read your first post. If you could give me more information about your project it would be helpful. There is usually a lot of policies and procedures that go along with check printing. And of course security is a big issue. Why do you want to print checks from a web page?
 
I am managing investment account for a company where investors get paid via profit distribution. Here is the process.

Project xzy has a profit distribution of $850,000 so what I did, I created a form where you provide Project Name and the profit from such project. Then once you click on distribute profit button, the $850,000 will be distributed to a number of investors(45) based on their % of ownership in that project. So To answer your question, why would I want to print check from a web page. I am creating a form so I can process what I have explained above and to help me once I distribute the profit,I can print those profit and send the check to the investors. It does not have to be a web page, but since all my work in aspx.net, I thought to build such solution to help me and others to automate writing checks .
The above process is done for over 25 project, so imagine how many checks I will manually have to write. So the best way is to come up with a solution that after I distribute the profit, I can have a button on the same form where I distributed the profit, to print the checks.

I hope I gave you enough information to help me find out the best approach. and thanks for your help.
Al
 
First of all, your accounting system should be able to automate this process for you and print the checks.

Is this information stored in a database? After you make the profit distribution for each investor, you could write the information to a database and then generate the report in Crystal with a database call. This would be the way that I would approach this as I think you would want to record the transaction if you don't have an accounting system that does this, and for some reason you can not obtain an accounting system.

If you want to create checks from the amounts calculated by your page without using information from a database, you could create a webpage that has the data in the correct places for the preprinted checks. I think that getting the data to line up correctly would be difficult to do though. Perhaps some one else on this forum can offer a better solution for doing this this way.

You may also want to consider doing this as a Windows Forms project rather than a Web Forms project. You'd have more control over the presentation. It's important to use the correct tools for the job.

What accounting system are you using?
 
Hi, You are right, I am not using accounting system and I do have a table in MS sql server called investor_transaction where I log all transactions. So, when I process the Profit distribution form I get the following saved in the investor_transaction table
id | investor | TransactionType | amount | date
1 | bOB |Profit Distribut | 399.00 | 4/12/04
2 | Robert |Profit Distribut | 250.00 | 4/12/04
.
.
.
so since I have such data in the dataset, what I would like to do is to create a click botton where it iterate through the dataset and print checks.
So are you suggesting to create a form and then loop the above Dataset to populate the form with record one at a time then print the form. this way I will have checks printed.... I am not sure how I would align the data to the check? any idea .
I am not even sure if this is the best approach.. any one can help ?

thanks for your input.
Al
 
Just to emphasize: The best approach would be to get an accounting system that would do all this and more.

But aside from that, since the data is in the database, you would build your report with the designer in Crystal based on a stored procedure. Make a bunch of copies of a sheet of checks to experiment with the placement of the fields so you don't use real checks (expensive and sequentially numbered).

Then on your page you would calculate the profit distribution. Then click a button that launches the Crystal report. There are many posts in this forum about how this is done.
 
I like using Crystal reports to create "A report" formatted to fit exactly onto the check stock. Its much more fixed then web pages and easy to control page breaks. Plus it takes a strongly typed dataset as a datasource. So for every record you could have a new page and thus a new check.

One thing that I would do is to format the amount of the check into a string in code and set it on the record on the dataset. For example you'll need to conver $101.50 to one hundred one and 50/100 dollars and So your report is simple putting data onto the report.

 
Great, I used crystal Report and created a form, ran a couple of print test and I have aligned the data along with the check.... Perfect, One last problem though, How to write the amount in words. When I use quicken, as soon as I type the amount, it automatically type the amount in words and cent/100 for example 33.98 it type thirty-three and 98/100.

I guess what I have just said is something that is not easy to do. But wait in our case, I am not manually writing the check, so I have to deal with cents/100 and how to write amount in words.... I guess we reach a dead end in this one unless there are someone who is genius :) to solve this issue.
Please keep me posted.

Al
 
#Region "Number into Text"

Dim NumberText() As String
Public Function NumberAsText(ByVal NumberIn As Decimal) As String

Dim i As Integer
Dim DecimalPoint As Integer
Dim CardinalNumber As Long
Dim TestValue As Long
Dim NumberSign As String
Dim WholePart As String
Dim BigWholePart As String
Dim DecimalPart As String
Dim UseAnd As Boolean
Dim UseCheck As Boolean
Dim tmp As String

UseCheck = True

Call BuildArray(NumberText)

'decimal check
DecimalPoint = InStr(CStr(NumberIn), ".")

If DecimalPoint > 0 Then
'split the fractional and primary numbers
DecimalPart = Mid$(CStr(NumberIn), DecimalPoint + 1)
WholePart = Left$(CStr(NumberIn), DecimalPoint - 1)
Else
'assume the decimal is the last chr
DecimalPoint = Len(CStr(NumberIn)) + 1
WholePart = CStr(CInt(NumberIn))
End If

'----------------------------------------
'Begin code to assure decimal portion of
'check value is not inadvertantly rounded
'----------------------------------------
DecimalPart = Right(Format$(NumberIn, "0.00"), 2)
TestValue = CType(WholePart, Long)

If TestValue > 999 Then
CardinalNumber = TestValue \ 1000
tmp = tmp & HundredsTensUnits(CardinalNumber) & "Thousand "
TestValue = TestValue - (CardinalNumber * 1000)
End If

If TestValue > 0 Then
If Val(WholePart) < 99 And BigWholePart = "" Then UseAnd = False
tmp = tmp & HundredsTensUnits(TestValue)
End If

tmp &= "and " & Left(DecimalPart & "00", 2)
tmp &= "/100"


'Fill the extra space to the right of the check with ****
Return tmp



End Function

Private Sub BuildArray(ByRef NumberText() As String)

ReDim NumberText(27)

NumberText(0) = "Zero"
NumberText(1) = "One"
NumberText(2) = "Two"
NumberText(3) = "Three"
NumberText(4) = "Four"
NumberText(5) = "Five"
NumberText(6) = "Six"
NumberText(7) = "Seven"
NumberText(8) = "Eight"
NumberText(9) = "Nine"
NumberText(10) = "Ten"
NumberText(11) = "Eleven"
NumberText(12) = "Twelve"
NumberText(13) = "Thirteen"
NumberText(14) = "Fourteen"
NumberText(15) = "Fifteen"
NumberText(16) = "Sixteen"
NumberText(17) = "Seventeen"
NumberText(18) = "Eighteen"
NumberText(19) = "Nineteen"
NumberText(20) = "Twenty"
NumberText(21) = "Thirty"
NumberText(22) = "Forty"
NumberText(23) = "Fifty"
NumberText(24) = "Sixty"
NumberText(25) = "Seventy"
NumberText(26) = "Eighty"
NumberText(27) = "Ninety"

End Sub
Private Function HundredsTensUnits(ByVal TestValue As Long, _
Optional ByVal UseAnd As Boolean = False) As String

Dim CardinalNumber As Integer

If TestValue > 99 Then
CardinalNumber = CInt(TestValue \ 100)
HundredsTensUnits = NumberText(CardinalNumber) & " Hundred "
TestValue = TestValue - (CardinalNumber * 100)
End If

If UseAnd = True Then
HundredsTensUnits = HundredsTensUnits & "and "
End If

If TestValue > 20 Then
CardinalNumber = CInt(TestValue \ 10)
HundredsTensUnits = HundredsTensUnits & _
NumberText(CardinalNumber + 18) & " "
TestValue = TestValue - (CardinalNumber * 10)
End If

If TestValue > 0 Then
HundredsTensUnits = HundredsTensUnits & NumberText(CInt(TestValue)) & " "
End If

End Function
#End Region
 
Add another column to the table in your dataset to hold the string representation of the dollar amount. Loop through that table and set this columns value.

 
A Big Smile you put on my face. You are the man,genius . Thanks for your help and support. By the way, What I can do to be genius like you ? :)

Al
 
Hi i have a related question i think. I have build a sort-of document management system in asp.net. With each document you can press "print" and the document gets printed.

Now the customer asks me to implement a bulk-print function. After a selection, like 1000 documents should be printed, all after each other with a page break.

Can i:
- put them all after each other in one window (with a stylesheet which gives me pagebreaks)
- create a Word/pdf on the fly and automatically call the print function for this?

I dont specifically want to use crystal reports since. I would have to dive into licenties ( do i need to install cr server on development,build,staging/test,production etc...). Has anyone ever done this?


Edward@de-leau.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top