当前位置: 首页>>代码示例>>C#>>正文


C# Report.BuildPages方法代码示例

本文整理汇总了C#中fyiReporting.RDL.Report.BuildPages方法的典型用法代码示例。如果您正苦于以下问题:C# Report.BuildPages方法的具体用法?C# Report.BuildPages怎么用?C# Report.BuildPages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fyiReporting.RDL.Report的用法示例。


在下文中一共展示了Report.BuildPages方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetFileBytes

        public byte[] GetFileBytes(Report report)
        {
            var pages = report.BuildPages();
            int width = (int)report.PageWidthPoints;
            int height = (int)report.PageHeightPoints;
            string filename = string.Format("gen-{0}.pdf", Guid.NewGuid());
			
            try
            {
                using (Cairo.PdfSurface pdf = new Cairo.PdfSurface(filename, width, height))
                {
                    using (Cairo.Context g = new Cairo.Context(pdf))
                    {
						
                        var render = new  fyiReporting.RdlGtkViewer.RenderCairo(g);
                        render.RunPages(pages);
                    }
                }
                byte[] bytes = File.ReadAllBytes(filename);
                return bytes;
				
            }
            finally
            {
                if (File.Exists(filename))
                {
                    File.Delete(filename);
                }
            }
        }
开发者ID:myersBR,项目名称:My-FyiReporting,代码行数:30,代码来源:CairoPdfWriter.cs

示例2: SaveAsPdf

        private void SaveAsPdf(Report report, OneFileStreamGen sg)
        {
            Pages pgs = report.BuildPages();
            FileStream strm=null;
            System.Drawing.Image im=null;

            // Handle any parameters
            float x = 0;		// x position of image
            float y = 0;		// y position of image
            float h = 0;		// height of image
            float w = 0;		// width position of image
            string fname=null;
            int index = _StampInfo.LastIndexOf('?');
            bool bClip=false;	// we force clip if either height or width not specified

            if (index >= 0)
            {
                // Get all the arguments for sizing the image
                ListDictionary ld = this.GetParameters(_StampInfo.Substring(index+1));
                fname = _StampInfo.Substring(0, index);
                string ws = (string)ld["x"];
                x = Size(ws);
                ws = (string)ld["y"];
                y = Size(ws);
                ws = (string)ld["h"];
                if (ws == null)
                {
                    bClip = true;
                    ws = "12in";	// just give it a big value
                }
                h = Size(ws);
                ws = (string)ld["w"];
                if (ws == null)
                {
                    bClip = true;
                    ws = "12in";	// just give it a big value
                }
                w = Size(ws);
            }
            else
            {
                fname = _StampInfo;
                // force size
                bClip = true;
                h = Size("12in");
                w = Size("12in");
            }

            // Stamp the first page
            foreach (Page p in pgs)		// we loop then break after obtaining one
            {
                try
                {
                    strm = new FileStream(fname, System.IO.FileMode.Open, FileAccess.Read);
                    im = System.Drawing.Image.FromStream(strm);
                    int height = im.Height;
                    int width = im.Width;
                    MemoryStream ostrm = new MemoryStream();

                    /* Replaced with high quality JPEG encoder
                      * 06122007AJM */
             					ImageFormat imf = ImageFormat.Jpeg;
             					//im.Save(ostrm, imf);
                    System.Drawing.Imaging.ImageCodecInfo[] info;
                    info = ImageCodecInfo.GetImageEncoders();
                    EncoderParameters encoderParameters;
                    encoderParameters = new EncoderParameters(1);
                    encoderParameters.Param[0] = new EncoderParameter(Encoder.Quality, 100L);
                    System.Drawing.Imaging.ImageCodecInfo codec = null;
                    for (int i = 0; i < info.Length; i++)
                    {
                        if (info[i].FormatDescription == "JPEG")
                        {
                            codec = info[i];
                            break;
                        }
                    }
                    im.Save(ostrm, codec, encoderParameters);
                    // end change
                    byte[] ba = ostrm.ToArray();
                    ostrm.Close();
                    PageImage pi = new PageImage(imf, ba, width, height);
                    pi.SI = new StyleInfo();			// defaults are ok; don't want border, etc
                    // Set location, height and width
                    pi.X = x;
                    pi.Y = y;
                    pi.H = h;
                    pi.W = w;
                    pi.Sizing = bClip? ImageSizingEnum.Clip: ImageSizingEnum.FitProportional;

                    p.InsertObject(pi);
                }
                catch (Exception e)
                {
                    // image failed to load, continue processing
                    Console.WriteLine("Stamping image failed.  {0}", e.Message);
                }
                finally
                {
                    if (strm != null)
//.........这里部分代码省略.........
开发者ID:bittercoder,项目名称:odd-reports,代码行数:101,代码来源:RdlCmd.cs

示例3: GetPages

        private Pages GetPages(Report report)
        {
            Pages pgs = null;

            ListDictionary ld = GetParameters();		// split parms into dictionary

            try
            {
                report.RunGetData(ld);

                pgs = report.BuildPages();

                if (report.ErrorMaxSeverity > 0)
                {
                    if (_errorMsgs == null)
                    {
                        _errorMsgs = report.ErrorItems;		// keep a copy of the errors
                    }
                    else
                    {
                        foreach (string err in report.ErrorItems)
                        {
                            _errorMsgs.Add(err);
                        }
                    }

                    report.ErrorReset();
                }

            }
            catch (Exception e)
            {
                string msg = e.Message;
            }

            return pgs;
        }
开发者ID:huasonli,项目名称:My-FyiReporting,代码行数:37,代码来源:RdlViewer.cs

示例4: Generate

		private void Generate(Report report)
		{
			try
			{
                _Pages =  report.BuildPages();
                // create array for XAML pages.   Actual XAML will be created on demand.
                _XamlPages = new string[_Pages.Count];
                for (int i = 0; i < _XamlPages.Length; i++)
                    _XamlPages[i] = null;
			}
			catch(Exception e)
			{
                AddError(8, string.Format("Exception generating report {0}", e.Message));
			}

			if (report.ErrorMaxSeverity > 0) 
			{
				AddError(report.ErrorMaxSeverity, report.ErrorItems);
				report.ErrorReset();
			}

			return;
		}
开发者ID:Elboodo,项目名称:My-FyiReporting,代码行数:23,代码来源:RdlSilverViewer.cs

示例5: Rebuild

        public void Rebuild()
        {
            _report = this.GetReport(SourceRdl);
            _report.RunGetData(Parameters);
            pages = _report.BuildPages();

            List<ReportArea> tempList = new List<ReportArea>();
            foreach (ReportArea w in this.vboxPages.Children)
            {
                tempList.Add(w);
            }
            foreach (ReportArea w in tempList)
            {
                vboxPages.Remove(w);
            }

            for (int pageCount = 0; pageCount < pages.Count; pageCount++)
            {
                ReportArea area = new ReportArea(this.DefaultBackend);
                area.SetReport(_report, pages[pageCount]);

                vboxPages.PackStart(area, true, true);
            }

            this.Show();

            if (_report.ErrorMaxSeverity > 0)
            {
                // TODO: add error messages back
                //SetErrorMessages(report.ErrorItems);
            }
        }
开发者ID:majorsilence,项目名称:My-FyiReporting,代码行数:32,代码来源:ReportViewer.cs


注:本文中的fyiReporting.RDL.Report.BuildPages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。