Exportar un reporte a excel sin formato

0 Answers 141 Views
Dialog Error FloatingLabel Form
Daniel
Top achievements
Rank 1
Daniel asked on 24 Jan 2022, 06:49 PM
Como puedo exportar un informe que realicé en telerik a excel, estoy ocupando la extensión xls, sin embargo me lo entrega pero con el formato del informe, y yo pretendo pasarlo sin formato solo que respete las filas y las columnas.

private string creaReporteHomecito(ReporteHome listModel)
        {
            //CREAMOS EL REPORTE
            ReportHome home = new ReportHome();
            home.table1.DataSource = listModel.Ppi;
            home.table2.DataSource = listModel.IsrRS;
            home.table3.DataSource = listModel.IsrRA;
            home.table4.DataSource = listModel.IsrRSO;
            home.table5.DataSource = listModel.IsrRH;
            home.table6.DataSource = listModel.IsrRAR;
            home.table7.DataSource = listModel.PdI;
            home.table8.DataSource = listModel.IrE;
            home.table9.DataSource = listModel.IrR;
            home.table10.DataSource = listModel.IepsE;
            home.table11.DataSource = listModel.IepsR;


            //EXPORTAMOS EL EXCEL ReportProcessor reportProcessor
            = new ReportProcessor();
            Telerik.Reporting.InstanceReportSource instanciaReportSource = new Telerik.Reporting.InstanceReportSource();
            instanciaReportSource.ReportDocument = inicio;
            RenderingResult renderingResult = reportProcessor.RenderReport("CSV", instanceReportSource, null);
            


            //EXPORTAMOS EL EXCEL A MEMORYSTREAM
            MemoryStream ms = nuevo MemoryStream();
            ms.Write(renderingResult.DocumentBytes, 0, renderingResult.DocumentBytes.Length);
            ms.Flush();
            System.Web.Mvc.FileContentResult resultado = nuevo System.Web.Mvc.FileContentResult(ms.GetBuffer(), renderingResult.MimeType);
            result.FileDownloadName = "ReporteGeneral.CSV";

            byte[] excelBytes = ReadToEnd(ms);
            cadena excelBase = Convert.ToBase64String(excelBytes);

            volver excelBase;
        }
Petar
Telerik team
commented on 25 Jan 2022, 07:16 AM

Hello, Daniel.

The official communication language for our support and ticket system is English. May I ask you to submit your question in English and then we can handle it?

Last but not least, based on the shared code, I would assume that the ticket is not submitted in the correct Forum section. The current forum is about Kendo UI for Vue. The shared code contains implementation from Telerik Reporting.

You can use the above link and ask your question in English in the Reporting forum.

If you need assistance with the implementation of Kendo UI for Vue suite in your application, we will be happy to help you.

No answers yet. Maybe you can help?

Tags
Dialog Error FloatingLabel Form
Asked by
Daniel
Top achievements
Rank 1
Share this question
or