Print Support

9 posts, 1 answers
  1. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 10 Feb 2015 Link to this post

    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. 
  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 12 Feb 2015 Link to this post

    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.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 13 Feb 2015 in reply to Hristo Merdjanov Link to this post

    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
  5. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 16 Feb 2015 Link to this post

    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.

     
  6. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 19 Feb 2015 in reply to Hristo Merdjanov Link to this post

    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.
  7. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 24 Feb 2015 Link to this post

    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.

     
  8. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 03 Mar 2015 in reply to Hristo Merdjanov Link to this post

    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.
  9. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 03 Mar 2015 in reply to KUMARAN Link to this post

    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
  10. Answer
    Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 05 Mar 2015 Link to this post

    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.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready