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

Copy/Paste reports in Solution Explorer

8 Answers 477 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gonzalo
Top achievements
Rank 2
Gonzalo asked on 16 Aug 2011, 09:04 PM
Can I copy/paste reports in order to duplicate them and just change the details to have a bunch of different layouts?
Report1.cs,..... reportn.cs...

That way I do not have to recreate most things and quickly get results...

Thanks,

G

8 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 17 Aug 2011, 02:33 PM
Hi Gonzalo,

You cannot make a copy of report to a new object. Telerik Reports are .NET classes and in Visual Studio they usually appear in a couple of code files and a resource file (if any) just like any other class (ex. Windows Forms Form). To duplicate such classes you have to use the IDE's built-in functionality.

Besides the copy-paste-rename approach there are other way to achieve similar results using object inheritance (check this forum thread); as far as Telerik Reports are concerned you may also nest reports (through the SubReport item) to create compound reports.

Kind regards,
Peter
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Gonzalo
Top achievements
Rank 2
answered on 17 Aug 2011, 03:02 PM
Thanks for your prompt reply however from the thread you shared there are problems with the designer when using the approach. Could you provide an example to do this in today's framework (VS 2010). I am using your tools and I am promoting their usage within my work environment (20 potential - they are already commited to get Silverlight). I am hoping the reporting tool presents itself a nice complement.

Best regards,

G
0
Peter
Telerik team
answered on 18 Aug 2011, 05:27 PM
Hi Gonzalo,

The design time issue is that the base report sections can only be changed and displayed in the base report itself. I have attached a sample to illustrate the suggested report inheritance approach. Still if you want to avoid the report inheritance approach the SubReports as report components is a nice solution.

Greetings,
Peter
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Gonzalo
Top achievements
Rank 2
answered on 18 Aug 2011, 09:04 PM
Thanks for your prompt reply Peter. A question surfaces... How do you get report1.cs inherit from basereport.cs in practical terms. Thanks for your support ;-)
0
Peter
Telerik team
answered on 19 Aug 2011, 05:30 PM
Hello Gonzalo,

Check out the attached video that demonstrates how to utilize the report inheritance approach.

Greetings,
Peter
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Gonzalo
Top achievements
Rank 2
answered on 19 Aug 2011, 06:14 PM
How many times can you vote? :-)

The best asset have in addition to the quality of your products is your tech support.

Thanks Peter and my apologies for not seeing the obvious.

Best to you,

 G.
0
Some
Top achievements
Rank 1
answered on 11 Jun 2012, 10:40 PM
Hello,
Using the exact project provided here as a demo if I add parameters to the base constructor and pass those parameters on the constructor of the report that is inheriting from the base I receive the error "Constructor on type "xxxxxx" not found." when attempting to view the reports inheriting from the base report in the designer.  What do I need to do to allow me to use inheritance and have parameters in my base constructor?

Just to be clear to reproduce the issue I am referring to here please take the demo application provided by Peter and make the following changes:
BaseReport.CS line 24:
public BaseReport(string test)

Report1.cs line 15:
public Report1():base(string.Empty)


Thanks in advance for any help it is appreciated.
0
Peter
Telerik team
answered on 14 Jun 2012, 02:10 PM
Hi,

Generally the designers rely on the default constructors. Thus our suggestion is to use only default constructors and use other ways for passing the data like properties.

All the best,
Peter
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Gonzalo
Top achievements
Rank 2
Answers by
Peter
Telerik team
Gonzalo
Top achievements
Rank 2
Some
Top achievements
Rank 1
Share this question
or