双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

报表制作技巧(一)

boymaster boymaster 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
格式化整数输出
  比较大的数字在输出时会显得不易阅读,在Delphi中显示带分节号的数字是相当简单的一件事,如下即可:xxxxx.caption:ΚFormatFloat(′#′,524667500)。

当前打印机的分辨率

Windows下的打印分辨对打印程序有着至关重要的作用,如果你想知道打印机的分辨率,请在程序中加入一行:ShowMessage(′水平分辨率′+inttostr(GetDeviceCaps(printerHandle,LOGPIXELSX))+chr(13)+′垂直分辨率:′+inttostr(GetDeviceCaps(printerHandle,LOGPIXELSY)));结果就一目了然了。

将结果直接送到打印机

Delphi提供了两种打印方式:一是将结果输送到Form,再调用Form的print方法将结果输送到打印机,二是将结果直接输送到打印机。如果你采用第一种方式,则无论你怎样调整Form的PrintScal属性,打印出来的东西也不会让你满意。因此建议采用第二种方式。



报表制作技巧(二)
整理编辑:China ASP

尽量不要使用AssignPrn

尽管AssignPrn简化了文本打印操作,使输出到打印机像输出到文件一样简单。但简单带来的是一系列的不方便:你无法知道当前打印的行数,无法准确控制行距,无法灵活改变字体字形等等。还是用打印机的Canvas属性进行打印吧。

用打印机的点数做度量单位

如果想让打印程序在任何打印机上都能正常地打印,你就必须改变你的度量单位。如果采用固定的度量,不同分辨率的打印效果是不同的。举例来讲:printerCanvasrectangle(0,0,360,720)在360×360的佳能4200SP上能打出一个1英寸宽、2英寸高的矩形,但在600×600的惠普6L上只能打出06英寸宽、12英寸高的矩形。使用打印机的点数做为度量单位是一个明智的选择。具体做法如下:VarPointX,PointY:integer;PointX:=GetDeviceCaps(printerHandle,LOGPIXELSX);PointY:=GetDeviceCaps(printerHandle,LOGPIXELSX);printerCanvasrectangle(0,0,PointX*1,PointY*2)这样,无论你使用什么样的打印机,都能得到一个1英寸宽、2英寸高的矩形。

添加打印程序单元

尽管Delphi在生成窗体时会自动在USES部分加入许多程序单元,但打印程序单元(Printers)却不在之列,要想使打印机正常工作和程序不出错,你还是老老实实手工给它加上吧。

报表制作技巧(三)
整理编辑:China ASP

任意打印

  有时我们要打印任意排列的表或往已经印好的登记表上对号入座写上数据时,可以新建一个窗体(假设为Form1),再把Form1的BorderStyle设为bsNone、AutoScroll设为True,接下来再创建一个新窗体(假设为Form2),再建个按钮Button1,编写代码:
procedure TForm2.Button1Click(Sender: TObject);
begin
Form1.Width :=900;
Form1.Height :=800;
Form1.Print;
end;
  接下来你在Form1上对应的位置写上数据,运行后按Button1就会一五一十的打印下来了。

打印机的分辨率问题?
Printer Resolution ?
问:
I want to know, wich way I have to program, so every print is equal. No
matter what resolution
of the printer (300 or 600 dpi).
Since now I program: TextOut(DC, 150, 150...) on a 300 dpi printer. But on
600 dpi, everything
looks a bit strange, (small).

What Objects can I use to print corectly??
答:
I get the printer resolution (and unprintable are if desired) and
then specify coordinates using decimal inches * resulution e.g.

x = trunc(1.5 * ResX) at 300 dpi will begin at 360 * 1.5 or 540 pixels.

Get Resolution and unprintable
ResX := GetDeviceCaps(ACanvas.Handle,LOGPIXELSX);
ResY := GetDeviceCaps(ACanvas.Handle,LOGPIXELSY);
pOffsetX := GetDeviceCaps(ACanvas.Handle,PHYSICALOFFSETX);
pOffsetY := GetDeviceCaps(ACanvas.Handle,PHYSICALOFFSETY);

print something

Printer.Canvas.TextOut(trunc(1.5 * ResX)-pOffsetX,
trunc(2.5 * ResY)-pOffsetY,'Hello');

This is nice when prp元件上点出右键菜单,选Report Setting项,将弹出一个设置窗口,将
Margins项中的Number of columns项设为你想在一行中显示的记录数,然后你会发现。。。:)


在打印或打印预览前如何获取报表页数
整理编辑:China ASP

我们有时需要在打印前获取报表的打印页数, 比如我们需要在页眉或页脚中打印“共 xx 页 第 xx 页”,那如何实现呢? QuickRep生成Report之前,我们是无法得知报表页数的,而QuickReport是在打印或打印预览时才生成报表,换言之我们只有在 打印或打印预览前先将报表生成一次才能获取打印页数.生成报表的方法是 Prepare。参考以下的例子:
...
var nPageCount:integer;
begin
  {...}
   QuickRep1.Prepare;
   nPageCount:=QuickRep1.QRPrinter.PageCount;
   QuickRep1.QRPrinter.Free;
   QuickRep1.QRPrinter:=nil;
   {在此修改QuickRep1,实现在页眉或页脚中打印“共 xx 页 第 xx 页” ... }
   QuickRep1.PreView;
   {...}
End;
...全文

相关推荐

Objective C Pocket Reference.rar

Objective C Pocket Reference.rar

飞哥

iPhone.rar_iPhone/iOS_Objective-C_

iPhone开发必备资料,齐全,是开发必不可缺的资料

pudn01

Kindle Computer Science other.rar

计算机科学类图书打包,mobi格式。 Apress Beginning 3D Game Development with Unity.mobi Apress Beginning BlackBerry 7 Development.mobi NoStarch IDA Pro Book 2nd.mobi OReilly PDF Explained.mobi OReilly Programming Scala.mobi Social Engineering.mobi Wrox Beginning Lua Programming.mobi Android\Android Programming Tutorials.mobi Android\Apress Android Recipes.mobi Android\Apress Pro Android Python with SL4A.mobi Android\OReilly Application Security for the Android Platform.mobi Android\Oreilly Learning Android.mobi Android\The Busy Coders Guide to Advanced Android Development.mobi Android\The Busy Coders Guide to Android Development.mobi Android\Wiley App Inventor for Android.mobi Apple\101024Apple Pro Training Aperture 3.mobi Apple\101102Apple Pro Training Series AppleScript 1-2-3.mobi Apple\Apple Pro Training Aperture 3 - Organize Perfect and Showcase Your Photos.mobi Apple\Apple Pro Training Series AppleScript 1-2-3.mobi Database\Apress Access 2010 Development.mobi Database\Apress Expert Oracle Exadata.mobi Database\Apress Expert Oracle GoldenGate.mobi Database\Apress Expert PL SQL Practices for Oracle Developers and DBAs.mobi Database\Apress Oracle PLSQL Recipes - A Problem-Solution Approach.mobi Database\Apress Pro Oracle Database 11g Administration.mobi Database\Apress Troubleshooting Oracle Performance.mobi Database\Oracle Internals - Tips Tricks and Techniques for DBAs.mobi Database\OReilly High Performance MySQL.mobi Database\OReilly SQL and Relational Theory 2nd.mobi Database\OReilly SQL Cookbook.mobi Database\OReilly SQL Pocket Guide 3rd.mobi Database\Pragmatic SQL Antipatterns Avoiding the Pitfalls of Database Programming.mobi Flash\FriendsofED AdvancED ActionScript 3.0 Design Patterns.mobi Flash\OReilly Automating ActionScript Projects with Eclipse and Ant.mobi Flash\OReilly Quick Guide to Flash Catalyst.mobi iOS_Mac\Addison Learning Cocos2D.mobi iOS_Mac\Addison Programming in Objective-C 3rd.mobi iOS_Mac\Apple Pro Training Aperture 3 - Organize Perfect and Showcase Your Photos.mobi iOS_Mac\Apple Pro Training Series AppleScript 1-2-3.mobi iOS_Mac\Apress Beginning OSX Lion Apps Development.mobi iOS_Mac\Apress Learn cocos2d Game Development with iOS 5.mobi iOS_Mac\Apress Migrating to iPhone and iPad for dotNET Developers.mobi iOS_Mac\Apress Pro iOS Apps Performance Optimization.mobi iOS_Mac\iPhone Programming The Big Nerd Ranch Guide.mobi iOS_Mac\OReilly Basic Sensors in iOS.mobi iOS_Mac\OReilly Developing Enterprise iOS Applications.mobi iOS_Mac\OReilly iOS 4 Programming Cookbook.mobi iOS_Mac\OReilly Mac OS X for Unix Geeks Leopard 4th.mobi iOS_Mac\Pragmatic iOS Recipes.mobi iOS_Mac\Pragmatic Mac Kung Fu.mobi iOS_Mac\Wrox Beginning iOS Game Development.mobi iOS_Mac\Wrox Building Applications for Mac App Store.mobi Lisp\NoStarch Land of Lisp - Learn to Program One Game at a Time.mobi Perl\OReilly Learning Perl 6th.mobi Perl\OReilly Perl Pocket Reference.5th.mobi PHP\OReilly Building on SugarCRM.mobi PHP\OReilly Web Database Applications with PHP and MySQL 2nd.mobi PHP\Packt WordPress 3 Plugin Development Essentials.mobi Python\Addison Python Standard Library by Example, the Developers Library.mobi Python\Addison Python Web Development with Django.mobi Python\Apress The Definitive Guide to Django - Web Development Done Right.mobi Python\OReilly Learning Python 4th.mobi Python\OReilly MongoDB and Python.mobi Python\OReilly Programming Python 3rd.mobi Python\OReilly Python and AWS Cookbook.mobi Python\OReilly Python for Unix and Linux System Administration.mobi Python\OReilly Social Network Analysis for Startups.mobi Python\Packt Django 1.1 Testing and Debugging.mobi R\NoStarch The Art of R Programming.mobi R\OReilly Data Mashups in R.mobi R\OReilly Machine Learning for Email.mobi R\OReilly Parallel R.mobi SAP\McGraw SAP Project System Handbook.mobi SAP\OReilly Microsoft .NET and SAP (Pro-Developer).mobi SAP\Sams Teach Yourself SAP in 24 Hours 4th.mobi StackOverflowE-Books\stack_overflow_ajax.mobi StackOverflowE-Books\stack_overflow_android.mobi StackOverflowE-Books\stack_overflow_asp.net.mobi StackOverflowE-Books\stack_overflow_c.mobi StackOverflowE-Books\stack_overflow_clojure.mobi StackOverflowE-Books\stack_overflow_cocoa.mobi StackOverflowE-Books\stack_overflow_css.mobi StackOverflowE-Books\stack_overflow_database.mobi StackOverflowE-Books\stack_overflow_delphi.mobi StackOverflowE-Books\stack_overflow_django.mobi StackOverflowE-Books\stack_overflow_drupal.mobi StackOverflowE-Books\stack_overflow_erlang.mobi StackOverflowE-Books\stack_overflow_f#.mobi StackOverflowE-Books\stack_overflow_flash.mobi StackOverflowE-Books\stack_overflow_flex.mobi StackOverflowE-Books\stack_overflow_git.mobi StackOverflowE-Books\stack_overflow_haskell.mobi StackOverflowE-Books\stack_overflow_html.mobi StackOverflowE-Books\stack_overflow_html5.mobi StackOverflowE-Books\stack_overflow_iphone.mobi StackOverflowE-Books\stack_overflow_jquery.mobi StackOverflowE-Books\stack_overflow_linq.mobi StackOverflowE-Books\stack_overflow_linux.mobi 。。。

osketch1

两路半桥LLC谐振变换器软开关Simulink仿真(模拟谐振参数不同、分裂电容)

内容概要:本文介绍了“两路半桥LLC谐振变换器软开关Simulink仿真”资源包,重点在于基于Simulink平台对两路半桥LLC谐振变换器进行高精度建模与动态仿真,特别考虑了谐振参数不一致及分裂电容等非理想工况对系统性能的影响。该仿真模型不仅涵盖了主电路拓扑、软开关实现机制与谐振网络设计,还深入分析了不同参数配置下系统的启动特性、稳态效率、动态响应及软开关条件的满足情况。通过参数扫描与对比仿真,帮助用户掌握LLC变换器的关键设计要素与优化方法,具备较强的工程指导价值和科研教学意义。; 适合人群:电力电子、电气工程及其自动化等相关专业的高校师生,以及从事高频开关电源、新能源变换器、车载充电机等领域的研发工程师和技术人员。; 使用场景及目标:① 掌握两路并联半桥LLC谐振变换器的建模与仿真方法;② 理解软开关技术在提升变换器效率与降低EMI方面的关键作用;③ 分析谐振参数偏差与分裂电容结构对系统均流特性、增益曲线及软开关范围的影响;④ 支持科研项目中的拓扑验证、控制策略开发与故障工况分析; 阅读建议:建议结合Simulink仿真模型与配套说明文档进行学习,重点关注谐振腔参数设置、驱动时序设计及软开关波形观测;可通过调整谐振电感、电容值或引入参数失配,观察系统行为变化,深入理解LLC变换器的稳定边界与优化设计原则。

woshilaiwade

双向全桥CLLC谐振变换器仿真模型(Simulink仿真实现)

内容概要:本文系统介绍了双向全桥CLLC谐振变换器的Simulink仿真模型,重点阐述了变频控制、闭环仿真及其与多种电力电子拓扑(如维也纳整流器、DAB变换器、图腾柱PFC等)的联合仿真设计。资源包涵盖2.5kW双向全桥LLC、V2G电动汽车充放电系统、三相PFC、多相交错LLC等多种变换器的仿真案例,并深入展示了三电平VIENNA整流器在双闭环PI控制与SVPWM调制策略下,结合上下电容电压差值补偿实现中点电位平衡的先进控制方法。通过仿真验证,该策略不仅有效维持了800V直流母线电压的稳定,还在动态工况下显著提升了电容电压的均衡度,同时保持了较低的输入电流THD,充分体现了SVPWM与中点平衡控制协同优化的技术优势。; 适合人群:具备电力电子与自动控制理论基础,从事新能源发电、电动汽车、工业电源、微电网等领域的研究生、工程师及科研人员。; 使用场景及目标:① 学习并构建高频谐振变换器(如LLC、CLLC)的Simulink仿真模型,掌握其变频与混合控制策略;② 深入理解并应用中点电位平衡、双闭环PI控制、SVPWM调制等核心技术于VIENNA等三电平变换器中;③ 复现高水平期刊论文中的控制算法,服务于科研项目申报、学术论文撰写或工程产品开发。; 阅读建议:该资源为综合性仿真资料库,建议使用者结合自身研究方向(如电动汽车充电、新能源并网)选择对应案例进行精学,重点关注控制策略的设计逻辑、仿真参数的整定方法以及SVPWM与中点平衡的协同机制,并充分利用附带的计算书和参考文献深化理解,以实现从仿真模型到实际工程应用的顺利转化。

荧光Matlab
评论 1
收藏 已收藏
分享
返回顶部
boymaster
IBM开发者 205 成员 2,480 内容