Hello, I am new to Telerik. I want to have a button in my ASP.NET MVC web application that when clicked:
I don't know how to get started with this, what tutorial might help explain this? What sort of methods might be available? Here is my pseudo-code of what I would like to do:
string filePath = Server.MapPath("~/reportFolder/reportFile.trdx");// I made this stuff up:Telerik.StandaloneReport myReport = new Telerik.StandaloneReport(filePath);myReport.executeAndPromptTheUserToSaveAs();I have the .trdx file linked to my database, and so it is already correctly processing the report I want. Keep in mind that I don't want to embed the report in the web application in any way, I just want to "Save as..." the output of the .trdx report file when clicking a button in the application.
PDF page6. Report for Employee3
PDF page7. Report for Employee3
PDF page8. Empty page
PDF page9. Report for Employee4
PDF page10. Report for Employee4
PDF page11. Report for Employee4
PDF page12. Report for Employee4
PDF page13-17. Report for Employee5
Please advise me if any approach to handle this issue.
Thank you
Sean
<UserControl.Resources> <ControlTemplate x:Key="ReportViewerControlTemplate1" TargetType="rv:ReportViewer"/></UserControl.Resources><Grid x:Name="LayoutRoot" Background="White"> <rv:ReportViewer Template="{StaticResource ReportViewerControlTemplate1}" /></Grid><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" style="margin: 0px;"> <form id="form1" runat="server"> <div style="height: 100%;"> <telerik:ReportViewer ID="ReportViewer1" runat="server" width="100%" height="100%"> </telerik:ReportViewer> </div> </form></body>01.protected void Page_Load(object sender, EventArgs e)02.{03. if (!IsPostBack)04. {05. LoadData();06. }07.}08. 09.private void LoadData()10.{11. Page.Title = "Report Title";12. 13. ReportBook reportBook = new ReportBook();14. 15. CustomReport1 report = new CustomReport1();16. CustomReport2 report2 = new CustomReport2();17. CustomReportData data = new CustomReportData(_Id);18. report.DataSource = data;19. report2.DataSource = data;20. 21. reportBook.Reports.Add(report);22. reportBook.Reports.Add(report2);23. 24. this.ReportViewer1.Report = reportBook;25.}01.public partial class CustomReport : Telerik.Reporting.Report02.{03. public CustomReport()04. {05. /// <summary>06. /// Required for telerik Reporting designer support07. /// </summary>08. InitializeComponent();09. 10. //create event that will set the data source for the table11. tbl.NeedDataSource += new EventHandler(tbl_NeedDataSource);12. }13. 14. /// <summary>15. /// Handles the NeedDataSource event of the tbl control.16. /// </summary>17. /// <param name="sender">The source of the event.</param>18. /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>19. void tbl_NeedDataSource(object sender, EventArgs e)20. {21. //In order to programmatically set the table, we need to use the processing table22. Telerik.Reporting.Processing.Table table = ((Telerik.Reporting.Processing.Table)sender);23. 24. //set the data source of the table25. table.DataSource = ((CustomReportData)table.Report.DataSource).CustomCollection;26. }27.}