Skip Navigation LinksHome / Community & Support / Code Library / WinForms > GridView > Telerik.Reporting report generation using RadGridView for WinForms

Not answered Telerik.Reporting report generation using RadGridView for WinForms

Feed from this thread
  • Posted on Jun 10, 2008 (permalink)

    Requirements

    RadControls and Reporting versions

     

    Q1 2008 SP1
    .NET version

     

    2.0
    Visual Studio version

     

    VS 2005
    programming language

     

    C#
    To convert code Telerik online converter

     
    PROJECT DESCRIPTION

    UPDATE (07/22/2010): RadGridView Q2 2010 natively supports Export to PDF, so this code library project is closed for further comments, because it becomes obsolete. Please, consider upgrading to Q2 2010+ instead.
    In case you are using older versions of our tools and this library, and have further questions, please open a new support ticket from your account and we will help you out.

    This article presents an example application, which exports data from the RadGridView into Telerik Reporting using a custom class library called RadGridReportingLite. The report can then be printed or exported in a variety of formats.

    You can directly reference it in your project. Keep in mind that you need to have both products installed: RadControls for WinForms and Telerik Reporting. You can find additional information on how to generate and setup a report based on data in RadGridView in the following KB article.

    Attached files

  • michelle avatar

    Posted on Jul 30, 2008 (permalink)

    Is the same type of functionality available for the RadGrid used in WebForms?  We are in need of a tool that will export grid formatting to RTF.

    Thanks!

  • Steve Steve avatar

    Posted on Jul 31, 2008 (permalink)

    Hi Michelle,

    You can directly use the Web RadGrid export options for your needs. RadGrid for WinForms does not have any export options yet, and that is why we've created this code library.

    All the best,
    Steve
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  • Jacob avatar

    Posted on Feb 10, 2009 (permalink)

    Can I have vb version of this project?

    Thank you.

  • Steve Steve avatar

    Posted on Feb 10, 2009 (permalink)

    Hello Jacob,

    Please use the code converter as suggested in the code library info table. If you hit specific problems with the conversion, let us know and we would gladly help.

    Kind regards,
    Steve
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Jul 8, 2009 (permalink)

    Hello folks.

    I just want to make a follow-up to this topic with latest build of RadGridReportingLite class that works with latest version of the Winforms Controls and Telerik Reporting - Q1 2009 SP1. Please, find the projects as attachment to this message.

    Best wishes,
    Martin Vasilev
    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.
    Attached files

  • Rodney Foley avatar

    Posted on Dec 1, 2009 (permalink)

    Is there plans to update this (or create a new one) to support WPF 2009.3 and .NET 3.5?

  • Pavel Pavlov Pavel Pavlov admin's avatar

    Posted on Dec 4, 2009 (permalink)

    Hi Rodney Foley,

    RadGridView for WPF and Silverlight has its own  integrated exporting logic. For more information you may have a look at the following help topic.

    In case you need any assistance adapting this to your project , please open a thread (or a support ticket)  in the RadGridView for WPF section and we will be glad to help.

    Sincerely yours,
    Pavel Pavlov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

  • Rodney Foley avatar

    Posted on Dec 4, 2009 (permalink)

    Greetings Pavel,

    Feel free to review my support tickets and you will see that I am fully aware of those export methods which are for lack of a better word "crap". Exporting thousands of records and especially tens of thousands of records via a STRING is insane.  That method of export should at least a stream, if not also provide template abilities if they wish to have it be direct from the control itself.

    Why wouldn't Telerik want to make it as easy as possible to get the current "VIEW" of data in a RadGridView into one of their Reporting framework?  I thought that was one of the reasons for this code library item.  It seems to me that it would help to increase the use of your Reporting framework, while also making an easy way for developers to provide nice formated views of the data for users to Print or Export to PDF or XLSX formats.

    I ended up using the OpenXML SDK to export the raw data that was used to populate the Grid to get a formated table view into an XLSX format.  However to keep it simple and easy to implement I had to stick with the raw data used, it would become more complex to export the data as the user has organized it via grouping, sorting and filtering.  Which I would assume a bridge object of some type could manage nicely and could be best implemented by the company who wrote both the control and the reporting framework.

    With that said, all I was asking for is if Telerik had plans to update this item in the code library so that it would support the latest release (which it currently does not).  That was all. Most companies I assume are not using almost 2 year old libraries in their code base and if they are they may already be making plans to migrate to a new version over the next 12 months.  

    Being told in not so many words "No" and then to be directed to a horrible solution as its replacement is not really the answer I was looking for. I was either expecting a simple "No", a "No" with an alternative solution that had the same basic outcome that still used the Reporting framework, or a "Yes" with a time frame of when to expect an update.

  • Vassil Petev Vassil Petev admin's avatar

    Posted on Dec 8, 2009 (permalink)

    Hello Rodney Foley,

    I will forward your request for such an example using RadGridView for WPF to our WPF team.

    The current project is for RadControls for WinForms, and not for WPF. Since we update these projects upon request (but not with each new release), please let us know whether you need a new version with our WinForms controls and we will do our best to have it uploaded tomorrow.
     
    Best wishes,
    Vassil
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

  • Nick Nick admin's avatar

    Posted on Dec 17, 2009 (permalink)

    Hello Rodney Foley,

    We actually do not plan to work on a WPF Report Viewer this quarter. This is indeed a great suggestion and we will definitely consider it, however, this Q we will be mainly focused on VS 2010 support and improvements in our existing controls, as well as working on our native controls for Silverlight 4 that are in a CTP stage right now.

    Greetings,
    Nick
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

  • Posted on Feb 22, 2010 (permalink)

    Hi Martin,

    In cases where Grid columns may have an empty string for the HeaderText, the report viewer generated an error rendering the column. By referencing FieldName rather than HeaderText in RadGridReport.cs it seemed to resolve this issue.

    I updated the line in CreateTableFromTemplate() to:

    table.Columns.Add(gridViewTemplate.Columns[col].FieldName, gridViewTemplate.Columns[col].DataType); 

    And the following lines under the REPORT TABLE ROWS region in AddReportData():

    dataTextBox.Name = grid.Columns[i].FieldName + "FieldTextBox";
    dataTextBox.Value = "=Fields.[" + grid.Columns[i].FieldName + "]";


    Thanks again for this code.

    Benjie

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Feb 24, 2010 (permalink)

    Hello Benjie Ward,

    Thank you very much for sharing your code with us. Apparently, your approach is definitely better than used in the sample application. We will update our code in near feature. I have add 500 Telerik points to your account. Do not hesitate to contact us again if you have other questions.

    Regards,
    Martin Vasilev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  • Ken avatar

    Posted on Mar 30, 2010 (permalink)

    I had modified RadGridReportingLite for improved features and named the RadGridReportingLite2.

    To improve the function, as follows:

    1. Implementat summary:SUM, COUNT function...
    2. For entire report, customize the font
    3. To increase TITLE item(maximum 5 items) per page

    The project should reference to RadGridreportingLite2, RadGridreportingLite2Utility

    The following are examples (at the FormMain.cs of ExampleApplication.sln)

    // Group
    report.GroupCaption = new string[] { "ManagerID Caption:" };

     

    // Summary Column:EmployeeID, ContactID
    report.SummaryItems = new List<RadGridReportingLite2.Summary_Item>()
    {
      new Summary_Item("EmployeeID", "EmployeeID", string.Empty, " records", string.Empty, GridAggregateFunction.Count),
      new Summary_Item("ContactID", "ContactID", string.Empty, string.Empty, "###,###,##0",GridAggregateFunction.Sum)
    };

    report.CellFont = new Font("Arias", 9f, FontStyle.Regular);
    report.RepeatTableHeader = form.RepeatHeaderRow;

    RadLabel lblTitle1 = new RadLabel();
    lblTitle1.BackColor = System.Drawing.Color.White;
    lblTitle1.Text = "Title1";
    lblTitle1.Font = new Font("Arias", 14f, FontStyle.Bold);
    lblTitle1.TextAlignment = ContentAlignment.MiddleCenter;
    report.TitleText1 = lblTitle1;

     

    RadLabel lblTitle2 = new RadLabel();
    lblTitle2.BackColor = System.Drawing.Color.White;
    lblTitle2.Text = "Title2";
    lblTitle2.Font = new Font("Arias", 12f, FontStyle.Bold);
    lblTitle2.TextAlignment = ContentAlignment.MiddleCenter;
    report.TitleText1 = lblTitle2;
    ....

    Source code in the attachment, and want to help you.

    RadControls and Reporting versions: Q1 2008 SP1

    Ken

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Apr 2, 2010 (permalink)

    Hello SIN YI,

    Thank you very much for posting your code and detailed description in our code library section. I have added additional Telerik points to your account. Let me know if you have any other questions.

    Greetings,
    Martin Vasilev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  • Ken avatar

    Posted on Apr 4, 2010 (permalink)

    It was my pleasure If any of the benefit.
    The Telerik's products to help me design better software quality, and I am pleased to have chosen the Telerik.

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Apr 26, 2010 (permalink)

    Hi all,

    Please find the latest build of RadGridReportingLite library as an attachment. It contains some minor fixes and changes which allow for using it with the latest WinForms Q1 2010 SP1 and Reporting Q1 2010 SP1 versions.

    Kind regards,
    Martin Vasilev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Attached files

  • Nick Conder avatar

    Posted on Jun 1, 2010 (permalink)

    Do you have an updated version of your ReportingLite2?

    The version you had up for download uses older telerik reporting and generates an error that it cant find telerik reporting version .828.

    I tried adding the references to the new and missing assemblies and recompile but it also had many errors. like telerik.reporting.processing, there is no processing or interfaces assemblies in the current version of the telerik reporting but they are required references in your source code.

    Any help would be greatly appreciated.

  • Ken avatar

    Posted on Jun 2, 2010 (permalink)

    Hi,
    I run the attachment-radgridreportinglite.zip and without any errors, 
    If you use the ReportingLite2, Can give the wrong snapshot?

    Ken

  • Nick Conder avatar

    Posted on Jun 2, 2010 (permalink)

    Attached are a couple screen shots of the issues. All I did was unzip the files and open them in VS 2008. There are two assemblies that I can not find in the current Telerik Reporting and that is the INTERFACES and PROCESSING. I am using the latest version.

    I can compile and use the original reporting light with out a problem. 

  • Ken avatar

    Posted on Jun 2, 2010 (permalink)

    I combined the necessary assemblies as the attached based on the screen shots.
    Please join your project, and reference them.

    Hope to solve your problem.

    Ken

  • Nick Conder avatar

    Posted on Jun 2, 2010 (permalink)

    What version of Telerik Reporting and Telerik Win controls are you using.

    The assemblies you provided are from a different version than the most current version of reporting and controls.

    I added the references to the assemblies you provided in your zip file and it just made it worse.

    Attached are new screen shots of the errors now and also screen shots of the properties for the Telerik Reporting properties showing the current version info and a screen shot of one of the assemblies you sent.

    If you look at the errors screen shot you will see that processing and interfaces are part of the telerik reporting main assembly now compared to you version which looks like maybe an older version or something.

    Even though processing and interfaces appear to be part of the main reporting assembly now there are still errors through out the source due to that it can not find the references in the telerik reporting assembly for the current version.

  • Ken avatar

    Posted on Jun 2, 2010 (permalink)

    ReportingLite2 used the RadControls and Reporting versions is Q1 2008 SP1.

    Ken

  • Nick Conder avatar

    Posted on Jun 2, 2010 (permalink)

    wow thats is pretty dated. Any chance you are going to update your version using the latest version of the controls? I am going to work on that myself to help contribute, but right now my only issue is my project schedule really has me limited on any free time to work on side projects.

  • Ken avatar

    Posted on Jun 2, 2010 (permalink)

    I am sorry about that.
    If the separation of the functions of print as a separate dll file
    that uses different version and the main function to call it, can it?

    Ken

  • Nick Conder avatar

    Posted on Jun 2, 2010 (permalink)

    thats what you would think but apparently that is not the case.

  • Posted on Jun 25, 2010 (permalink)

    Dear Steve
    Nice project, but I cannot report only RadGridView.SelectedRows to the report viewer. How would you do that?
    Thanks

  • rohini ashok avatar

    Posted on Jun 28, 2010 (permalink)

    Hi,
    Please help me how to add the Radgridreportinglite.dll reference into my VB project..
    if i add that reference and give Imports Radgridreportinglite..its not workig..
    Pls help urgent

  • Jack avatar

    Posted on Jun 29, 2010 (permalink)

    Hi,

    I tried to used RadGridReportingLite.dll to export my RadGridView into Reports, it's seems to work perfectly execpted for the GridViewSummaryItem and GridViewSummaryRowItem. Those rows are visible in the Grid but not in the report.

    What can I do ?

    Thanks

    Jack

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Jul 1, 2010 (permalink)

    Hello guys,

    As to the question about references I am afraid that I do not have enough information to point the issue. Rohini, please open a new support ticket and send me more details what exactly are you experiencing in your scenario, where report does not generated.

    Jack, report generation class does not support including grid's summary rows. Probably, you would find useful other support methods: ExportToExcelML, ExportToCSV, ExportToHTML and ExportToPDF. All of them supports summary rows. Please note that the export to csv, html and pdf are only available in our Q2 2010 beta release and are scheduled for the official release as well.

    All the best,
    Martin Vasilev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  • Sharon Eden avatar

    Posted on Jul 13, 2010 (permalink)

    Hi all,

    I’m to use the RadGridReportingLite in order to create a report and print a GridView. In my grid the HeaderText property of each column is translated to Hebrew. When I print the grid with no grouping everything works fine. When I try to group by one of the fields, I get the error “The expression contains object XXX that is not defined in the current context”. When I group by one of the fields without translating the HeaderText, everything works fine. I'm using Q1-2010.

    I have to say that I’m not familiar with Telerik Reporting and I have only few hours of experience with it.

    Is it a bug? Am I missing something? Is there any kind of workaround?

    Thanks in advance,

    Sharon.

  • Sharon Eden avatar

    Posted on Jul 14, 2010 (permalink)

    After doing some debugging, there seems to be a problem whenever the HeaderText is different than the FieldName. The problem is in the GROUPS section of the AddReportData method when setting the groupTitleTextBox value. Changing both parameters to HeaderText seems to fix it.

    Can you tell me if there is something I’m missing?

    Thanks,

    Sharon.

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Jul 19, 2010 (permalink)

    Hi Sharon Eden,

    Thank you very much for reporting that issue. I have reproduced on my side and it will be addressed for the next version of this library. I am not sure if putting only the HeaderText for groupTitleTextBox formatting will resolve the exception in all cases. We will investigate this further. 

    I have updated your Telerik points for bringing our attention on that. Let me know if you have any additional questions.

    Greetings,
    Martin Vasilev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  • Dan avatar

    Posted on Jul 20, 2010 (permalink)

    Is this solution compatible with the new Q2 controls?

    Thanks

  • Posted on Jul 21, 2010 (permalink)

    Hi ,when compile RadGridReportingLite.Cs get some Error  :

                            GridCellElement headerCell =
    grid.MasterGridViewInfo.TableHeaderRow.Cells[i].CellElement;

    CellElement not Implement in Teletik 2010 Q2 ?

    and Error  from :
    grid.MasterGridViewTemplate.GroupByExpressions[i].SelectFields[j].HeaderText

    SelectFields too not implement?



  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Jul 22, 2010 (permalink)

    Hello guys,

    Please find the latest build of RadGridReportingLite library and the ready made assembly as attachments. It was modified to allow using it along with latest versions of Telerik Reporting and WinForms controls: Q2 2010. Also the issue with grouped columns, which has different header text and field name has been addressed.

    Note that the old versions of RadGridReportingLite library are not compatible with latest Q2 2010 release, because there are some general changes in grid's elements structure. Please use the one provided in this message.

    Finally, since RadGridView Q2 2010 natively supports Export to PDF, we will close this code library project for further comments, because it becomes obsolete. Please, consider upgrading to Q2 2010+ instead.

    In case you are using older versions of our tools and this library, and have further questions, please open a new support ticket from your account and we will help you out.


    Regards,
    Martin Vasilev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  • Posted on Jul 29, 2010 (permalink)

    Hello Martin
    I install the application and run it, no problem. When I try to save it as excel, so I got an error, but I can it save as pdf, csv and etc.
    The error message:
    Value cannot be null.
    Parameter name: input

    My version is : Latest Version: 2010.2 714 - Q2 2010
    Thanks!
    Attached files

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Aug 3, 2010 (permalink)

    Hello Allan Jensen,

    I am unable to reproduce the described issue. It could be related to something specific in your application. However, since RadGridReportingLite library is now obsolete, I highly recommend you to use some of the export methods, which we provided with the new version of RadGridView instead of generating a report. For more information please take a look to our product documentation. If you still need help with exporting through a Report, please create a new support ticket and send me a small sample project that demonstrates the error. This will allow me to investigate further and provide you with accurate assistance.

    Kind regards,
    Martin Vasilev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Sep 8, 2010 (permalink)

    Hello there,

    I am attaching a revised version of the RadGridReportingLite library, which addresses the reported export to excel issue. It is tested with Q1 2010 versions of RadControls for Winforms and Reporting. If anyone has any additional inquiries about it, please open a new support ticket and ask your questions there.

    Regards,
    Martin Vasilev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Back to Top

Skip Navigation LinksHome / Community & Support / Code Library / WinForms > GridView > Telerik.Reporting report generation using RadGridView for WinForms