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


C# TParameterList.ToDataTable方法代码示例

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


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

示例1: CheckAddDoubleEntry

        /// <summary>
        /// Checks if there is already a field with the same name in the grid. If yes, ask
        /// if the field should be added again.
        /// </summary>
        /// <param name="AColumnParameters">List with the current columns</param>
        /// <param name="AColumnName">Name of the field</param>
        /// <param name="ASelectedColumn">Index of the column in the grid</param>
        /// <returns>True if the field should be added. Otherwise false</returns>
        public static bool CheckAddDoubleEntry(ref TParameterList AColumnParameters, String AColumnName, int ASelectedColumn)
        {
            bool ReturnValue = true;
            DataTable ColumnTable = AColumnParameters.ToDataTable();

            String NewField = "eString:" + AColumnName;

            foreach (DataRow Row in ColumnTable.Rows)
            {
                if ((Row["value"].ToString() == NewField)
                    && (((int)Row["column"]) != ASelectedColumn))
                {
                    if (MessageBox.Show("The column is already there.\nDo you want to add it anyway?", "Add field?",
                            MessageBoxButtons.YesNo) == DialogResult.No)
                    {
                        ReturnValue = false;
                    }

                    break;
                }
            }

            return ReturnValue;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:32,代码来源:UC_ColumnHelper.cs

示例2: CalculateReport

        /// <summary>
        /// calculate the report and save the result and returned parameters to file
        /// </summary>
        public static void CalculateReport(string AReportParameterXmlFile, TParameterList ASpecificParameters, int ALedgerNumber = -1)
        {
            // important: otherwise month names are in different language, etc
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB", false);

            TReportGeneratorUIConnector ReportGenerator = new TReportGeneratorUIConnector();
            TParameterList Parameters = new TParameterList();
            string resultFile = AReportParameterXmlFile.Replace(".xml", ".Results.xml");
            string parameterFile = AReportParameterXmlFile.Replace(".xml", ".Parameters.xml");
            Parameters.Load(AReportParameterXmlFile);

            if (ALedgerNumber != -1)
            {
                Parameters.Add("param_ledger_number_i", ALedgerNumber);
            }

            Parameters.Add(ASpecificParameters);

            ReportGenerator.Start(Parameters.ToDataTable());

            while (!ReportGenerator.Progress.JobFinished)
            {
                Thread.Sleep(500);
            }

            Assert.IsTrue(ReportGenerator.GetSuccess(), "Report did not run successfully");
            TResultList Results = new TResultList();

            Results.LoadFromDataTable(ReportGenerator.GetResult());
            Parameters.LoadFromDataTable(ReportGenerator.GetParameter());

            if (!Parameters.Exists("ControlSource", ReportingConsts.HEADERPAGELEFT1, -1, eParameterFit.eBestFit))
            {
                Parameters.Add("ControlSource", new TVariant("Left1"), ReportingConsts.HEADERPAGELEFT1);
            }

            if (!Parameters.Exists("ControlSource", ReportingConsts.HEADERPAGELEFT2, -1, eParameterFit.eBestFit))
            {
                Parameters.Add("ControlSource", new TVariant("Left2"), ReportingConsts.HEADERPAGELEFT2);
            }

            Parameters.Save(parameterFile, false);
            Results.WriteCSV(Parameters, resultFile, ",", false, false);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:47,代码来源:ReportTesting.tools.cs

示例3: WriteBinaryFile

        /// <summary>
        /// This stores the resultlist and parameterlist into a binary file (using the Datatable conversion);
        /// This can be used for debugging the printing, and saving time on calculating the report by reusing previous results
        ///
        /// </summary>
        /// <returns>void</returns>
        public void WriteBinaryFile(TParameterList AParameters, String AFilename)
        {
            DataTable dt = ToDataTable(AParameters);
            FileStream fs = new FileStream(AFilename, FileMode.Create);
            BinaryFormatter bf = new BinaryFormatter();

            bf.Serialize(fs, dt);

            dt = AParameters.ToDataTable();
            bf.Serialize(fs, dt);

            fs.Close();
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:19,代码来源:Result.cs


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