Click here to Skip to main content
15,891,734 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
i am creating a windows application in which i have to make a Invoice.
for the invoice printing i used crystal report, and every time only one record should printed.

now the data saved in database like
(table structure)
id     particular        amount
1     ABC,XYZ,PQR    12.00,20.00,13.00

and i want to print the invoice like  

S.No     Particulars     Amount
1            ABC         12.00
2            XYZ         20.00
3            PQR         13.00

i am successful to splite "Pariculars" and "Amount" column by comma(",") but cann't able to generate S.No. column
anyone have idea about it...Please help

thanks in advance
Posted
Updated 1-Oct-16 6:17am

Automatic serial number can be generated in Crystal Reports using Running Total field setting the summary type as count.
An example is given here
http://www.dotnetfunda.com/articles/article623-add-serial-number-in-crystal-report.aspx[^]
I think this may be helpful to you.
 
Share this answer
 
Comments
bkthebest 25-Mar-12 14:39pm    
thanks for reply
actually i did it.
and it works but problem is that it works only when more than one row coming from database.
and as i wish only 1 row comes from database.
serial no. must generate on the basis of comma separate fields.
see my example above...
ProEnggSoft 25-Mar-12 20:53pm    
I think the better alternative will be to create a temporary DataTable as per your requirement, separating the comma separated values into each row and then use this DataTable for generation of report in Crystal Report, as I am doubtful and not sure whether we can achieve Sl.No. for each of the comma separated values in Separate row in Crystal Report directly. If my answer is useful then you may accept and vote the solution, otherwise please post your queries.
Thank you
ProEnggSoft 26-Mar-12 0:59am    
Another option is to use a Formula, with a global variable for SlNo. Each time a record is printed, the variable is incremented. The link http://stackoverflow.com/questions/7673897/global-variable-in-crystal-reports may be helpful.
safsssadasdsadasdsadssaddsadsa
 
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