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

Print Support

8 Answers 108 Views
Dock
This is a migrated thread and some comments may be shown as answers.
KUMARAN
Top achievements
Rank 1
KUMARAN asked on 10 Feb 2015, 08:38 AM
I want Print Two Documents , Each of them contains Separate RadGridview.

How To use Print support For two grids alternatively .

It would be pleasure if you send a sample attachment.

Thanks in Advance. 

8 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 12 Feb 2015, 04:06 PM
Hi Kumaran,

Thank you for writing.

I would suggest that you call the Print method for each of your RadGridView controls. Additional information on the printing support can be found here. I created an example which you can find below:
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
 
        DataTable dataTable = new DataTable();
        dataTable.Columns.Add("Id", typeof(int));
        dataTable.Columns.Add("Name", typeof(string));
        dataTable.Columns.Add("IsValid", typeof(bool));
        for (int i = 0; i < 10; i++)
        {
            dataTable.Rows.Add(i, "Name " + i, i % 2 == 0);
        }
 
        this.radGridView1.DataSource = dataTable;
        this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
 
        DataTable dataTable2 = new DataTable();
        dataTable2.Columns.Add("Age", typeof(int));
        dataTable2.Columns.Add("Date", typeof(DateTime));
        dataTable2.Columns.Add("isTrue", typeof(bool));
        for (int i = 20; i < 30; i++)
        {
            dataTable2.Rows.Add(i, DateTime.Now.AddDays(i), i % 2 != 0);
        }
 
        this.radGridView2.DataSource = dataTable2;
        this.radGridView2.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
    }
 
    private void radButton1_Click(object sender, EventArgs e)
    {
        //this.radGridView1.Print(true);
        this.radGridView1.PrintPreview();
    }
 
    private void radButton2_Click(object sender, EventArgs e)
    {
        //this.radGridView2.Print(true);
        this.radGridView2.PrintPreview();
    }
}

I hope that this information helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
KUMARAN
Top achievements
Rank 1
answered on 13 Feb 2015, 07:21 AM
Let me clarify.I am using Rad Dock to see two or more grid view in same page .Here i want use a single Print button for using print support for all my documents in the Rad Dock View. Is that possible .

Note: I want Samples in vb.net
0
Hristo
Telerik team
answered on 16 Feb 2015, 02:20 PM
Hi Kumaran,

Thank you for writing back.

I created a sample project in which I have populated two windows in a RadDock control with two RadGridView elements. Just as in my previous example all you have to do is call the Print method of the two grid controls

Please find attached my example project.

I hope this helps. Should you have further questions please do not hesitate to writ e back.

Regards,
Hristo Merdjanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
KUMARAN
Top achievements
Rank 1
answered on 20 Feb 2015, 05:30 AM
Your answer is lot helpful, and I am using Hierarchical view for my Report with multiple child templates. Is there any possible to print each child template separately while using Hierarchical Grid view .If that is possible send as attachment which will helpful for me.

Thanks in advance.
0
Hristo
Telerik team
answered on 24 Feb 2015, 05:11 PM
Hello Kumaran,

Thank you for writing back.

For the time being RadGridView does not provide this type of functionality. We have a feature request which is logged in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item.

We are currently trying to gather feedback regarding this feature, so I will really appreciate if you can add your comment to the feedback item with information how would you expect this to work. Precisely I am interested in:

- how would you visually imagine the child to be rendered - should it just be
parent row
child rows
do you expect them connected with a line or something? Some sketch would be really appreciated.

- in case of multiple child levels, how do you expect them printed:
parent row
row with caption from the first tab
child rows for this tab
row with caption from the second tab
child rows for this tab
is it something like this, or would you prefer something different?

Any other feedback would be greatly appreciated.

Meanwhile, I can suggest the approach which is implemented in the attached example project. You could iterate the ChildRows collection of each GridViewHierarchyRowInfo in your grid. Then create a new RadGridView control and fill it with the rows in the ChildRows collection. This grid control would only serve for the purpose of printing. At the the end it will print out only the child templates. You can modify the project so that it fits in your scenario, you could pass a GridViewHierarchyRowInfo parameter and this way specify where you should start printing.

An alternative solution might also be an export to pdf and then printing your RadGridView as a pdf document, an example is discussed here. I am sending you attached my sample project as well as a gif file showing the result on my side.

I am looking forward to your reply.

Regards,
Hristo Merdjanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
KUMARAN
Top achievements
Rank 1
answered on 03 Mar 2015, 10:20 AM
Thanks for you reply,but your Sample doesn't helped me.I see nothing in that. please provide a Valid sample or Am I wrong.
0
KUMARAN
Top achievements
Rank 1
answered on 03 Mar 2015, 10:34 AM
I seen Export Pdf method in help link.It worked little bit,yet there i can't find export Hierarchy into Pdf .it would be pleasure if you send sample project for that problem too.

Thanks in advance.

Note : Need Vb coding
0
Accepted
Hristo
Telerik team
answered on 05 Mar 2015, 12:20 PM
Hello Kumaran,

Thank you for writing back.

I have modified my project to include an example of exporting hierarchical grid data to a pdf file and then printing it.

Since we have not yet implemented direct printing of hierarchical data please share with us what are your thoughts and how you would like to see this feature developed.

Thank you. Looking forward to your reply.

Regards,
Hristo Merdjanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Dock
Asked by
KUMARAN
Top achievements
Rank 1
Answers by
Hristo
Telerik team
KUMARAN
Top achievements
Rank 1
Share this question
or