/// <summary>
        /// Initilize the object for Graph
        /// </summary>
        /// <param name="presentationData">DataView</param>
        /// <param name="DIConnection">DIConnection used in IC Classification of step 3 & its implementation in step 6 and also for footnotes text and comments text in step 6</param>
        /// <param name="DIQueries">DIQueries</param>
        /// <param name="UserSelection">UserSelection2 (New UserSelection)</param>
        /// <remarks>
        /// This class using Table presenation class for generating datasource
        /// </remarks>
        public GraphPresentation(DIDataView dIDataView, DIConnection dIConnection, DIQueries dIQueries, UserPreference.UserPreference userPreference)
        {
            // - Create object of TablePresentation
            this._TablePresentation = new TablePresentation(dIDataView, dIConnection, dIQueries, userPreference, string.Empty);

            // - Set the Presenatation Type
            this._TablePresentation.PresentationType = Presentation.PresentationType.Graph;

            // - Initilize the graph appearence oject
            this._GraphAppearence = new StyleTemplate(Presentation.PresentationType.Graph, userPreference.General.ShowExcel);

            // Set the user pref for internal use
            this.UserPreference = userPreference;

            this._SpreadsheetGearChartType = GetSpreadsheetChartTypeFromXlChartType(this.UserPreference.Chart.ChartType);

            // Initilize the all the language strings
            this.ApplyLanguageSettings();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dIDataView"></param>
        /// <param name="dIConnection"></param>
        /// <param name="dIQueries"></param>
        /// <param name="userPreference"></param>
        /// <param name="outputFolderPath"></param>
        /// <param name="outputType"></param>
        public GraphPresentation(DIDataView dIDataView, DIConnection dIConnection, DIQueries dIQueries, UserPreference.UserPreference userPreference, string outputFolderPath, PresentationOutputType outputType)
        {
            // - Create object of TablePresentation
            this._TablePresentation = new TablePresentation(dIDataView, dIConnection, dIQueries, userPreference, string.Empty);

            // - Set the Presenatation Type
            this._TablePresentation.PresentationType = Presentation.PresentationType.Graph;

            this._TablePresentation.ShowExcel = userPreference.General.ShowExcel;

            // - Initilize the graph appearence oject
            this._GraphAppearence = new StyleTemplate(Presentation.PresentationType.Graph, userPreference.General.ShowExcel);

            if (!userPreference.General.ShowExcel)
            {
                if (outputType == PresentationOutputType.ExcellSheet)
                {
                    this._TablePresentation.PresentationOutputType = PresentationOutputType.ExcellSheet;
                }
                else
                {
                    this._TablePresentation.PresentationOutputType = PresentationOutputType.MHT;
                }

                // Set the user pref.
                this.UserPreference = userPreference;

                this._SpreadsheetGearChartType = GetSpreadsheetChartTypeFromXlChartType(this.UserPreference.Chart.ChartType);

                // Initilize the all the language strings
                this.ApplyLanguageSettings();
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Save the template in form of XML file.
 /// </summary>
 /// <param name="fileNameWPath">file Name with path</param>
 /// <param name="styleTemplate">Object of StyleTemplate type</param>
 public void SaveStyleTemplate(string fileNameWPath, StyleTemplate styleTemplate)
 {
     try
     {
         XmlSerializer TemplateSerialize = new XmlSerializer(typeof(StyleTemplate));
         StreamWriter TemplateWriter = new StreamWriter(fileNameWPath);
         TemplateSerialize.Serialize(TemplateWriter, styleTemplate);
         TemplateWriter.Close();
     }
     catch (Exception)
     {
     }
 }