fyiReporting.RDL.Report.RunRender C# (CSharp) Method

RunRender() public method

Renders the report using the requested presentation type.
public RunRender ( IStreamGen sg, OutputPresentationType type, string prefix ) : void
sg IStreamGen IStreamGen for generating result stream
type OutputPresentationType Presentation type: HTML, XML, PDF, MHT, or ASP compatible HTML
prefix string For HTML puts prefix allowing unique name generation
return void
        public void RunRender(IStreamGen sg, OutputPresentationType type, string prefix)
        {
            if (sg == null)
                throw new ArgumentException("IStreamGen argument cannot be null.", "sg");
            RenderHtml rh=null;

            PageNumber = 1;		// reset page numbers
            TotalPages = 1;
            IPresent ip;
            MemoryStreamGen msg = null;
            switch (type)
            {
                case OutputPresentationType.PDF:
                case OutputPresentationType.RenderPdf_iTextSharp:
                    ip =new RenderPdf_iTextSharp(this, sg);
                    _Report.Run(ip);
                    break;
                case OutputPresentationType.PDFOldStyle:
                    ip = new RenderPdf(this, sg);
                    this.ItextPDF = false;
                    _Report.Run(ip);
                    break;
                case OutputPresentationType.TIF:
                    ip = new RenderTif(this, sg);
                    _Report.Run(ip);
                    break;
                case OutputPresentationType.TIFBW:
                    RenderTif rtif = new RenderTif(this, sg);
                    rtif.RenderColor = false;
                    ip = rtif;
                    _Report.Run(ip);
                    break;
                case OutputPresentationType.XML:
                    if (_Report.DataTransform != null && _Report.DataTransform.Length > 0)
                    {
                        msg = new MemoryStreamGen();
                        ip = new RenderXml(this, msg);
                        _Report.Run(ip);
                        RunRenderXmlTransform(sg, msg);
                    }
                    else
                    {
                        ip = new RenderXml(this, sg);
                        _Report.Run(ip);
                    }
                    break;
                case OutputPresentationType.MHTML:
                    this.RunRenderMht(sg);
                    break;
                case OutputPresentationType.CSV:
                    ip = new RenderCsv(this, sg);
                    _Report.Run(ip);
                    break;
                case OutputPresentationType.RTF:
                    ip = new RenderRtf(this, sg);
                    _Report.Run(ip);
                    break;
                case OutputPresentationType.Excel:
                    ip = new RenderExcel(this, sg);
                    _Report.Run(ip);
                    break;
                case OutputPresentationType.ASPHTML:
                case OutputPresentationType.HTML:
                default:
                    ip = rh = new RenderHtml(this, sg);
                    rh.Asp = (type == OutputPresentationType.ASPHTML);
                    rh.Prefix = prefix;
                    _Report.Run(ip);
                    // Retain the CSS and JavaScript
                    if (rh != null)
                    {
                        _CSS = rh.CSS;
                        _JavaScript = rh.JavaScript;
                    }
                    break;
            }

            sg.CloseMainStream();
            _Cache = new RCache();
            return;
        }

Same methods

Report::RunRender ( IStreamGen sg, OutputPresentationType type ) : void

Usage Example

        // Run the report passing the parameter values and the output
        public void Run(IDictionary parms, OutputPresentationType type)
        {
            r.RunGetData(parms);

            r.RunRender(_sg, type);

            return;
        }
All Usage Examples Of fyiReporting.RDL.Report::RunRender