Dynamic Crystal Reports
-
Hi Techs, I searched the whole day for this. I didn't get any help from anyone nor there is anything in net. I can find so many queries on this but nobody has replied. This is a perfect requirement of industry. I don't have any of how to carry about this. Here is my Question =================== I wanted to create Crystal report dynamically(preferably Crosstab) and add Columns(Fields) at run time to report from code behind. I am using CrystalReportViewer to show the Report. Backend is Ms-Sql Server 2000. Any method to add columns to Report & display. Any kind of Sample is appreciated. Sample Code Plz Thanks in advance Satish Krishna M satishkrishna
-
Hi Techs, I searched the whole day for this. I didn't get any help from anyone nor there is anything in net. I can find so many queries on this but nobody has replied. This is a perfect requirement of industry. I don't have any of how to carry about this. Here is my Question =================== I wanted to create Crystal report dynamically(preferably Crosstab) and add Columns(Fields) at run time to report from code behind. I am using CrystalReportViewer to show the Report. Backend is Ms-Sql Server 2000. Any method to add columns to Report & display. Any kind of Sample is appreciated. Sample Code Plz Thanks in advance Satish Krishna M satishkrishna
>design report in report expert >give a name to u r report e.g. rptMain wtite code like this dim rDoc as new rptMain() '--now build a data table / data reader object '--i guess u r familiar with that '--the datatable must return same columns as defined in report at design time '--**this way u can bypass logininfo of sql server** Dim tb as datatable = myMethodOfPopulatingIt() rDoc.SetDataSource(tb) '--bind to cr viewer myCrViewer.ReportSource = rDoc hope this helps
-
>design report in report expert >give a name to u r report e.g. rptMain wtite code like this dim rDoc as new rptMain() '--now build a data table / data reader object '--i guess u r familiar with that '--the datatable must return same columns as defined in report at design time '--**this way u can bypass logininfo of sql server** Dim tb as datatable = myMethodOfPopulatingIt() rDoc.SetDataSource(tb) '--bind to cr viewer myCrViewer.ReportSource = rDoc hope this helps
Hi arv, Thanks for reply. But what I am looking out for is somewhat different. I wanted to add new columns to reports at runtime. Let's say there are no columns added to reports at design time. At runtime I wanted to add few columns(say 3 Columns) at first execution. May be in the second execution I wanted 5 Columns. This way it may keep varying every time. Is there anyway that we can do it. Hope my requirement is clear. satishkrishna