Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Want to Display Report which has 10 Fields.

I have a DataGridView which has 2 Columns in which First contains Checkbox and Second contains Name of Field Displayed on to the Report. Now According to Checkboxes checked by User only those Fields are Displayed on to the Report.
It is done Well but Spaces are not Adjust. I Want to display Report by Adjusting Spaces.

For e.g. I Want to design report for 10 fields; but if user wants to display report with only those fields he want (less than 10), then it is done. The problem is that the fields does not adjust overall space of report form.
Posted
Updated 26-Mar-11 8:14am
v2
Comments
HimanshuJoshi 26-Mar-11 14:15pm    
Removed urgency from post. It is considered rude to state that it is urgent for you.

1 solution

connect crystal report directly from datasource and from front end pass datatable or sql query to that report it will automatically adjust space
 
Share this answer
 
Comments
Sonje Girish 5-Apr-11 6:38am    
ReportDocument r;
r = new Report();
r.SetDataSource(dt);

crystalReportViewer1.ReportSource = r;
Sonje Girish 5-Apr-11 6:41am    
I can do using following way as
ReportDocument r;
r = new Report();
r.SetDataSource(dt);

crystalReportViewer1.ReportSource = r;

in which dt contains the field which user wants to display on the report but it does not adjust spaces on the report.
[no name] 6-Apr-11 2:05am    
in your crystal report file connection was not based on dataset so that's why it will not adjust space.
Sonje Girish 7-Apr-11 22:20pm    
now i am using dataset but still it is not working plz help me
if (ds.Tables[0] != null)
{
if (ds.Tables[0].Rows.Count != 0)
{
ReportDocument r;
r = new Report();
r.SetDataSource(ds.Tables[0]);

crystalReportViewer1.ReportSource = r;
}
if u give me u r email id then i send you my code plz
[no name] 11-Apr-11 23:56pm    
upload to any free file hosting site and give me link i will download and check it.

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