1
votes

hi all ! I am developing one asp.net application and the requirement is as below. user can view multiple reports(i have used crystal reports). Each report has edit report button.when the user click on edit button,then report will be open in excel sheet on different webpage.then user make suitable changes like sorting etc and save this report and take an updated print.

1
So far you have only stated your requirement. You haven't explained what you have tried in order to implement this requirement and what particular difficulties you encountered when you attempted to do so. I am afraid that there's isn't enough information in your question so that it can be answered. - Darin Dimitrov
at present the user can view crystal reports but i dont know how to convert this crystal report to excel sheet at server side..and how will user dynamically make changes in excel sheet and save it. - sunil pol

1 Answers

0
votes
  • Drag & drop many CristalReportsViewer in the page, one for each report you want to show
  • Drag & drop many CristalReportsSource in the page, one for each report you want to show
  • link each CristalReportsSource to a CristalReportsViewer
  • set for each CristalReportsSource the relative source myreport.rpt
  • put many buttons that export the reports, using this sample code

    protected void btnExport_Click(object sender, EventArgs e)    
    {
    // Stop buffering the response
    Response.Buffer = false;
    // Clear the response content and headers
    Response.ClearContent();
    Response.ClearHeaders();
    
    ExportFormatType format = ExportFormatType.Excel;
    try
    {
       reportDocument.ExportToHttpResponse(format, Response, true, "report.xls");
    
    }
    catch (System.Threading.ThreadAbortException)
    {
        //happens; no matter
    }
    catch (Exception ex)
    {
       Response.Write(ex.StackTrace);
    }
    }
    

You can show a single report, and allow users choosing the desired report unsing a dropdown with this sample code

    reportDocument = new ReportDocument();
    string reportName = "myreport.rpt";
    reportDocument.Load(Server.MapPath(string.Format("~/{0}/{1}", "MyReportsFolder", reportName)));
    CrystalReportViewer1.ReportSource = reportDocument;
    reportDocument.ReadRecords();