Click here to Skip to main content
15,911,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi experts,

Thanks for viewing. I am facing some problems.

I am using followings to generate report:
OleDbConnection DBConn = new OleDbConnection("provider = microsoft.jet.oledb.4.0;" + "data source=" + Form1.path);
            OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(strSQL2, DBConn);
            DataSet dataReport = new DataSet();
            myDataAdapter.Fill(dataReport, "wtdetail");
            Weighmet1 myDataReport = new Weighmet1();

            myDataReport.SetDataSource(dataReport);
            crystalReportViewer1.ReportSource = myDataReport;


Here "strSQL2" is like this "select field1,field2, field3 as ABC from ...". in my designer I have inserted all fields suppose field1,field2,field3. all fields are displayed OK except field3 which has the alias name "ABC".

any help please.

- anil kumar bhakta
Posted
Updated 20-Oct-10 22:04pm
v4
Comments
Abhinav S 20-Oct-10 12:49pm    
Sorry but this is too little information provided. How do you populate your crystal report? Make sure the value is included in your query.
Dalek Dave 21-Oct-10 4:04am    
Edited for Code Blocks and Readability.

1 solution

Well, did you made the query change? Add the new field in the query such that the data is returned. Then refresh your dataset in your report (if it has already defined fixed data expected).
Once you get the new field in the dataset that you must be binding with Crystal report, drag-drop/use it in your report for display.
 
Share this answer
 
Comments
anil_kumar_bhakta 20-Oct-10 13:47pm    
thanks. i have trace out the exact problem. actually my "select statement" is as below: -
"select field1,field2, field3 as ABC ....". in my report designer the field "field3" appears but data of this is not showing.

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