在使用 表开发工具FastReport.NET的过程中,总会遇见授权或者使用问题,今天我们就联合厂商为大家带来10个常见问题的解答,希望能够帮到大家。
上一篇我们了解了FastReport .Net五大常见问题及解决办法,今天我们继续讨论常会遇见的问题和解决方法,今天将带来10个问题的分享。
问题1:如何从代码创建MSChartObject/strong>
1.新建MSChart对象,设置宽高和图例:
MSChartObject MSChart1 = new MSChartObject();MSChart1.Width = 300;MSChart1.Height = 300;MSChart1.Chart.Legends.Add(new Legend() { Name = "Legend1", Title="Legend title"});
2. 创建 ChartArea 对象,设置名称、轴标题并将创建的 ChartArea 分配给 MSChart:
ChartArea chartArea1 = new ChartArea();chartArea1.Name = "ChartArea1";chartArea1.Axes[0].Title = "X name";chartArea1.Axes[1].Title = "Y name";MSChart1.Chart.ChartAreas.Add(chartArea1);
3.创建Series对象,设置图表类型,边框宽度,添加点并为图表分配系列:
Series series = new Series("sample");series.ChartType = SeriesChartType.Line;series.BorderWidth = 2;series.Points.Add(new DataPoint(0, 1));series.Points.Add(new DataPoint(1, 2));series.Points.Add(new DataPoint(3, 5));series.Points.Add(new DataPoint(4, 8)); MSChart1.Chart.Series.Add(series);
4.将创建的MSChart赋值给DataBand:
Report report = new Report();report.Load("ok.frx");DataBand db = report.FindObject("Data1") as DataBand; MSChart1.Parent = db;
和完整的片段:
MSChartObject MSChart1 = new MSChartObject();MSChart1.Width = 300;MSChart1.Height = 300;MSChart1.Chart.Legends.Add(new Legend() { Name = "Legend1", Title="Legend title"}); ChartArea chartArea1 = new ChartArea();chartArea1.Name = "ChartArea1";chartArea1.Axes[0].Title = "X name";chartArea1.Axes[1].Title = "Y name";MSChart1.Chart.ChartAreas.Add(chartArea1); Series series = new Series("sample");series.ChartType = SeriesChartType.Line;series.BorderWidth = 2;series.Points.Add(new DataPoint(0, 1));series.Points.Add(new DataPoint(1, 2));series.Points.Add(new DataPoint(3, 5));series.Points.Add(new DataPoint(4, 8)); MSChart1.Chart.Series.Add(series); Report report = new Report();report.Load("ok.frx");DataBand db = report.FindObject("Data1") as DataBand;MSChart1.Parent = db;
结果:
问题2:我的订阅已过期,在哪里可以下载该产品的最新可访问版本/strong>
在 support.fast-report.com 上向我们发送有关此内容的电子邮件,我们将为您提供最接近您的版本。
问题3:如何在构建或查看 表时关闭ProgressForm /strong>
您可以在 EnvironmentSettings 中关闭 ProgressForm:
Report report = new Report();report.LoadPrepared("1.fpx");EnvironmentSettings s = new EnvironmentSettings();s.ReportSettings.ShowProgress = false;report.Show();
问题4:如何返回/ 重置默认的Designer设置
您应该从 C:Users”Your user’s name””AppDataLocalFastReport 文件夹中删除 FastReport.config 文件。
问题5:我不喜欢其中一种本地化的翻译,我该如何改进它
您可以在 FastReportsFastReport.NetLocalization 文件夹中找到需要的本地化 *.frl 文件并对其进行改进。如果所需文件中没有字段,请向我们 (support.fast-report.com) 咨询获取英文本地化文件,根据英文版本添加字段。
问题6:如何为所需语言创建本地化
请发送电子邮件至 tz@fast-report.com 或 support.fast-report.com 与我们联系,我们将为您提供英文本地化文件以创建所需的本地化文件。将您的本地化文件 (*.frl) 发送给我们,我们会将其添加到新版本中,并给予您奖励!
问题7:如何从代码中获取查询参数值
建议您使用以下代码段:
Report.Dictionary.Connections[0].Tables[0].Parameters[0].Value.ToString();
问题8:如何将HTML格式的 告嵌入到消息中并使用代码通过电子邮件发送/strong>
请使用以下代码段
Report report = new Report();report.LoadPrepared(""preparedreport.fpx"");HTMLExport htmlExport = new HTMLExport(){SubFolder = false
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!