Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
have made a winform and as i am a learner started c# quite few months ago i have a need of creating reports so i created a reports using wizard but now i have a need of chaging the reports. so i thought up of building the reports not with the wizard but with the code so that i can change the query
select * from table1
and the second query for the next reports as
select * from table2
. so that i can put the searching facility in my reports.but i have googled out and i cant find any reports componenets. means what component are required for developing reports. like if it use dataset or datatable. an example will help me to build. sorry for my bad english as i am weak in it.
Posted

 
Share this answer
 
Comments
Menon Santosh 29-Mar-13 2:00am    
nice solution
sariqkhan 29-Mar-13 4:44am    
sandeep sir. in that two article where i can write the query?? is there any option that i can change the query?
Sandeep Mewara 29-Mar-13 4:51am    
If you really need it then for SSRS, you can define query using expressions. Easy would be to have two reports with static query and design - show the report as per need.
sariqkhan 29-Mar-13 5:22am    
sir i am using the windows form, not the webform and sir the query will be of depend on month so i dont want to make total 12 reports for each and every month
Sandeep Mewara 29-Mar-13 5:25am    
Then look for 'query via expressions in SSRS'

BTW, if everything (data columns) remain same and just the month changes, then that can be one parameter to one SQL query and one report. Why multiple query or report?
Just have a paramter (in where clause), pass that at runtime and show the data returned.
you need some basic of creating crystal report so first go through the following article

Creating Crystal Reports using C# with Datasets[^]
 
Share this answer
 
Comments
sariqkhan 29-Mar-13 4:42am    
sir. what is this. in that article??
DBConnection DBConn = new DBConnection();
OleDbDataAdapter myDataAdapter = DBConn.getDataFromDB();
Menon Santosh 29-Mar-13 5:43am    
DBConnection is a class, and getDataFromDB is a function which return dataadapter, you better download the code to understand it well

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