Click here to Skip to main content
15,894,540 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to print some receipts continuously. I wrote some stored procedure for single receipt.
but how to write stored procedure for more than one receipt print. I want to take input from client like starting receipt number and ending receipt number and generate receipts for that. so that he can take print of all that receipts.

What I have tried:

I tried For that but failed. Fro single receipt it is coming. but taking user input and generate receipts that one I am not getting.
Posted
Updated 9-Jul-17 21:41pm
v2

1 solution

If you have designed your crystal report correctly with keeping the values those are supposed to be iterated in the details section, then you just need to do minor changes in the stored procedure.

You can make use of LIKE to do so.
SQL
ALTER PROCEDURE MySP
(
  @ReceiptNoSample VARCHAR(20)
)
AS
BEGIN
  SELECT * FROM MyTable WHERE ReceiptNo LIKE @ReceiptNoSample+'%'
END


Further study here - SQL LIKE Operator[^]

Hope, it helps :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900