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

creating table report

12 Answers 557 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ibrahim Imam
Top achievements
Rank 1
Ibrahim Imam asked on 05 Jan 2009, 10:45 AM
as i read in the forum there is currently no control that supports table view so i have to build it on my own.

i have lists of columns, rows and values and want to create a table out of this using a subreport.
some fixed data is already bound correctly and displayed in the subreport using the NeedDataSource Event in the master report.
because the columns are not fixed i can not use the usual approach in defining all columns and then create the table in the detail section. what is the best approach to get this subreport? should i completly create the report at runtime?
or create the report but add the textboxes manually at runtime?
where do i have to place my code so that i am having the datasource of the subreport and can add my fields according to it?


12 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 07 Jan 2009, 12:40 PM
Hello Ibrahim,

Currently there are a couple of approaches for creating a table-like layout:
  • One way to achieve a table layout is by docking all of your report items to the left. In this way they will stick to the left leaving no empty space between them. They will also stick to the top and bottom edges of the section. You can then select all report items that will be part of the table and set a border in order to create a real table-like appearance.
  • use shape items to "define" the table.
In this line of thoughts, I do not see how the way you create your items has to do with the above approaches - please clarify.
Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ibrahim Imam
Top achievements
Rank 1
answered on 07 Jan 2009, 12:52 PM
i think in the current approaches you always start with a fixed number of columns but my number of columns vary depending on the data i have so i have to create this at runtime right?
0
Steve
Telerik team
answered on 07 Jan 2009, 01:29 PM
Hi Ibrahim Imam,

With the current approaches you just need to have in mind the creation of additional "scaffolding" if you decide to use shape items, or simply set borders on the textbox items that make your table.

All the best,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ibrahim Imam
Top achievements
Rank 1
answered on 07 Jan 2009, 02:00 PM
hello

i am not talking about the design or layout of a table but the creation of the items for the table.

i have to add textboxes(for the columns) depending on my datasource (list of items).

0
Ibrahim Imam
Top achievements
Rank 1
answered on 08 Jan 2009, 10:36 AM
for better understaning:

i have a report "Target" which has a subreport "TableTarget".
the "target" report passes the Class "TableTargetData" to the "TalbeTarget" report using the needdataSource Event (that already works)

the TableTargetData has the following structure:

string TableName;
List<string> Columns;
List<string> Rows;

now in the subreport i want a table-like layout using the TableTargetData information.
for the table name i can create textbox and bind it to the property as usual(already works)
the columns shall be listed on the right of the tablename, the rows beneath to get the table layout.
because the number and names of the columns is not fixed i have to create it at runtime, right?

0
Ibrahim Imam
Top achievements
Rank 1
answered on 09 Jan 2009, 10:39 AM
can you please give me a hint on where to add my textboxes using code instead of designer - we already purchased the premium collection and need to publish our report next week.

thanks in advance

0
Hrisi
Telerik team
answered on 10 Jan 2009, 04:47 PM
Hi Ibrahim Imam,

This is not a common scenario but it is still possible to create report on the fly with our reporting engine.  In the attached Target.zip we demonstrate how to accomplish such a task. Some notes about the implementation:

   1. Data for the subreport is much different. The purpose is to create data for the subreport.
   2. Creating the definition of the subreport during processing stage is somehow tricky. We should retrieve reference for the underlining report from the processing subreport item, clean the definition and recreate again.

Give it a spin and let us know of the outcome.

Sincerely yours,
Hrisi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ibrahim Imam
Top achievements
Rank 1
answered on 20 Jan 2009, 07:16 PM
hello

i used a temporary solution which only supports a limited number of columns because of our tight deadline but
i had a quick view of the given sample and it seems to exactly solve my problem.

i'll let you know when i implemented the correct solution

regards

0
jain
Top achievements
Rank 1
answered on 20 Apr 2009, 01:29 PM
Hi,
i have some prob while exporting the report into xls format.
I am getting extra columns.
can u pls help me out in solving the prob.
i have even  specified dock left but stil have got many extra columns.
can u just help me out as soon as possible.
0
Steve
Telerik team
answered on 21 Apr 2009, 07:30 AM
Hello jain,

Please review the following help article: Design Considerations for Excel Rendering. We assume the extra columns you mention are spacer columns and you can avoid them by aligning your report items, so that so their edges coincide. More info is available in the "Report item layout" subset of the help article. It is worth mentioning that spacer rows/columns cannot always be avoided, depending on your layout, as the excel export tries to present the report as close to WYSIWYG as possible. If you only care for the data, then you might consider using export to csv, which ignores the layout and formatting.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
jain
Top achievements
Rank 1
answered on 21 Apr 2009, 02:08 PM
Hi,
  Thanks a lot for your suggestions.It helped me a lot.
 At present have got prob while exporting the report into CSV format.
Can you pls help me out in solving the problem.


Thanks & Regards
Stella
0
Steve
Telerik team
answered on 21 Apr 2009, 02:20 PM
Hi jain,

Can you share what is the problem with the csv export? If you're referring to the "extra" columns in csv format, these are the header textboxes which as explained in the Design Considerations for CSV Rendering are repeated for each row. This KB article explains how to remove headers and static rows from the exported csv.
If this is not the problem you're talking about, please open a support ticket and attach a sample report replicating the issue with steps to reproduce and explanation of the issue.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Ibrahim Imam
Top achievements
Rank 1
Answers by
Steve
Telerik team
Ibrahim Imam
Top achievements
Rank 1
Hrisi
Telerik team
jain
Top achievements
Rank 1
Share this question
or