This is a migrated thread and some comments may be shown as answers.

Generating report without using Wizard

7 Answers 173 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ridhz
Top achievements
Rank 1
ridhz asked on 08 Apr 2009, 06:30 AM
Hi...
Is it possible to generate reports without using wizard ??
Right now i am generating reports using wizard provided by telerik reporting tools. But now i want to do all these things programatically. is it possible?? Please reply me soon.

7 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 09 Apr 2009, 09:02 AM
Hi ridhz,

The report wizard does not create the report by magic. It just automates the whole process and generates the code for you, however you can find it in the InitializeComponent() method. This way you can create something through the designer and then see what is the code that is generated for you i.e. how to do this programmatically. You can also use the "Programmatic Control of reports" help section as a starting point.

All the best,
Steve
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
ridhz
Top achievements
Rank 1
answered on 09 Apr 2009, 10:52 AM
Yea, i have seen that help and got some idea.
And the code which i found from help doesn't allow to connect with the SQL database.
In my application, it shows error while i am assigning report to telerik reoprtviewer.

Through this link, I found that namespace is required to be generated?? is it??
 http://demos.telerik.com/reporting/examples/productcatalog/defaultcs.aspx

0
ridhz
Top achievements
Rank 1
answered on 09 Apr 2009, 11:04 AM
And yea, one imp thing.. how to bind data as it is not given in help
And how can i add dataset to my report as i have seen in demo..

         this.productCatalogDataSetTableAdapter1.Fill(this.productCatalogDataSet.ProductCatalogDataSetTable);

The second thing, i have provided the columns in which i want to retrieve the data from SQL database. But how to bind it to database?
0
Steve
Telerik team
answered on 09 Apr 2009, 11:09 AM
Hi ridhz,

Telerik Reporting does not provide its own data layer but depends on the existing .NET objects (DataSet, Data Table, DataView, ADO.NET, lists - for more information on report data binding, please, refer to this help topic). In this line of thoughts the report is not aware and it does not matter what the datasource is, as long as it is one of the supported ones listed above.

Sincerely yours,
Steve
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
ridhz
Top achievements
Rank 1
answered on 09 Apr 2009, 11:56 AM
oh. hi.. thanx for your reply.
But again that help code does not allow to connect to the database.
It gives an error in sqlConnection1.

The statement is:
sqlConnection1 =
new System.Data.SqlClient.SqlConnection();
0
Steve
Telerik team
answered on 09 Apr 2009, 12:12 PM
Hi ridhz,

The code from the help article comes from a running application and has been given to clients since v.1.x. Please debug your application in order to see where the problem comes from and address it. Also as explained in my previous post, this code is just a starting point and is not in any way specific to Telerik Reporting. If you have some other code to programmatically bind a databound control - then go ahead and use it, just make sure you set the data to the report.DataSource property at the end.

All the best,
Steve
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
ridhz
Top achievements
Rank 1
answered on 09 Apr 2009, 12:25 PM
Thanx.
I did connection with my own code but now the exception generated.

Exception Details:
System.NotSupportedException: Specified method is not supported.

Please provide me some guidance.
Tags
General Discussions
Asked by
ridhz
Top achievements
Rank 1
Answers by
Steve
Telerik team
ridhz
Top achievements
Rank 1
Share this question
or