Jasperreports+jaspersoft studio学习教程(七)- 子报表Subreport(父子报表互相传值)

本文主要是介绍Jasperreports+jaspersoft studio学习教程(七)- 子报表Subreport(父子报表互相传值),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

 转载:https://blog.csdn.net/shiyun123zw/article/details/79221708

有很多人都说Jasperreports不适合中国式复杂报表,实际上运用好父子报表可以解决大部分问题了。例如下面的表。每个学生的学科数目不固定,且每个学生后有相当于小计的平均分。有点复杂度的报表,可以使用子报表解决。

8.1 设计报表模板

8.1.1 新建主模板DemoReport6_main.jrxml,创建Paramters :title(java.lang.String)、date(java.lang.String)、SUBREPORT_DIR(java.lang.String),创建Fields :stuNo(java.lang.Integer)、

stuName(java.lang.String)、subjectList(java.util.List)

 

8.1.2 设计模板表头如下,注意宽度:

8.1.3 新建子模板DemoReport6_sub.jrxml,只保留DetailBand(Height设置为20),并设置模板的宽500,高20,且四周Margin都为0

8.1.4 转到DemoReport6_main主模板,将Subreport组件拖入到Detail中,跳出Subreport界面

8.1.5 将stuNo和stuName拖入到Detail中

8.1.6 转到DemoReport6_sub子模板,新建Fields:subjectName(String)、teacherName(String)、score(java.lang.Double).拖入到Detail中,注意宽度和主模板保持一致

8.1.7 新建Variables,命名为averageScore

8.1.8 转回DemoReport6_mian主模块,新建Variables,命名为getAverageScore

拖入到Detail Band中,设置好字体样式

点击 $V{getAverageScore} 显示Properties,设置Appearance中Position Type选中为Fix Relation To Bottom(同样将“平均分”如此设置)

设置TextField的Evaluation Time 选中为Band

8.1.9 将Subreport、$F{stuNo}、$F{stuName}放进一个Element Group里,直接在source中添加(未找到图形化操作)

<detail>

       ...

           <elementGroup>

              <subreport>

                  ...

              </subreport>

              <textField>

                  ... <textFieldExpression><![CDATA[$F{stuNo}]]></textFieldExpression>

              </textField>

              <textField>

                  ...

                  <textFieldExpression><![CDATA[$F{stuName}]]></textFieldExpression>

              </textField>

           </elementGroup>

       ...

    </detail>

保存后:

8.1.10 点击 $F{stuNo} 显示Properties,设置Position Type 为Float,Stretch Type为 ElementGroupHeight,把stuNo和Subreport也如此设置。

8.1.11 点击Subreport 显示Properties,在Subreport中设置Exception为$P{SUBREPORT_DIR}+"DemoReport6_sub.jasper",Data Source Expression为

newnet.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{subjectList})

点击 Edit Return Values

保存主模板,子模板,放到项目中的jrxml中。

8.2 编写Servlet注入数据源

8.2.1 新建 Student类和Subject类

8.2.2 新建JasperServlet6,doGet内容如下:

8.3 启动tomcat,访问servlet,查看html文件

代码如下:

DemoReport6_main.jrxml

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.0.final using JasperReports Library version 6.4.1  -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="DemoReport6_main" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="0" bottomMargin="0" uuid="4d779d07-059d-4881-9a0c-d6c44c0cdb91"><property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/><property name="com.jaspersoft.studio.unit." value="pixel"/><property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/><property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/><property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/><property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/><property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/><property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/><property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/><property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/><parameter name="title" class="java.lang.String"><parameterDescription><![CDATA[]]></parameterDescription></parameter><parameter name="date" class="java.lang.String"><parameterDescription><![CDATA[]]></parameterDescription></parameter><parameter name="SUBREPORT_DIR" class="java.lang.String"/><queryString><![CDATA[]]></queryString><field name="stuNo" class="java.lang.Integer"/><field name="stuName" class="java.lang.String"/><field name="subjectList" class="java.util.List"/><variable name="getAverageScore" class="java.lang.Double" incrementType="Report"/><title><band height="60" splitType="Stretch"><property name="com.jaspersoft.studio.unit.height" value="pixel"/><textField><reportElement x="0" y="10" width="800" height="40" uuid="a8f8ea70-0699-4184-8528-a1a49a6e6544"><property name="com.jaspersoft.studio.unit.width" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="pixel"/></reportElement><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑" size="22"/></textElement><textFieldExpression><![CDATA[$P{title}]]></textFieldExpression></textField></band></title><pageHeader><band height="30" splitType="Stretch"><property name="com.jaspersoft.studio.unit.height" value="pixel"/><textField><reportElement x="500" y="0" width="300" height="30" uuid="976f9ea4-db44-4dd1-a3a1-e65d1d238a58"/><textElement textAlignment="Right" verticalAlignment="Middle"><font fontName="微软雅黑"/></textElement><textFieldExpression><![CDATA["日期:"+$P{date}]]></textFieldExpression></textField></band></pageHeader><columnHeader><band height="30"><property name="com.jaspersoft.studio.unit.height" value="pixel"/><textField><reportElement x="0" y="0" width="150" height="30" uuid="18eaa77b-a385-4568-af04-d5300f6153b4"><property name="com.jaspersoft.studio.unit.y" value="pixel"/><property name="com.jaspersoft.studio.unit.width" value="pixel"/></reportElement><box><topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑" size="16" isBold="true"/></textElement><textFieldExpression><![CDATA["学号"]]></textFieldExpression></textField><textField><reportElement x="150" y="0" width="150" height="30" uuid="edcbb21e-5fc3-4f21-ba73-728918007f8c"><property name="com.jaspersoft.studio.unit.y" value="pixel"/><property name="com.jaspersoft.studio.unit.x" value="pixel"/><property name="com.jaspersoft.studio.unit.width" value="pixel"/></reportElement><box><topPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑" size="16" isBold="true"/></textElement><textFieldExpression><![CDATA["姓名"]]></textFieldExpression></textField><textField><reportElement x="300" y="0" width="200" height="30" uuid="5ddbb580-fdbe-4dd8-9ac7-1f3170127467"><property name="com.jaspersoft.studio.unit.x" value="pixel"/><property name="com.jaspersoft.studio.unit.width" value="pixel"/></reportElement><box><topPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑" size="16" isBold="true"/></textElement><textFieldExpression><![CDATA["学科"]]></textFieldExpression></textField><textField><reportElement x="700" y="0" width="100" height="30" uuid="02f12719-113d-49ee-912e-26b3aff68f30"/><box><topPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑" size="16"/></textElement><textFieldExpression><![CDATA["分数"]]></textFieldExpression></textField><textField><reportElement x="500" y="0" width="200" height="30" uuid="ba3bd18e-3b52-4dd6-b8d5-fb08c89338d9"><property name="com.jaspersoft.studio.unit.x" value="pixel"/><property name="com.jaspersoft.studio.unit.width" value="pixel"/></reportElement><box><topPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑" size="16"/></textElement><textFieldExpression><![CDATA["任课老师"]]></textFieldExpression></textField></band></columnHeader><detail><band height="40" splitType="Stretch"><property name="com.jaspersoft.studio.unit.height" value="pixel"/><elementGroup><subreport><reportElement positionType="Float" stretchType="ElementGroupHeight" x="300" y="0" width="500" height="20" uuid="8df8a2e2-cfda-40f4-9343-a873f2cde5cc"><property name="com.jaspersoft.studio.unit.x" value="pixel"/><property name="com.jaspersoft.studio.unit.width" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="pixel"/></reportElement><dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{subjectList})]]></dataSourceExpression><returnValue subreportVariable="averageScore" toVariable="getAverageScore"/><subreportExpression><![CDATA[$P{SUBREPORT_DIR}+"DemoReport6_sub.jasper"]]></subreportExpression></subreport><textField><reportElement positionType="Float" stretchType="ElementGroupHeight" x="0" y="0" width="150" height="20" uuid="5629043a-e904-4e34-8a1c-9660dac1bd8a"><property name="com.jaspersoft.studio.unit.x" value="pixel"/><property name="com.jaspersoft.studio.unit.y" value="pixel"/><property name="com.jaspersoft.studio.unit.width" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="pixel"/></reportElement><box><topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/><leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑"/></textElement><textFieldExpression><![CDATA[$F{stuNo}]]></textFieldExpression></textField><textField><reportElement positionType="Float" stretchType="ElementGroupHeight" x="150" y="0" width="150" height="20" uuid="72721815-8bea-4fb8-ac90-931449976faf"><property name="com.jaspersoft.studio.unit.x" value="pixel"/><property name="com.jaspersoft.studio.unit.y" value="pixel"/><property name="com.jaspersoft.studio.unit.width" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="pixel"/></reportElement><box><topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/><bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑"/></textElement><textFieldExpression><![CDATA[$F{stuName}]]></textFieldExpression></textField></elementGroup><textField><reportElement positionType="FixRelativeToBottom" x="0" y="20" width="700" height="20" uuid="0dfb2d9d-d9cf-4e45-b854-3aa76e841231"><property name="com.jaspersoft.studio.unit.x" value="pixel"/><property name="com.jaspersoft.studio.unit.y" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="pixel"/></reportElement><box><topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/><rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑" isBold="true"/></textElement><textFieldExpression><![CDATA["平均分"]]></textFieldExpression></textField><textField evaluationTime="Band"><reportElement positionType="FixRelativeToBottom" x="700" y="20" width="100" height="20" uuid="17c98f34-8b86-4047-8a12-e7d03b5153de"><property name="com.jaspersoft.studio.unit.x" value="pixel"/><property name="com.jaspersoft.studio.unit.y" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="pixel"/></reportElement><box><topPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑"/></textElement><textFieldExpression><![CDATA[$V{getAverageScore}]]></textFieldExpression></textField></band></detail><pageFooter><band height="30" splitType="Stretch"><textField><reportElement x="680" y="5" width="100" height="20" uuid="8b559f20-e4a7-4b90-b46a-ac1575514392"><property name="com.jaspersoft.studio.unit.height" value="pixel"/><property name="com.jaspersoft.studio.unit.y" value="pixel"/></reportElement><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑"/></textElement><textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression></textField></band></pageFooter>
</jasperReport>

DemoReport6_sub.jrxml

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.0.final using JasperReports Library version 6.4.1  -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="DemoReport6_sub" pageWidth="500" pageHeight="20" orientation="Landscape" columnWidth="500" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="9761aedd-513e-48ff-8cb6-60f038ffbaab"><property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/><property name="com.jaspersoft.studio.unit." value="pixel"/><queryString><![CDATA[]]></queryString><field name="subjectName" class="java.lang.String"/><field name="teacherName" class="java.lang.String"/><field name="score" class="java.lang.Double"/><variable name="averageScore" class="java.lang.Double" calculation="Average"><variableExpression><![CDATA[$F{score}]]></variableExpression></variable><detail><band height="20" splitType="Stretch"><property name="com.jaspersoft.studio.unit.height" value="pixel"/><textField><reportElement x="0" y="0" width="200" height="20" uuid="4715047e-672e-4b21-81d5-1b7f433938e7"><property name="com.jaspersoft.studio.unit.x" value="pixel"/></reportElement><box><topPen lineWidth="1.0"/><leftPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑"/></textElement><textFieldExpression><![CDATA[$F{subjectName}]]></textFieldExpression></textField><textField><reportElement x="200" y="0" width="200" height="20" uuid="7bf63b11-eb47-460a-978a-395b33fb480d"/><box><topPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑"/></textElement><textFieldExpression><![CDATA[$F{teacherName}]]></textFieldExpression></textField><textField><reportElement x="400" y="0" width="100" height="20" uuid="c603aad8-9ba2-4994-90c3-86e37cb46f33"><property name="com.jaspersoft.studio.unit.x" value="pixel"/></reportElement><box><topPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle"><font fontName="微软雅黑"/></textElement><textFieldExpression><![CDATA[$F{score}]]></textFieldExpression></textField></band></detail>
</jasperReport>

Student.java

package com.jasper.bean;import java.util.ArrayList;
import java.util.List;public class Student {private Integer stuNo;private String stuName;private List<Subject> subjectList = new ArrayList<Subject>();public Integer getStuNo() {return stuNo;}public void setStuNo(Integer stuNo) {this.stuNo = stuNo;}public String getStuName() {return stuName;}public void setStuName(String stuName) {this.stuName = stuName;}public List<Subject> getSubjectList() {return subjectList;}public void setSubjectList(List<Subject> subjectList) {this.subjectList = subjectList;}}

Subject.java

package com.jasper.bean;public class Subject {private String subjectName;private String teacherName;private Double score;public String getSubjectName() {return subjectName;}public void setSubjectName(String subjectName) {this.subjectName = subjectName;}public String getTeacherName() {return teacherName;}public void setTeacherName(String teacherName) {this.teacherName = teacherName;}public Double getScore() {return score;}public void setScore(Double score) {this.score = score;}public Subject(String subjectName, String teacherName, Double score) {super();this.subjectName = subjectName;this.teacherName = teacherName;this.score = score;}public Subject() {super();}}

JasperServlet6.java

package com.jasper.web;import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;import com.jasper.bean.Student;
import com.jasper.bean.Subject;@WebServlet("/JasperServlet6")
public class JasperServlet6 extends HttpServlet {private static final long serialVersionUID = 1L;public JasperServlet6() {super();}protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {Map<String,Object> parameters = new HashMap<String,Object>(16);//组装list数据源Subject sub1 = new Subject("语文","张老师",80.0);Subject sub2 = new Subject("数学","王老师",90.0);Subject sub3 = new Subject("物理","孙老师",46.0);Subject sub4 = new Subject("政治","李老师",50.0);List<Student> list = new ArrayList<Student>();Student stu1 = new Student();stu1.setStuNo(101);stu1.setStuName("小明");List<Subject> sublist1 = new ArrayList<Subject>();sublist1.add(sub1);sublist1.add(sub2);stu1.setSubjectList(sublist1);Student stu2 = new Student();stu2.setStuNo(102);stu2.setStuName("小雨");List<Subject> sublist2 = new ArrayList<Subject>();sublist2.add(sub2);sublist2.add(sub3);sublist2.add(sub4);stu2.setSubjectList(sublist2);Student stu3 = new Student();stu3.setStuNo(103);stu3.setStuName("小东");List<Subject> sublist3 = new ArrayList<Subject>();sublist3.add(sub4);sublist3.add(sub3);stu3.setSubjectList(sublist3);list.add(stu1);list.add(stu2);list.add(stu3);String mainjrxmlPath = request.getServletContext().getRealPath("/")+"/jrxml/DemoReport6_main.jrxml";String subjrxmlPath = request.getServletContext().getRealPath("/")+"/jrxml/DemoReport6_sub.jrxml";//由jrxml文件编译后生产jasper文件的路径String mainjasperPath = request.getServletContext().getRealPath("/")+"/jasper/DemoReport6_main.jasper";String subjasperPath = request.getServletContext().getRealPath("/")+"/jasper/DemoReport6_sub.jasper";try {//编译jrxml生产jasper文件JasperCompileManager.compileReportToFile(mainjrxmlPath, mainjasperPath);JasperCompileManager.compileReportToFile(subjrxmlPath, subjasperPath);parameters.put("title", "学生成绩表");parameters.put("date", new SimpleDateFormat("yyyy-MM-dd").format(new Date()));String SUBREPORT_DIR = request.getServletContext().getRealPath("/")+"/jasper/";parameters.put("SUBREPORT_DIR",SUBREPORT_DIR);JasperPrint jasperPrint = JasperFillManager.fillReport(mainjasperPath, parameters, new JRBeanCollectionDataSource(list));//生成html文件(位置:D:/student.html)JasperExportManager.exportReportToHtmlFile(jasperPrint, "D:/student.html");} catch (JRException e) {e.printStackTrace();}}protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {doGet(request, response);}}

 

这篇关于Jasperreports+jaspersoft studio学习教程(七)- 子报表Subreport(父子报表互相传值)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1146935

相关文章

全网最全Tomcat完全卸载重装教程小结

《全网最全Tomcat完全卸载重装教程小结》windows系统卸载Tomcat重新通过ZIP方式安装Tomcat,优点是灵活可控,适合开发者自定义配置,手动配置环境变量后,可通过命令行快速启动和管理... 目录一、完全卸载Tomcat1. 停止Tomcat服务2. 通过控制面板卸载3. 手动删除残留文件4.

Python的pandas库基础知识超详细教程

《Python的pandas库基础知识超详细教程》Pandas是Python数据处理核心库,提供Series和DataFrame结构,支持CSV/Excel/SQL等数据源导入及清洗、合并、统计等功能... 目录一、配置环境二、序列和数据表2.1 初始化2.2  获取数值2.3 获取索引2.4 索引取内容2

python依赖管理工具UV的安装和使用教程

《python依赖管理工具UV的安装和使用教程》UV是一个用Rust编写的Python包安装和依赖管理工具,比传统工具(如pip)有着更快、更高效的体验,:本文主要介绍python依赖管理工具UV... 目录前言一、命令安装uv二、手动编译安装2.1在archlinux安装uv的依赖工具2.2从github

C#实现SHP文件读取与地图显示的完整教程

《C#实现SHP文件读取与地图显示的完整教程》在地理信息系统(GIS)开发中,SHP文件是一种常见的矢量数据格式,本文将详细介绍如何使用C#读取SHP文件并实现地图显示功能,包括坐标转换、图形渲染、平... 目录概述功能特点核心代码解析1. 文件读取与初始化2. 坐标转换3. 图形绘制4. 地图交互功能缩放

SpringBoot集成redisson实现延时队列教程

《SpringBoot集成redisson实现延时队列教程》文章介绍了使用Redisson实现延迟队列的完整步骤,包括依赖导入、Redis配置、工具类封装、业务枚举定义、执行器实现、Bean创建、消费... 目录1、先给项目导入Redisson依赖2、配置redis3、创建 RedissonConfig 配

基于C#实现PDF转图片的详细教程

《基于C#实现PDF转图片的详细教程》在数字化办公场景中,PDF文件的可视化处理需求日益增长,本文将围绕Spire.PDFfor.NET这一工具,详解如何通过C#将PDF转换为JPG、PNG等主流图片... 目录引言一、组件部署二、快速入门:PDF 转图片的核心 C# 代码三、分辨率设置 - 清晰度的决定因

Java Scanner类解析与实战教程

《JavaScanner类解析与实战教程》JavaScanner类(java.util包)是文本输入解析工具,支持基本类型和字符串读取,基于Readable接口与正则分隔符实现,适用于控制台、文件输... 目录一、核心设计与工作原理1.底层依赖2.解析机制A.核心逻辑基于分隔符(delimiter)和模式匹

Unity新手入门学习殿堂级知识详细讲解(图文)

《Unity新手入门学习殿堂级知识详细讲解(图文)》Unity是一款跨平台游戏引擎,支持2D/3D及VR/AR开发,核心功能模块包括图形、音频、物理等,通过可视化编辑器与脚本扩展实现开发,项目结构含A... 目录入门概述什么是 UnityUnity引擎基础认知编辑器核心操作Unity 编辑器项目模式分类工程

spring AMQP代码生成rabbitmq的exchange and queue教程

《springAMQP代码生成rabbitmq的exchangeandqueue教程》使用SpringAMQP代码直接创建RabbitMQexchange和queue,并确保绑定关系自动成立,简... 目录spring AMQP代码生成rabbitmq的exchange and 编程queue执行结果总结s

Python学习笔记之getattr和hasattr用法示例详解

《Python学习笔记之getattr和hasattr用法示例详解》在Python中,hasattr()、getattr()和setattr()是一组内置函数,用于对对象的属性进行操作和查询,这篇文章... 目录1.getattr用法详解1.1 基本作用1.2 示例1.3 原理2.hasattr用法详解2.