Ejemplo n.º 1
0
        internal void Run(IPresent ip)
        {
            if (_Subreport == null)
            {                   // do true intialization
                ip.Start();
            }

            if (ip.IsPagingNeeded())
            {
                RunPage(ip);
            }
            else
            {
                if (_PageHeader != null && !(ip is RenderXml))
                {
                    _PageHeader.Run(ip, null);
                }
                _Body.Run(ip, null);
                if (_PageFooter != null && !(ip is RenderXml))
                {
                    _PageFooter.Run(ip, null);
                }
            }

            if (_Subreport == null)
            {
                ip.End();
            }

            if (_DataSourcesDefn != null)
            {
                _DataSourcesDefn.CleanUp(ip.Report());                  // datasets may not have been cleaned up
            }
        }
Ejemplo n.º 2
0
        override internal void Run(IPresent ip, Row row)
        {
            Report rpt = ip.Report();

            base.Run(ip, row);

            TextboxRuntime tbr = TextboxRuntime.GetTextboxRuntime(rpt, this);

            tbr.RunCount++;                     // Increment the run count
            string t    = RunText(rpt, row);
            bool   bDup = RunTextIsDuplicate(tbr, t, null);

            if (bDup)
            {
                if (!(this.IsTableOrMatrixCell(rpt)))                   // don't put out anything if not in Table or Matrix
                {
                    return;
                }
                t = "";                         // still need to put out the cell
            }
            ip.Textbox(this, t, row);

            if (!bDup)
            {
                tbr.PreviousText = t;                   // set for next time
            }
        }
Ejemplo n.º 3
0
        override internal void Run(IPresent ip, Row row)
        {
            base.Run(ip, row);

            string mtype = null;
            Stream strm  = null;

            try
            {
                strm = GetImageStream(ip.Report(), row, out mtype);

                ip.Image(this, row, mtype, strm);
            }
            catch
            {
                // image failed to load;  continue processing
            }
            finally
            {
                if (strm != null)
                {
                    strm.Close();
                }
            }
            return;
        }
Ejemplo n.º 4
0
        private void RunGroups(IPresent ip, WorkClass wc, List <GroupEntry> groupEntries)
        {
            foreach (GroupEntry ge in groupEntries)
            {
                // set the group entry value
                int index;
                if (ge.Group != null)                          // groups?
                {
                    ge.Group.ResetHideDuplicates(ip.Report()); // reset duplicate checking
                    index = ge.Group.GetIndex(ip.Report());    // yes
                }
                else                                           // no; must be main dataset
                {
                    index = 0;
                }
                wc.Data.CurrentGroups[index] = ge;
                if (ge.NestedGroup.Count > 0)
                {
                    RunGroupsSetGroups(ip.Report(), wc, ge.NestedGroup);
                }

                if (ge.Group == null)
                {                       // need to run all the rows since no group defined
                    for (int r = ge.StartRow; r <= ge.EndRow; r++)
                    {
                        ip.ListEntryBegin(this, wc.Data.Data[r]);
                        if (_ReportItems != null)
                        {
                            _ReportItems.Run(ip, wc.Data.Data[r]);
                        }
                        ip.ListEntryEnd(this, wc.Data.Data[r]);
                    }
                }
                else
                {                       // need to process just whole group as a List entry
                    ip.ListEntryBegin(this, wc.Data.Data[ge.StartRow]);

                    // pass the first row of the group
                    if (_ReportItems != null)
                    {
                        _ReportItems.Run(ip, wc.Data.Data[ge.StartRow]);
                    }

                    ip.ListEntryEnd(this, wc.Data.Data[ge.StartRow]);
                }
            }
        }
Ejemplo n.º 5
0
        override internal void Run(IPresent ip, Row row)
        {
            Report rpt = ip.Report();

            ICustomReportItem cri = null;

            try
            {
                cri = RdlEngineConfig.CreateCustomReportItem(_Type);
                Type   a  = cri.GetType();
                Bitmap bm = null;
                SetProperties(rpt, row, cri);
                int width = WidthCalc(rpt, null) -
                            (Style == null ? 0 :
                             (Style.EvalPaddingLeftPx(rpt, row) + Style.EvalPaddingRightPx(rpt, row)));
                int height = RSize.PixelsFromPoints(this.HeightOrOwnerHeight) -
                             (Style == null ? 0 :
                              (Style.EvalPaddingTopPx(rpt, row) + Style.EvalPaddingBottomPx(rpt, row)));
                bm = new Bitmap(width, height);
                cri.DrawImage(ref bm);

                MemoryStream ostrm = new MemoryStream();
                // 06122007AJM Changed to use high quality JPEG encoding
                //bm.Save(ostrm, IMAGEFORMAT);	// generate a jpeg   TODO: get png to work with pdf
                System.Drawing.Imaging.ImageCodecInfo[] info;
                info = ImageCodecInfo.GetImageEncoders();
                EncoderParameters encoderParameters;
                encoderParameters = new EncoderParameters(1);
                // 20022008 AJM GJL - Using centralised image quality
                encoderParameters.Param[0] = new EncoderParameter(Encoder.Quality, ImageQualityManager.CustomImageQuality);
                System.Drawing.Imaging.ImageCodecInfo codec = null;
                for (int i = 0; i < info.Length; i++)
                {
                    if (info[i].FormatDescription == "JPEG")
                    {
                        codec = info[i];
                        break;
                    }
                }
                bm.Save(ostrm, codec, encoderParameters);

                ip.Image(new Image(rpt.ReportDefinition, this, xNode), row, null, ostrm);
                ostrm.Close();
            }
            catch (Exception ex)
            {
                rpt.rl.LogError(8, string.Format("Exception in CustomReportItem handling.\n{0}\n{1}", ex.Message, ex.StackTrace));
            }
            finally
            {
                if (cri != null)
                {
                    cri.Dispose();
                }
            }
            return;
        }
Ejemplo n.º 6
0
        override internal void Run(IPresent ip, Row row)
        {
            Report         r  = ip.Report();
            TableWorkClass wc = GetValue(r);

            wc.Data = GetFilteredData(r, row);

            if (!AnyRows(ip, wc.Data))                          // if no rows return
            {
                return;                                         //   nothing left to do
            }
            RunPrep(r, row, wc);

            if (!ip.TableStart(this, row))
            {
                return;                                                         // render doesn't want to continue
            }
            if (_TableColumns != null)
            {
                _TableColumns.Run(ip, row);
            }

            // Header
            if (_Header != null)
            {
                ip.TableHeaderStart(_Header, row);
                Row frow = wc.Data.Data.Count > 0?  wc.Data.Data[0]: null;
                _Header.Run(ip, frow);
                ip.TableHeaderEnd(_Header, row);
            }

            // Body
            ip.TableBodyStart(this, row);
            if (wc.RecursiveGroup != null)
            {
                RunRecursiveGroups(ip, wc);
            }
            else
            {
                RunGroups(ip, wc.Groups, wc);
            }
            ip.TableBodyEnd(this, row);

            // Footer
            if (_Footer != null)
            {
                ip.TableFooterStart(_Footer, row);
                Row lrow = wc.Data.Data.Count > 0?  wc.Data.Data[wc.Data.Data.Count - 1]: null;
                _Footer.Run(ip, lrow);
                ip.TableFooterEnd(_Footer, row);
            }

            ip.TableEnd(this, row);
            RemoveValue(r);
        }
Ejemplo n.º 7
0
        internal void Run(IPresent ip, Row row)
        {
            if (this.Visibility != null && Visibility.IsHidden(ip.Report(), row))
            {
                return;
            }

            ip.TableRowStart(this, row);
            _TableCells.Run(ip, row);
            ip.TableRowEnd(this, row);
            return;
        }
Ejemplo n.º 8
0
        override internal void Run(IPresent ip, Row row)
        {
            Report r = ip.Report();

            base.Run(ip, row);

            // need to save the owner report and nest in this defintion
            ReportDefn   saveReport = r.ReportDefinition;
            NeedPassword np         = r.GetDataSourceReferencePassword; // get current password

            r.SetReportDefinition(_ReportDefn);
            r.Folder = _ReportDefn.ParseFolder;                         // folder needs to get set since the id of the report is used by the cache
            r.GetDataSourceReferencePassword = np;

            DataSourcesDefn saveDS = r.ParentConnections;

            if (this.MergeTransactions)
            {
                r.ParentConnections = saveReport.DataSourcesDefn;
            }
            else
            {
                r.ParentConnections = null;
            }

            r.SubreportDataRetrievalTriggerEvent();

            if (_Parameters == null)
            {                   // When no parameters we only retrieve data once
                if (r.Cache.Get(this, "report") == null)
                {
                    r.RunGetData(null);
                    if (!r.IsSubreportDataRetrievalDefined)     // if use has defined subreportdataretrieval they might
                    {
                        r.Cache.Add(this, "report", this);      //    set the data; so we don't cache
                    }
                }
            }
            else
            {
                SetSubreportParameters(r, row);
                r.RunGetData(null);
            }

            ip.Subreport(this, row);

            r.SetReportDefinition(saveReport);                                  // restore the current report
            r.ParentConnections = saveDS;                                       // restore the data connnections
        }
Ejemplo n.º 9
0
        override internal void Run(IPresent ip, Row row)
        {
            Report rpt = ip.Report();

            _ChartMatrix.RunReset(rpt);
            Rows _Data = GetFilteredData(ip.Report(), row);

            SetMyData(ip.Report(), _Data);

            if (!AnyRows(ip, _Data))                            // if no rows, return
            {
                return;
            }

            // Build the Chart bitmap, along with data regions
            ChartBase cb = null;

            try
            {
                cb = RunChartBuild(rpt, row);

                ip.Chart(this, row, cb);
            }
            catch (Exception ex)
            {
                rpt.rl.LogError(8, string.Format("Exception in Chart handling.\n{0}\n{1}", ex.Message, ex.StackTrace));
            }
            finally
            {
                if (cb != null)
                {
                    cb.Dispose();
                }
            }
            return;
        }
Ejemplo n.º 10
0
        internal void Run(IPresent ip, Row row)
        {
            if (OwnerReport.Subreport != null)
            {
                return;                         // don't process page footers for sub-reports
            }
            Report rpt = ip.Report();

            rpt.TotalPages = rpt.PageNumber = 1;
            ip.PageFooterStart(this);
            if (_ReportItems != null)
            {
                _ReportItems.Run(ip, row);
            }
            ip.PageFooterEnd(this);
        }
Ejemplo n.º 11
0
        internal void Run(IPresent ip, Row row)
        {
            // todo: visibility on the column should really only be evaluated once at the beginning
            //   of the table processing;  also this doesn't account for the affect of colspan correctly
            //   where if any of the spanned columns are visible the value would show??
            TableColumn tc = _OwnerTable.TableColumns[_ColIndex];
            if (tc.Visibility != null && tc.Visibility.IsHidden(ip.Report(), row))	// column visible?
                return;													//  no nothing to do

            ip.TableCellStart(this, row);

            _ReportItems.Items[0].Run(ip, row);

            ip.TableCellEnd(this, row);
            return;
        }
Ejemplo n.º 12
0
 internal void Run(IPresent ip, Rows rs, int start, int end)
 {
     // if no rows output or rows just leave
     if (rs == null || rs.Data == null)
     {
         return;
     }
     if (this.Visibility != null && Visibility.IsHidden(ip.Report(), rs.Data[start]) && Visibility.ToggleItem == null)
     {
         return;                 // not visible
     }
     for (int r = start; r <= end; r++)
     {
         _TableRows.Run(ip, rs.Data[r]);
     }
     return;
 }
Ejemplo n.º 13
0
        internal bool AnyRows(IPresent ip, Rows data)
        {
            if (data == null || data.Data == null ||
                data.Data.Count <= 0)
            {
                string msg;
                if (this.NoRows != null)
                {
                    msg = this.NoRows.EvaluateString(ip.Report(), null);
                }
                else
                {
                    msg = null;
                }
                ip.DataRegionNoRows(this, msg);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 14
0
        override internal void Run(IPresent ip, Row row)
        {
            Report r = ip.Report();

            base.Run(ip, row);

            // need to save the owner report and nest in this defintion
            ReportDefn saveReport = r.ReportDefinition;

            r.SetReportDefinition(_ReportDefn);
            r.Folder = _ReportDefn.ParseFolder;                         // folder needs to get set since the id of the report is used by the cache
            DataSourcesDefn saveDS = r.ParentConnections;

            if (this.MergeTransactions)
            {
                r.ParentConnections = saveReport.DataSourcesDefn;
            }
            else
            {
                r.ParentConnections = null;
            }

            if (_Parameters == null)
            {                   // When no parameters we only retrieve data once
                if (r.Cache.Get(this, "report") == null)
                {
                    r.RunGetData(null);
                    r.Cache.Add(this, "report", this);
                }
            }
            else
            {
                SetSubreportParameters(r, row);
                r.RunGetData(null);
            }

            ip.Subreport(this, row);

            r.SetReportDefinition(saveReport);                                  // restore the current report
            r.ParentConnections = saveDS;                                       // restore the data connnections
        }
Ejemplo n.º 15
0
        internal void RunPage(IPresent ip)
        {
            Pages pgs = new Pages(ip.Report());

            try
            {
                Page p = new Page(1);                                           // kick it off with a new page
                pgs.AddPage(p);

                // Create all the pages
                _Body.RunPage(pgs);

                if (pgs.LastPage.IsEmpty())                                     // get rid of extraneous pages which
                {
                    pgs.RemoveLastPage();                                       //   can be caused by region page break at end
                }
                // Now create the headers and footers for all the pages (as needed)
                if (_PageHeader != null)
                {
                    _PageHeader.RunPage(pgs);
                }
                if (_PageFooter != null)
                {
                    _PageFooter.RunPage(pgs);
                }

                pgs.SortPageItems();             // Handle ZIndex ordering of pages

                ip.RunPages(pgs);
            }
            finally
            {
                pgs.CleanUp();                          // always want to make sure we clean this up since
                if (_DataSourcesDefn != null)
                {
                    _DataSourcesDefn.CleanUp(pgs.Report);                       // ensure datasets are cleaned up
                }
            }

            return;
        }
Ejemplo n.º 16
0
        override internal void Run(IPresent ip, Row row)
        {
            Report rpt = ip.Report();

            ICustomReportItem cri = null;

            try
            {
                cri = RdlEngineConfig.CreateCustomReportItem(_Type);
            }
            catch (Exception ex)
            {
                rpt.rl.LogError(8, string.Format("Exception in CustomReportItem handling.\n{0}\n{1}", ex.Message, ex.StackTrace));
            }
            finally
            {
                if (cri != null)
                {
                    cri.Dispose();
                }
            }
            return;
        }
Ejemplo n.º 17
0
        override internal void Run(IPresent ip, Row row)
        {
            Report    r  = ip.Report();
            WorkClass wc = GetValue(r);

            wc.Data = GetFilteredData(r, row);

            if (!AnyRows(ip, wc.Data))                          // if no rows return
            {
                return;                                         //   nothing left to do
            }
            RunSetGrouping(r, wc);

            base.Run(ip, row);

            if (!ip.ListStart(this, row))
            {
                return;                                                                 // renderer doesn't want to continue
            }
            RunGroups(ip, wc, wc.Groups);

            ip.ListEnd(this, row);
            RemoveValue(r);
        }
Ejemplo n.º 18
0
		override internal void Run(IPresent ip, Row row)
		{
			Report rpt = ip.Report();
			WorkClass wc = GetValue(rpt);
			wc.FullData = wc.Data = GetFilteredData(rpt, row);

			if (!AnyRows(ip, wc.Data))		// if no rows return
				return;					//   nothing left to do

			int maxColumns;
			int maxRows;
			MatrixCellEntry[,] matrix = RunBuild(rpt, out maxRows, out maxColumns);

			// Now run thru the rows and columns of the matrix passing the information
			//   on to the rendering engine
            int headerRows = _ColumnGroupings.Items.Count;	// number of column headers we have
            if (!ip.MatrixStart(this, matrix, row, headerRows, maxRows, maxColumns))
				return;
			for (int iRow = 0; iRow < maxRows; iRow++)
			{
				ip.MatrixRowStart(this, iRow, row);
				for (int iColumn = 0; iColumn < maxColumns; iColumn++)
				{
					MatrixCellEntry mce = matrix[iRow, iColumn];
					if (mce == null)
					{
						ip.MatrixCellStart(this, null, iRow, iColumn, row, float.MinValue, float.MinValue, 1);
						ip.MatrixCellEnd(this, null, iRow, iColumn, row);
					}
					else
					{
						wc.Data = mce.Data;		// Must set this for evaluation

						Row lrow = wc.Data.Data.Count > 0? wc.Data.Data[0]:null;
						mce.DisplayItem.SetMC(rpt, mce);	// set for use by the display item
						SetGroupingValues(rpt, mce);
												   
						ip.MatrixCellStart(this, mce.DisplayItem, iRow, iColumn, lrow, mce.Height, mce.Width, mce.ColSpan);

						mce.DisplayItem.Run(ip, lrow);
						ip.MatrixCellEnd(this, mce.DisplayItem, iRow, iColumn, lrow);
					}
				}
				ip.MatrixRowEnd(this, iRow, row);
			}
			ip.MatrixEnd(this, row);
			RemoveValue(rpt);
		}
Ejemplo n.º 19
0
        internal void Run(IPresent ip, Row row)
        {
            if (this.Visibility != null && Visibility.IsHidden(ip.Report(), row))
                return;

            ip.TableRowStart(this, row);
            _TableCells.Run(ip, row);
            ip.TableRowEnd(this, row);
            return ;
        }
Ejemplo n.º 20
0
Archivo: List.cs Proyecto: mnisl/OD
		private void RunGroups(IPresent ip, WorkClass wc, List<GroupEntry> groupEntries)
		{
			foreach (GroupEntry ge in groupEntries)
			{
				// set the group entry value
				int index;
				if (ge.Group != null)	// groups?
				{
					ge.Group.ResetHideDuplicates(ip.Report());	// reset duplicate checking
					index = ge.Group.GetIndex(ip.Report());	// yes
				}
				else					// no; must be main dataset
					index = 0;
				wc.Data.CurrentGroups[index] = ge;
				if (ge.NestedGroup.Count > 0)
					RunGroupsSetGroups(ip.Report(), wc, ge.NestedGroup);

				if (ge.Group == null)
				{	// need to run all the rows since no group defined
					for (int r=ge.StartRow; r <= ge.EndRow; r++)
					{
						ip.ListEntryBegin(this,  wc.Data.Data[r]);
						_ReportItems.Run(ip, wc.Data.Data[r]);
						ip.ListEntryEnd(this, wc.Data.Data[r]);
					}
				}
				else
				{	// need to process just whole group as a List entry
					ip.ListEntryBegin(this,  wc.Data.Data[ge.StartRow]);

					// pass the first row of the group
					_ReportItems.Run(ip, wc.Data.Data[ge.StartRow]);

					ip.ListEntryEnd(this, wc.Data.Data[ge.StartRow]);
				}
			}
		}
Ejemplo n.º 21
0
Archivo: List.cs Proyecto: mnisl/OD
		override internal void Run(IPresent ip, Row row)
		{
			Report r = ip.Report();
			WorkClass wc = GetValue(r);

			wc.Data = GetFilteredData(r, row);

			if (!AnyRows(ip, wc.Data))		// if no rows return
				return;					//   nothing left to do

			RunSetGrouping(r, wc);

			base.Run(ip, row);

			if (!ip.ListStart(this, row))	
				return;							// renderer doesn't want to continue
						   
			RunGroups(ip, wc, wc.Groups);

			ip.ListEnd(this, row);
			RemoveValue(r);
		}
Ejemplo n.º 22
0
		override public void Run(IPresent ip, Row row)
		{
			Report rpt = ip.Report();

			_ChartMatrix.RunReset(rpt);
			Rows _Data = GetFilteredData(ip.Report(), row);
			SetMyData(ip.Report(), _Data);

			if (!AnyRows(ip, _Data))		// if no rows, return
				return;

			// Build the Chart bitmap, along with data regions
			ChartBase cb=null;
			try
			{
				cb = RunChartBuild(rpt, row);

				ip.Chart(this, row, cb);
			}
			catch (Exception ex)
			{
				rpt.rl.LogError(8, string.Format("Exception in Chart handling.\n{0}\n{1}", ex.Message, ex.StackTrace));
			}
			finally
			{
				if (cb != null)
					cb.Dispose();
			}
			return;
		}
Ejemplo n.º 23
0
		override internal void Run(IPresent ip, Row row)
		{
			base.Run(ip, row);

			string mtype=null; 
			Stream strm=null;
			try 
			{
				strm = GetImageStream(ip.Report(), row, out mtype);

				ip.Image(this, row, mtype, strm);
			}
			catch
			{
				// image failed to load;  continue processing
			}
			finally
			{
				if (strm != null)
					strm.Close();
			}
			return;
		}
Ejemplo n.º 24
0
		internal void Run(IPresent ip, Row row)
		{
			// todo: visibility on the column should really only be evaluated once at the beginning
			//   of the table processing;  also this doesn't account for the affect of colspan correctly
			//   where if any of the spanned columns are visible the value would show??
			TableColumn tc = _OwnerTable.TableColumns[_ColIndex];
			if (tc.Visibility != null && tc.Visibility.IsHidden(ip.Report(), row))	// column visible?
				return;													//  no nothing to do

			ip.TableCellStart(this, row);
			
			_ReportItems.Items[0].Run(ip, row);

			ip.TableCellEnd(this, row);
			return;
		}
Ejemplo n.º 25
0
		internal bool AnyRows(IPresent ip, Rows data)
		{
			if (data == null || data.Data == null ||
				data.Data.Count <= 0)
			{
				string msg;
				if (this.NoRows != null)
					msg = this.NoRows.EvaluateString(ip.Report(), null);
				else
					msg = null;
				ip.DataRegionNoRows(this, msg);
				return false;
			}

			return true;
		}
Ejemplo n.º 26
0
		override internal void Run(IPresent ip, Row row)
		{
			Report rpt = ip.Report();
			base.Run(ip, row);

			TextboxRuntime tbr = TextboxRuntime.GetTextboxRuntime(rpt, this);

			tbr.RunCount++;		// Increment the run count
			string t = RunText(rpt, row);
			bool bDup =	RunTextIsDuplicate(tbr, t, null);
			if (bDup)
			{
				if (!(this.IsTableOrMatrixCell(rpt)))	// don't put out anything if not in Table or Matrix
					return;
				t = "";		// still need to put out the cell
			}
			ip.Textbox(this, t, row);

			if (!bDup)
				tbr.PreviousText=t;	// set for next time
		}
Ejemplo n.º 27
0
        internal void Run(IPresent ip, Rows rs, int start, int end)
        {
            // if no rows output or rows just leave
            if (rs == null || rs.Data == null)
                return;
            if (this.Visibility != null && Visibility.IsHidden(ip.Report(), rs.Data[start]) && Visibility.ToggleItem == null)
                return;                 // not visible

            for (int r=start; r <= end; r++)
            {
                _TableRows.Run(ip, rs.Data[r]);
            }
            return;
        }
Ejemplo n.º 28
0
		internal void Run(IPresent ip, Row row)
		{
			if (OwnerReport.Subreport != null)
				return;		// don't process page footers for sub-reports
			Report rpt = ip.Report();
			rpt.TotalPages = rpt.PageNumber = 1;
			ip.PageFooterStart(this);
			if (_ReportItems != null)
				_ReportItems.Run(ip, row);
			ip.PageFooterEnd(this);
		}
Ejemplo n.º 29
0
		override public void Run(IPresent ip, Row row)
		{
			Report r = ip.Report();
			base.Run(ip, row);

			// need to save the owner report and nest in this defintion
			ReportDefn saveReport = r.ReportDefinition;
            NeedPassword np = r.GetDataSourceReferencePassword;   // get current password
            r.SetReportDefinition(_ReportDefn);
			r.Folder = _ReportDefn.ParseFolder;		// folder needs to get set since the id of the report is used by the cache
            r.GetDataSourceReferencePassword = np;
		
            DataSourcesDefn saveDS = r.ParentConnections;
			if (this.MergeTransactions)
				r.ParentConnections = saveReport.DataSourcesDefn;
			else
				r.ParentConnections = null;

            r.SubreportDataRetrievalTriggerEvent();

			if (_Parameters == null)
			{	// When no parameters we only retrieve data once
				if (r.Cache.Get(this, "report") == null)
				{
					r.RunGetData(null);
                    if (!r.IsSubreportDataRetrievalDefined)       // if use has defined subreportdataretrieval they might
                        r.Cache.Add(this, "report", this);      //    set the data; so we don't cache
				}
			}
			else
			{
				SetSubreportParameters(r, row);
				r.RunGetData(null);
			}

			ip.Subreport(this, row);

			r.SetReportDefinition(saveReport);			// restore the current report
			r.ParentConnections = saveDS;				// restore the data connnections
		}
Ejemplo n.º 30
0
		internal void Run(IPresent ip)
		{
			if (_Subreport == null)
			{	// do true intialization
				ip.Start();
			}

			if (ip.IsPagingNeeded())
			{
				RunPage(ip);
			}
			else
			{
				if (_PageHeader != null && !(ip is RenderXml))
					_PageHeader.Run(ip, null);
				_Body.Run(ip, null);
				if (_PageFooter != null && !(ip is RenderXml))
					_PageFooter.Run(ip, null);
			}

			if (_Subreport == null)
				ip.End();

			if (_DataSourcesDefn != null)
				_DataSourcesDefn.CleanUp(ip.Report());	// datasets may not have been cleaned up
		}
Ejemplo n.º 31
0
        private void RunGroups(IPresent ip, List <GroupEntry> groupEntries, TableWorkClass wc)
        {
            Report     rpt = ip.Report();
            GroupEntry fge = (GroupEntry)(groupEntries[0]);

            if (fge.Group != null)
            {
                ip.GroupingStart(fge.Group);
            }

            foreach (GroupEntry ge in groupEntries)
            {
                // set the group entry value
                int index;
                if (ge.Group != null)                   // groups?
                {
                    ip.GroupingInstanceStart(ge.Group);
                    ge.Group.ResetHideDuplicates(rpt);                  // reset duplicate checking
                    index = ge.Group.GetIndex(rpt);                     // yes
                }
                else                                                    // no; must be main dataset
                {
                    index = 0;
                }
                wc.Data.CurrentGroups[index] = ge;

                if (ge.NestedGroup.Count > 0)
                {
                    RunGroupsSetGroups(rpt, wc, ge.NestedGroup);
                }

                // Handle the group header
                if (ge.Group != null && ge.Group.Parent != null)
                {
                    TableGroup tg = ge.Group.Parent as TableGroup;
                    if (tg != null && tg.Header != null)
                    {
                        // Calculate the number of table rows below this group; header, footer, details count
                        if (ge.NestedGroup.Count > 0)
                        {
                            wc.GroupNestCount = RunGroupsCount(ge.NestedGroup, 0);
                        }
                        else
                        {
                            wc.GroupNestCount = (ge.EndRow - ge.StartRow + 1) * DetailsCount;
                        }
                        tg.Header.Run(ip, wc.Data.Data[ge.StartRow]);
                        wc.GroupNestCount = 0;
                    }
                }
                // Handle the nested groups if any
                if (ge.NestedGroup.Count > 0)
                {
                    RunGroups(ip, ge.NestedGroup, wc);
                }
                // If no nested groups then handle the detail rows for the group
                else if (_Details != null)
                {
                    if (ge.Group != null &&
                        ge.Group.Parent as TableGroup == null)
                    {                           // Group defined on table; means that Detail rows only put out once per group
                        _Details.Run(ip, wc.Data, ge.StartRow, ge.StartRow);
                    }
                    else
                    {
                        _Details.Run(ip, wc.Data, ge.StartRow, ge.EndRow);
                    }
                }

                // Do the group footer
                if (ge.Group != null)
                {
                    if (ge.Group.Parent != null)
                    {
                        TableGroup tg = ge.Group.Parent as TableGroup;                          // detail groups will result in null
                        if (tg != null && tg.Footer != null)
                        {
                            tg.Footer.Run(ip, wc.Data.Data[ge.EndRow]);
                        }
                    }
                    ip.GroupingInstanceEnd(ge.Group);
                }
            }
            if (fge.Group != null)
            {
                ip.GroupingEnd(fge.Group);
            }
        }
Ejemplo n.º 32
0
		internal void RunPage(IPresent ip)
		{
			Pages pgs = new Pages(ip.Report());
			try
			{
				Page p = new Page(1);				// kick it off with a new page
				pgs.AddPage(p);

				// Create all the pages
				_Body.RunPage(pgs);

				if (pgs.LastPage.IsEmpty())			// get rid of extraneous pages which
					pgs.RemoveLastPage();			//   can be caused by region page break at end

				// Now create the headers and footers for all the pages (as needed)
				if (_PageHeader != null)
					_PageHeader.RunPage(pgs);
				if (_PageFooter != null)
					_PageFooter.RunPage(pgs);

                pgs.SortPageItems();             // Handle ZIndex ordering of pages

				ip.RunPages(pgs);
			}
			finally
			{
				pgs.CleanUp();		// always want to make sure we clean this up since 
				if (_DataSourcesDefn != null)
					_DataSourcesDefn.CleanUp(pgs.Report);	// ensure datasets are cleaned up
			}

			return;
		}
Ejemplo n.º 33
0
        override internal void Run(IPresent ip, Row row)
        {
            Report rpt = ip.Report();

            ICustomReportItem cri = null;
            try
            {
                cri = RdlEngineConfig.CreateCustomReportItem(_Type);

            }
            catch (Exception ex)
            {
                rpt.rl.LogError(8, string.Format("Exception in CustomReportItem handling.\n{0}\n{1}", ex.Message, ex.StackTrace));
            }
            finally
            {
                if (cri != null)
                    cri.Dispose();
            }
            return;
        }
Ejemplo n.º 34
0
		override internal void Run(IPresent ip, Row row)
		{
			Report r = ip.Report();
			base.Run(ip, row);

			// need to save the owner report and nest in this defintion
			ReportDefn saveReport = r.ReportDefinition;
			r.SetReportDefinition(_ReportDefn);
			r.Folder = _ReportDefn.ParseFolder;		// folder needs to get set since the id of the report is used by the cache
			DataSourcesDefn saveDS = r.ParentConnections;
			if (this.MergeTransactions)
				r.ParentConnections = saveReport.DataSourcesDefn;
			else
				r.ParentConnections = null;

			if (_Parameters == null)
			{	// When no parameters we only retrieve data once
				if (r.Cache.Get(this, "report") == null)
				{
					r.RunGetData(null);
					r.Cache.Add(this, "report", this);
				}
			}
			else
			{
				SetSubreportParameters(r, row);
				r.RunGetData(null);
			}

			ip.Subreport(this, row);

			r.SetReportDefinition(saveReport);			// restore the current report
			r.ParentConnections = saveDS;				// restore the data connnections
		}