jaspersoft studio6.x 设计医院检查报告单样式

Posted 在奋斗的大道

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jaspersoft studio6.x 设计医院检查报告单样式相关的知识,希望对你有一定的参考价值。

今天百度无意检索到医院的检查报告单,我想尝试一下自己对jaspersoft studio6.x 报表工具的掌握情况,我简单编写了一个血液检查单。效果展示如下:

百度图片库关于血液检查报告单样式:

 jaspersoft studio 设计截图:

 源码XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.10.0.final using JasperReports Library version 6.10.0-unknown  -->
<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="Blank_A4_1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d873c02a-03b0-4f0c-9c40-b5ee38fcfbe0">
	<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
	<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mysql8"/>
	<subDataset name="Dataset1" uuid="a24663b4-bea2-47cf-baf2-9e81ef0ec2fb">
		<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
		<property name="com.jaspersoft.studio.data.defaultdataadapter" value="MySQL8"/>
		<queryString language="SQL">
			<![CDATA[select * from  act.check_item ]]>
		</queryString>
		<field name="check_item" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="check_item"/>
			<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
		</field>
		<field name="check_result" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="check_result"/>
			<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
		</field>
		<field name="check_range" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="check_range"/>
			<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
		</field>
		<field name="check_unit" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="check_unit"/>
			<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
		</field>
	</subDataset>
	<queryString>
		<![CDATA[select * from  act.check_item ]]>
	</queryString>
	<field name="sid" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.label" value="sid"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
	</field>
	<field name="user_sid" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.label" value="user_sid"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
	</field>
	<field name="check_item" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.label" value="check_item"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
	</field>
	<field name="check_result" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.label" value="check_result"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
	</field>
	<field name="check_range" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.label" value="check_range"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
	</field>
	<field name="check_unit" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.label" value="check_unit"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="check_item"/>
	</field>
	<title>
		<band height="61" splitType="Stretch">
			<staticText>
				<reportElement x="211" y="0" width="133" height="30" uuid="027ae962-d3b4-4e4f-8974-72956a8bd8fe"/>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<text><![CDATA[深圳盐田人民医院报告单]]></text>
			</staticText>
			<staticText>
				<reportElement x="370" y="41" width="40" height="20" uuid="0eb5b2f3-6206-4de0-bd54-e1d98f651618">
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<text><![CDATA[样本号:]]></text>
			</staticText>
			<textField>
				<reportElement x="410" y="41" width="100" height="20" uuid="61aceaec-7514-4835-a271-9e3ebd93a247">
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["202111290051"]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<columnHeader>
		<band height="90" splitType="Prevent">
			<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
			<property name="com.jaspersoft.studio.layout"/>
			<staticText>
				<reportElement x="0" y="0" width="100" height="30" uuid="5d07f030-8aa4-46a2-9dfd-02a2cf92be90"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[姓名:]]></text>
			</staticText>
			<textField>
				<reportElement x="100" y="0" width="85" height="30" uuid="472a9387-a92c-484d-a298-9a71e7ab387a"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["周志刚"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="185" y="0" width="100" height="30" uuid="26d1b35f-2750-4d9a-a119-3f73b2bfbe54"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[性别:]]></text>
			</staticText>
			<textField>
				<reportElement x="285" y="0" width="85" height="30" uuid="a5980e64-056c-4c35-9ae5-a1f59f8058b3"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["男"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="370" y="0" width="100" height="30" uuid="92f0a3e8-89da-4a73-b8eb-746cad41b1e3"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[年龄:]]></text>
			</staticText>
			<textField>
				<reportElement x="470" y="0" width="85" height="30" uuid="978f53e3-487c-4d11-860a-ef88f5883fe2"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["30"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="470" y="30" width="85" height="30" uuid="75784a0b-70fe-48e6-926b-34f260b35586"/>
				<box>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["血液"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="370" y="30" width="100" height="30" uuid="6b424858-5d03-4287-ad4d-b0a70ae6ba08"/>
				<box>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[样本内型:]]></text>
			</staticText>
			<staticText>
				<reportElement x="185" y="30" width="100" height="30" uuid="a03c6d88-4b27-469b-8dac-f3bd09f43829"/>
				<box>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[科室:]]></text>
			</staticText>
			<textField>
				<reportElement x="285" y="30" width="85" height="30" uuid="584c97ee-4cf7-4142-993f-51bd52ca0be4"/>
				<box>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["内科"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="0" y="30" width="100" height="30" uuid="2eb40ad7-3f34-4112-b75b-4830866c56d4"/>
				<box>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[门诊号:]]></text>
			</staticText>
			<textField>
				<reportElement x="100" y="30" width="85" height="30" uuid="3722ddb9-0843-44f9-8dd9-9574950ea66e"/>
				<box>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["SZ202111290001"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="0" y="60" width="138" height="30" uuid="836cfc42-6fac-411e-b3ff-2a110a54111a">
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
					<property name="com.jaspersoft.studio.unit.width" value="px"/>
				</reportElement>
				<box>
					<topPen lineWidth="1.0"/>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<text><![CDATA[检查项目]]></text>
			</staticText>
			<staticText>
				<reportElement x="138" y="60" width="138" height="30" uuid="d1c8fb71-b366-40c0-b564-6b91ee0e20dd">
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
					<property name="com.jaspersoft.studio.unit.width" value="px"/>
				</reportElement>
				<box>
					<topPen lineWidth="1.0"/>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<text><![CDATA[结果]]></text>
			</staticText>
			<staticText>
				<reportElement x="276" y="60" width="138" height="30" uuid="d2a33b24-ad5a-486c-a00d-eae13a1a97a1">
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
					<property name="com.jaspersoft.studio.unit.width" value="px"/>
				</reportElement>
				<box>
					<topPen lineWidth="1.0"/>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<text><![CDATA[参考范围]]></text>
			</staticText>
			<staticText>
				<reportElement x="414" y="60" width="141" height="30" uuid="6525e71a-7d5b-41d2-9ae9-5cfc23b995a5">
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
					<property name="com.jaspersoft.studio.unit.width" value="px"/>
				</reportElement>
				<box>
					<topPen lineWidth="1.0"/>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<text><![CDATA[结果值]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="15" splitType="Stretch">
			<textField>
				<reportElement x="0" y="0" width="138" height="15" uuid="2db2a96a-a7f6-4657-8370-706ed6114812">
					<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="631c1d68-337e-4a96-8979-a069b7ba91cc"/>
					<property name="com.jaspersoft.studio.unit.width" value="px"/>
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
					<property name="com.jaspersoft.studio.unit.tabStopWidth" value="px"/>
				</reportElement>
				<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<paragraph tabStopWidth="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$Fcheck_item]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="138" y="0" width="138" height="15" uuid="28faaa67-096f-4263-a92a-39760774242f">
					<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="31a8e334-3ee0-4856-ac2f-c2d2c15e3356"/>
					<property name="com.jaspersoft.studio.unit.width" value="px"/>
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA[$Fcheck_result]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="276" y="0" width="138" height="15" uuid="4bf3bf76-8075-4aaa-82e0-4050e345124b">
					<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="71a6b89f-b43e-4b2c-982c-5b9ee7a9509a"/>
					<property name="com.jaspersoft.studio.unit.width" value="px"/>
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA[$Fcheck_range]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="414" y="0" width="138" height="15" uuid="d4609d60-572e-4782-9688-9869ff33aa13">
					<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="8e6a6ea5-f932-4faf-b96a-6c005172b0e8"/>
					<property name="com.jaspersoft.studio.unit.width" value="px"/>
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA[$Fcheck_unit]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band height="70">
			<staticText>
				<reportElement x="0" y="0" width="100" height="30" uuid="a2b9bbae-e06e-4c5a-b95b-5cc404ab38a1"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[签收时间:]]></text>
			</staticText>
			<textField>
				<reportElement x="100" y="0" width="85" height="30" uuid="ea4e35b9-f0c8-499c-bceb-3870be2ca90e"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["2021-11-29"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="185" y="0" width="100" height="30" uuid="184a4a3c-affe-4752-b191-5a72aaf73956"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[检验时间:]]></text>
			</staticText>
			<textField>
				<reportElement x="285" y="0" width="85" height="30" uuid="292cfd9e-06db-4e2d-81d2-04e929aca3db"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["2021-11-29"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="370" y="0" width="100" height="30" uuid="86665197-360e-4cd6-b643-20dbcf66c458"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[报告时间:]]></text>
			</staticText>
			<textField>
				<reportElement x="470" y="0" width="85" height="30" uuid="72fdbf1c-df14-4813-9b18-81998820a6a8"/>
				<box>
					<topPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["2021-11-29"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="0" y="30" width="100" height="30" uuid="3ca96f25-9be5-4c8c-8645-1d9bd1565663"/>
				<box>
					<topPen lineWidth="1.0" lineColor="#FFFFFF"/>
					<bottomPen lineWidth="1.0" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[申请医生:]]></text>
			</staticText>
			<textField>
				<reportElement x="100" y="30" width="85" height="30" uuid="c8fc2910-f2b4-491e-b898-77cc54032161"/>
				<box>
					<topPen lineWidth="1.0" lineColor="#FFFFFF"/>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["周志刚"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="185" y="30" width="100" height="30" uuid="06fcd75c-82b3-41e2-9dc2-985077f559ac"/>
				<box>
					<topPen lineWidth="1.0" lineColor="#FFFFFF"/>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[检验医生:]]></text>
			</staticText>
			<textField>
				<reportElement x="285" y="30" width="85" height="30" uuid="195d25a4-a5fe-493f-a55a-3fdd75dc1b2d"/>
				<box>
					<topPen lineWidth="1.0" lineColor="#FFFFFF"/>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["周志刚"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="370" y="30" width="100" height="30" uuid="9d3799c2-7f99-4a22-815f-3cc0b4c7d6d4"/>
				<box>
					<topPen lineWidth="1.0" lineColor="#FFFFFF"/>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<text><![CDATA[审核医生:]]></text>
			</staticText>
			<textField>
				<reportElement x="467" y="30" width="85" height="30" uuid="875b835a-b066-4c92-80bf-0b8024b2aff3"/>
				<box>
					<topPen lineWidth="1.0" lineColor="#FFFFFF"/>
					<bottomPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["周志刚"]]></textFieldExpression>
			</textField>
		</band>
	</columnFooter>
</jasperReport>

涉及SQL 表和语句:

DROP TABLE IF EXISTS `check_item`;
CREATE TABLE `check_item`  (
  `sid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
  `user_sid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Sid',
  `check_item` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检查项目',
  `check_result` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检查结果',
  `check_range` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参考值范围',
  `check_unit` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检查单位',
  PRIMARY KEY (`sid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of check_item
-- ----------------------------
INSERT INTO `check_item` VALUES ('1', '1', '白细胞数目', '11.33', '4.00-10.00', '10^9/L');
INSERT INTO `check_item` VALUES ('2', '1', '中粒细胞百分比', '82.3', '50.0-70.0', '%');
INSERT INTO `check_item` VALUES ('3', '1', '淋巴细胞百分比', '12.3', '20.0-40.0', '%');
INSERT INTO `check_item` VALUES ('4', '1', '单核细胞百分比', '4.2', '3.0-8.0', '%');
INSERT INTO `check_item` VALUES ('5', '1', '嗜酸性粒细胞百分比', '1.1', '0.5-5.0', '%');
INSERT INTO `check_item` VALUES ('6', '1', '中性细胞数目', '9.33', '2.0-7.0', '10^9/L');

*.jasper 和*.jrxml 源文件

链接:https://pan.baidu.com/s/1fVckSBsd4XVGq1P3PXOclg 
提取码:1234 
--来自百度网盘超级会员V5的分享

以上是关于jaspersoft studio6.x 设计医院检查报告单样式的主要内容,如果未能解决你的问题,请参考以下文章

说说如何使用 Jaspersoft Studio 设计你的第一张报表

谁会用Jaspersoft Studio

Jaspersoft Studio(报表设计器)中文乱码问题的解决方法

Jaspersoft studio工具(报表生成工具)之 设置PDF 的开发

如何利用Jaspersoft iReport Designer创建表格

医院综合布线系统设计分几个阶段?