Click here to Skip to main content
15,909,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i am working with crystal report , what i do is i write a procedure in sql for my desired table and i create a datatable(WITH THE SAME COLUMNS AS MY DESIRED TABLE) in dataset in csharp then i get the table from sql and bind it to the datatable in dataset

WHAT I WANT ,
From dataset i create crystal report but all the data are in string format so i want to do summary in crstal report like total ,group total .since all my datas which i get in crystal report are in string so what should i do to change the datatype and how to do the total in crystal report
Posted
Comments
Thomas ktg 29-Aug-13 2:33am    
Change the relevant data type for the columns in the dataset itself and use it in the crystal report then the data type will be identified by the crystal report and you can do the total ,etc.
Sudersan Murthy 29-Aug-13 4:08am    
i dont know how to convert the datatype in dataset they are all by default strings only

Let try this:

Assumpt that you have
Quantity Column- Character type

1. Create new column based on data Quantity column and convert data to number call QuantityNum
2. Use QuantityNum to display in report
3. calculate this field as you want to do.

It is worked.
 
Share this answer
 
Comments
Sudersan Murthy 29-Aug-13 4:07am    
how to convert data to number , i am newbie
Within Crystal, we have two type of syntax.

So you can do it by creating a formula that uses the ToNumber function. It might be a good idea to code for the possibility that the field might include non-numeric data - like so:

C#
If NumericText ({field}) then ToNumber ({field}) else 0


you also use the Val() function to do that. you can see more details (Val vs ToNumber here http://kenhamady.com/cru/archives/81[^] )

and the others convert type here http://crystaltricks.com/wordpress/?p=149[^]

hope that is useful for you
 
Share this answer
 
Comments
sushant kushwaha 29-Aug-13 23:49pm    
Sir ,
I recently completed my ASP.Net Application in VS2008
Please give me some tips to deploy the application at IIS server
Thanks......
Anh Nguyen Trong 29-Aug-13 23:52pm    
you should you SSRS instead of crystal report. that is more friendly with microsoft products. easy to deploy.

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