没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
如何为最终用户删除“数据”选项卡?
将“ EnvironmentSettings”控件添加到您的窗体。
然后在调用report.Design()之前添加以下行:
EnvironmentSettings1.DesignerSettings.Restrictions.DontCreateData = True; EnvironmentSettings1.DesignerSettings.Restrictions.DontEditData = True;
如果使用DesignerControl,则应使用以下命令:
designerControl1.Restrictions.DontCreateData = true; designerControl1.Restrictions.DontEditData = true;
这样,数据控件将被禁用。
如何在WPF应用程序中使用FastReport.Net控件?
您应该为此使用WindowsFormsHost控件:
0)在FastReport.dll上添加引用;
1)如果要使用PreviewControl,则将属性添加到Window(Page)标记中:xmlns:fr =“ clr-namespace:FastReport.Preview; assembly = FastReport”,xmlns:fr1 =“ clr-namespace:FastReport.Design; assembly = FastReport”-if DesignerControl;
2)将WindowsFormsHost标记添加到您的XAML标记中:
<WindowsFormsHost HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.ColumnSpan="3"> </WindowsFormsHost>
3)将子级添加到WindowsFormsHost中:<fr:PreviewControl> </ fr:PreviewControl>或<fr1:Designer> </ fr1:Designer>。
完整的标记应如下所示:
<Window xmlns="//schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="//schemas.microsoft.com/winfx/2006/xaml" xmlns:d="//schemas.microsoft.com/expression/blend/2008" xmlns:mc="//schemas.openxmlformats.org/markup-compatibility/2006" x:Class="WpfApplication1.MainWindow" Title="MainWindow" Height="375.977" Width="939.258" xmlns:fr="clr-namespace:FastReport.Preview;assembly=FastReport"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <WindowsFormsHost HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.ColumnSpan="3"> <fr:PreviewControl></fr:PreviewControl> </WindowsFormsHost> </Grid> </Window>
如何以编程方式设置Format的值?
您可以使用以下代码在脚本或项目中执行此操作:
FastReport.Format.NumberFormat format = new FastReport.Format.NumberFormat(); format.UseLocale = false; format.DecimalDigits = 2; format.DecimalSeparator = "."; format.GroupSeparator = ",";
然后:
textObject.Formats.Clear(); textObject.Formats.Add(format);
如何在MSChartObject中创建带有间隙的行?
您应该创建基本的System.Windows.Forms.DataVisualization.Charting.Series对象,并在此处创建行。之后,应为MSChartObject基本图表分配创建的系列(MSChart1.Chart.Series.Add(series);)不要忘记在“报表”->“脚本”菜单和命名空间System.Windows.Forms中添加 System.Windows.Forms.DataVisualization.dll。 .DataVisualization.Charting。
带有间隙的线的示例:
.
.
using System.Windows.Forms.DataVisualization.Charting;
namespace FastReport
{
public class ReportScript
{
private void MSChart1_BeforePrint(object sender, EventArgs e)
{
Series series = new Series("sample");
series.ChartType = SeriesChartType.Line;
series.BorderWidth = 2;
series.MarkerSize = 5;
series.Points.Add(new DataPoint(0, 1));
series.Points.Add(new DataPoint(1, 2));
DataPoint dp = new DataPoint(2, double.NaN);
dp.IsEmpty = true;
series.Points.Add(dp);
series.Points.Add(new DataPoint(3, 5));
series.Points.Add(new DataPoint(4, 8));
MSChart1.Chart.Series.Add(series);
}
}
}结果:

如何从代码创建MSChartObject?
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 = 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; 结果:

如何从代码中获取查询参数值?
您应该使用以下代码段:
Report.Dictionary.Connections [0] .Tables [0] .Parameters [0] .Value.ToString();
如何将HTML格式的报告嵌入消息中并使用代码通过电子邮件发送?
为此使用以下代码段:Report report = new Report();
report.LoadPrepared("preparedreport.fpx");
HTMLExport htmlExport = new HTMLExport()
{
SubFolder = false,
Navigator = false,
Pictures = true,
EmbedPictures = true,
SinglePage = true,
Layers = true,
HasMultipleFiles = false
};
EmailExport email = new EmailExport();
//email mailer settings
email.Account.Address = "Email@gmail.com";
email.Account.Name = "Usename";
email.Account.Host = "smtp.yandex.ru";
email.Account.Port = 25;
email.Account.UserName = "Email";
email.Account.Password = "password";
email.Account.MessageTemplate = "Test";
email.Account.EnableSSL = true;
//email addressee settings
email.Address = "Destinationaddress@gmail.com";
email.Subject = "Embedding of html";
email.Export = htmlExport; //Set export type
email.SendEmail(report); //Send email如何在构建或查看报告时关闭ProgressForm?
您可以在EnvironmentSettings中关闭ProgressForm:
Report report = new Report(); report.LoadPrepared(“ 1.fpx”); EnvironmentSettings s = new EnvironmentSettings(); s.ReportSettings.ShowProgress = false;report.Show();如何从代码中获取查询参数值?
打破零回复...
微信扫码登录
福利更多、资源更多
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@ke049m.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
半岛外围网上直营
发布新帖
登录 慧都网发表评论