Esempio n. 1
0
        // Generate a CSS string from the specified styles
        public string GetCSS(Report rpt, Row row, bool bDefaults)
        {
            StringBuilder sb = new StringBuilder();

            if (_Default != null)
            {
                sb.AppendFormat(NumberFormatInfo.InvariantInfo, "border-color:{0};", _Default.EvaluateString(rpt, row));
            }
            else if (bDefaults)
            {
                sb.Append("border-color:black;");
            }

            if (_Left != null)
            {
                sb.AppendFormat(NumberFormatInfo.InvariantInfo, "border-left:{0};", _Left.EvaluateString(rpt, row));
            }

            if (_Right != null)
            {
                sb.AppendFormat(NumberFormatInfo.InvariantInfo, "border-right:{0};", _Right.EvaluateString(rpt, row));
            }

            if (_Top != null)
            {
                sb.AppendFormat(NumberFormatInfo.InvariantInfo, "border-top:{0};", _Top.EvaluateString(rpt, row));
            }

            if (_Bottom != null)
            {
                sb.AppendFormat(NumberFormatInfo.InvariantInfo, "border-bottom:{0};", _Bottom.EvaluateString(rpt, row));
            }

            return(sb.ToString());
        }
        // Generate a CSS string from the specified styles
        public string GetCSS(Report rpt, Row row, bool bDefaults)
        {
            StringBuilder sb = new StringBuilder();

            if (_Default != null)
            {
                sb.AppendFormat("border-style:{0};", _Default.EvaluateString(rpt, row));
            }
            else if (bDefaults)
            {
                sb.Append("border-style:none;");
            }

            if (_Left != null)
            {
                sb.AppendFormat("border-left-style:{0};", _Left.EvaluateString(rpt, row));
            }

            if (_Right != null)
            {
                sb.AppendFormat("border-right-style:{0};", _Right.EvaluateString(rpt, row));
            }

            if (_Top != null)
            {
                sb.AppendFormat("border-top-style:{0};", _Top.EvaluateString(rpt, row));
            }

            if (_Bottom != null)
            {
                sb.AppendFormat("border-bottom-style:{0};", _Bottom.EvaluateString(rpt, row));
            }

            return(sb.ToString());
        }
Esempio n. 3
0
        public String BookmarkLinkValue(Report rpt, Row r)
        {
            if (_BookmarkLink == null)
            {
                return(null);
            }

            return(_BookmarkLink.EvaluateString(rpt, r));
        }
Esempio n. 4
0
        public String HyperLinkValue(Report rpt, Row r)
        {
            if (_Hyperlink == null)
            {
                return(null);
            }

            return(_Hyperlink.EvaluateString(rpt, r));
        }
Esempio n. 5
0
        public string ValueValue(Report rpt, Row r)
        {
            if (_Value == null)
            {
                return("");
            }

            return(_Value.EvaluateString(rpt, r));
        }
        public string EvalLanguage(Report rpt, Row r)
        {
            if (_Language == null)
            {
                CultureInfo ci = CultureInfo.CurrentCulture;
                return(ci.Name);
            }

            return(_Language.EvaluateString(rpt, r));
        }
        public ChartBase(Report r, Row row, Chart c, MatrixCellEntry[,] m, Expression showTooltips, Expression showTooltipsX,Expression _ToolTipYFormat, Expression _ToolTipXFormat)
		{
			_ChartDefn = c;
			_row = row;
			_DataDefn = m;
			_bm = null;
			int width = _ChartDefn.WidthCalc(r, null);
			int height = RSize.PixelsFromPoints(_ChartDefn.HeightOrOwnerHeight);
			Layout = new ChartLayout(width, height);
			_SeriesBrush = null;
			_SeriesMarker = null;
            _showToolTips = showTooltips.EvaluateBoolean(r, row);
            _showToolTipsX = showTooltipsX.EvaluateBoolean(r, row);
            _tooltipYFormat = _ToolTipYFormat.EvaluateString(r, row);
            _tooltipXFormat = _ToolTipXFormat.EvaluateString(r, row);

		}
Esempio n. 8
0
        // Handle parsing of function in final pass
        override public void FinalPass()
        {
            if (_CommandText != null)
            {
                _CommandText.FinalPass();
            }
            if (_QueryParameters != null)
            {
                _QueryParameters.FinalPass();
            }

            // verify the data source
            DataSourceDefn ds = null;

            if (OwnerReport.DataSourcesDefn != null &&
                OwnerReport.DataSourcesDefn.Items != null)
            {
                ds = OwnerReport.DataSourcesDefn[_DataSourceName];
            }
            if (ds == null)
            {
                OwnerReport.rl.LogError(8, "Query references unknown data source '" + _DataSourceName + "'");
                return;
            }
            _DataSourceDefn = ds;

            IDbConnection cnSQL = ds.SqlConnect(null);

            if (cnSQL == null || _CommandText == null)
            {
                return;
            }

            // Treat this as a SQL statement
            String      sql   = _CommandText.EvaluateString(null, null);
            IDbCommand  cmSQL = null;
            IDataReader dr    = null;

            try
            {
                cmSQL             = cnSQL.CreateCommand();
                cmSQL.CommandText = AddParametersAsLiterals(null, cnSQL, sql, false);
                if (this._QueryCommandType == QueryCommandTypeEnum.StoredProcedure)
                {
                    cmSQL.CommandType = CommandType.StoredProcedure;
                }

                AddParameters(null, cnSQL, cmSQL, false);
                dr = cmSQL.ExecuteReader(CommandBehavior.SchemaOnly);
                if (dr.FieldCount < 10)
                {
                    _Columns = new ListDictionary();                            // Hashtable is overkill for small lists
                }
                else
                {
                    _Columns = new Hashtable(dr.FieldCount);
                }

                for (int i = 0; i < dr.FieldCount; i++)
                {
                    QueryColumn qc = new QueryColumn(i, dr.GetName(i), Type.GetTypeCode(dr.GetFieldType(i)));

                    try { _Columns.Add(qc.colName, qc); }
                    catch                       // name has already been added to list:
                    {                           // According to the RDL spec SQL names are matched by Name not by relative
                                                //   position: this seems wrong to me and causes this problem; but
                                                //   user can fix by using "as" keyword to name columns in Select
                                                //    e.g.  Select col as "col1", col as "col2" from tableA
                        OwnerReport.rl.LogError(8, String.Format("Column '{0}' is not uniquely defined within the SQL Select columns.", qc.colName));
                    }
                }
            }
            catch (Exception e)
            {
                OwnerReport.rl.LogError(4, "SQL Exception during report compilation: " + e.Message + "\r\nSQL: " + sql);
            }
            finally
            {
                if (cmSQL != null)
                {
                    cmSQL.Dispose();
                    if (dr != null)
                    {
                        dr.Close();
                    }
                }
            }

            return;
        }
 public string Connectstring(Report rpt)
 {
     return(_ConnectString.EvaluateString(rpt, null));
 }
Esempio n. 10
0
        public void SetPagePositionAndStyle(Report rpt, PageItem pi, Row row)
        {
            WorkClass wc = GetWC(rpt);

            pi.X = GetOffsetCalc(rpt) + LeftCalc(rpt);
            if (this._TC != null)
            {                   // must be part of a table
                Table t        = _TC.OwnerTable;
                int   colindex = _TC.ColIndex;

                // Calculate width: add up all columns within the column span
                float       width = 0;
                TableColumn tc;
                for (int ci = colindex; ci < colindex + _TC.ColSpan; ci++)
                {
                    tc     = (TableColumn)(t.TableColumns.Items[ci]);
                    width += tc.Width.Points;
                }
                pi.W = width;
                pi.Y = 0;

                TableRow tr = (TableRow)(_TC.Parent.Parent);
                pi.H = tr.HeightCalc(rpt);                      // this is a cached item; note tr.HeightOfRow must already be called on row
            }
            else if (wc.MC != null)
            {                   // must be part of a matrix
                pi.W = wc.MC.Width;
                pi.Y = 0;
                pi.H = wc.MC.Height;
            }
            else if (pi is PageLine)
            {   // don't really handle if line is part of table???  TODO
                PageLine pl = (PageLine)pi;
                if (Top != null)
                {
                    pl.Y = this.Gap(rpt);                //  y will get adjusted when pageitem added to page
                }
                float y2 = pl.Y;
                if (Height != null)
                {
                    y2 += Height.Points;
                }
                pl.Y2 = y2;
                pl.X2 = pl.X;
                if (Width != null)
                {
                    pl.X2 += Width.Points;
                }
            }
            else
            {   // not part of a table or matrix
                if (Top != null)
                {
                    pi.Y = this.Gap(rpt);                //  y will get adjusted when pageitem added to page
                }
                if (Height != null)
                {
                    pi.H = Height.Points;
                }
                else
                {
                    pi.H = this.HeightOrOwnerHeight;
                }
                if (Width != null)
                {
                    pi.W = Width.Points;
                }
                else
                {
                    pi.W = this.WidthOrOwnerWidth(rpt);
                }
            }
            if (Style != null)
            {
                pi.SI = Style.GetStyleInfo(rpt, row);
            }
            else
            {
                pi.SI = new StyleInfo();    // this will just default everything
            }
            pi.ZIndex = this.ZIndex;        // retain the zindex of the object

            // Catch any action needed
            if (this._Action != null)
            {
                pi.BookmarkLink = _Action.BookmarkLinkValue(rpt, row);
                pi.HyperLink    = _Action.HyperLinkValue(rpt, row);
            }

            if (this._Bookmark != null)
            {
                pi.Bookmark = _Bookmark.EvaluateString(rpt, row);
            }

            if (this._ToolTip != null)
            {
                pi.Tooltip = _ToolTip.EvaluateString(rpt, row);
            }
        }