本文整理汇总了Java中net.sf.jasperreports.engine.xml.JRXmlWriter类的典型用法代码示例。如果您正苦于以下问题:Java JRXmlWriter类的具体用法?Java JRXmlWriter怎么用?Java JRXmlWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JRXmlWriter类属于net.sf.jasperreports.engine.xml包,在下文中一共展示了JRXmlWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: writeTextInputComponent
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
protected void writeTextInputComponent(TextInputComponent textInputComponent, ComponentKey componentKey,
JRXmlWriter reportWriter) throws IOException {
JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper();
String namespaceURI = componentKey.getNamespace();
String schemaLocation =
ComponentsEnvironment.getInstance(jasperReportsContext)
.getBundle(namespaceURI).getXmlParser().getPublicSchemaLocation();
XmlNamespace componentNamespace = new XmlNamespace(namespaceURI, componentKey.getNamespacePrefix(),
schemaLocation);
writer.startElement("textInput", componentNamespace);
writer.addAttribute("multiLine", textInputComponent.isMultiLine());
reportWriter.writeTextField(textInputComponent.getTextField());
writer.closeElement();
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:TextInputComponentXmlWriter.java
示例2: getVersion
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
/**
*
*/
public static String getVersion(JasperReportsContext jasperReportsContext, JRPart part, JRXmlWriter reportWriter)
{
String version = null;
ComponentKey componentKey = part.getComponentKey();
String versionProperty = PROPERTY_PART_COMPONENTS_PREFIX + componentKey.getName() + AbstractComponentXmlWriter.PROPERTY_COMPONENTS_VERSION_SUFFIX;
if (part.getPropertiesMap().containsProperty(versionProperty))
{
version = part.getPropertiesMap().getProperty(versionProperty);
}
else
{
JRReport report = reportWriter.getReport();
version = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(report, versionProperty);
if (version == null)
{
version = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(report, JRXmlBaseWriter.PROPERTY_REPORT_VERSION);
}
}
return version;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:28,代码来源:AbstractPartComponentXmlWriter.java
示例3: writeItemDataContent
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
private void writeItemDataContent(String name, ItemData itemData, JRXmlWriteHelper writer, JRXmlWriter reportWriter, XmlNamespace namespace, JRComponentElement componentElement) throws IOException
{
writer.startElement(name, namespace);
JRElementDataset dataset = itemData.getDataset();
if (dataset != null)
{
reportWriter.writeElementDataset(dataset, false);
}
/* */
List<Item> itemList = itemData.getItems();
if (itemList != null && !itemList.isEmpty())
{
for(Item item : itemList)
{
if(item.getProperties() != null && !item.getProperties().isEmpty())
{
writeItem(item, writer, reportWriter, namespace, componentElement);
}
}
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:ComponentsXmlWriter.java
示例4: writeMarker
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
/**
* @deprecated To be removed.
*/
private void writeMarker(
net.sf.jasperreports.components.map.Marker marker,
JRXmlWriteHelper writer,
JRXmlWriter reportWriter,
XmlNamespace namespace,
JRComponentElement componentElement
) throws IOException
{
writer.startElement(MapXmlFactory.ELEMENT_marker, namespace);
List<net.sf.jasperreports.components.map.MarkerProperty> markerProperties = marker.getProperties();
for(net.sf.jasperreports.components.map.MarkerProperty property : markerProperties)
{
writeMarkerProperty(property, writer, reportWriter, namespace, componentElement);
}
writer.closeElement();
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:ComponentsXmlWriter.java
示例5: writeMarkerProperty
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
/**
* @deprecated To be removed.
*/
private void writeMarkerProperty(
net.sf.jasperreports.components.map.MarkerProperty markerProperty,
JRXmlWriteHelper writer,
JRXmlWriter reportWriter,
XmlNamespace namespace,
JRComponentElement componentElement
) throws IOException
{
writer.startElement(MapXmlFactory.ELEMENT_markerProperty, namespace);
writer.addAttribute(JRXmlConstants.ATTRIBUTE_name, markerProperty.getName());
if(markerProperty.getValue() != null)
{
writer.addAttribute(JRXmlConstants.ATTRIBUTE_value, markerProperty.getValue());
}
writeExpression(JRXmlConstants.ELEMENT_valueExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, markerProperty.getValueExpression(), false, componentElement, reportWriter);
writer.closeElement();
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:ComponentsXmlWriter.java
示例6: writeTableCell
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
protected void writeTableCell(JRComponentElement componentElement, Cell cell, String name,
JRXmlWriter reportWriter) throws IOException
{
if (cell != null)
{
JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper();
writer.startElement(name);
reportWriter.writeStyleReferenceAttr(cell);
writer.addAttribute("height", cell.getHeight());
writer.addAttribute("rowSpan", cell.getRowSpan());
if (isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_8_0))
{
reportWriter.writeProperties(cell);
}
reportWriter.writeBox(cell.getLineBox(), JRXmlWriter.JASPERREPORTS_NAMESPACE);
reportWriter.writeChildElements(cell);
writer.closeElement();//cell
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:ComponentsXmlWriter.java
示例7: writeSpiderDataSet
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
private void writeSpiderDataSet(SpiderDataset dataset, JRXmlWriteHelper writer, JRXmlWriter reportWriter, XmlNamespace namespace) throws IOException
{
writer.startElement(ELEMENT_spiderDataset, namespace);
reportWriter.writeElementDataset(dataset);
/* */
JRCategorySeries[] categorySeries = dataset.getSeries();
if (categorySeries != null && categorySeries.length > 0)
{
for(int i = 0; i < categorySeries.length; i++)
{
writeCategorySeries(categorySeries[i], writer, reportWriter);
}
}
writer.closeElement();
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:SpiderChartXmlWriter.java
示例8: writeFont
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
private void writeFont(JRFont font, JRXmlWriteHelper writer) throws IOException
{
if (font != null)
{
writer.startElement(JRXmlConstants.ELEMENT_font, JRXmlWriter.JASPERREPORTS_NAMESPACE);
writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_fontName, font.getOwnFontName());
writer.addAttribute(JRXmlConstants.ATTRIBUTE_size, font.getOwnFontsize());
writer.addAttribute(JRXmlConstants.ATTRIBUTE_isBold, font.isOwnBold());
writer.addAttribute(JRXmlConstants.ATTRIBUTE_isItalic, font.isOwnItalic());
writer.addAttribute(JRXmlConstants.ATTRIBUTE_isUnderline, font.isOwnUnderline());
writer.addAttribute(JRXmlConstants.ATTRIBUTE_isStrikeThrough, font.isOwnStrikeThrough());
writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_pdfFontName, font.getOwnPdfFontName());
writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_pdfEncoding, font.getOwnPdfEncoding());
writer.addAttribute(JRXmlConstants.ATTRIBUTE_isPdfEmbedded, font.isOwnPdfEmbedded());
writer.closeElement(true);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:SpiderChartXmlWriter.java
示例9: getVersion
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
/**
*
*/
public static String getVersion(JasperReportsContext jasperReportsContext, JRComponentElement componentElement, JRXmlWriter reportWriter)
{
String version = null;
ComponentKey componentKey = componentElement.getComponentKey();
String versionProperty = PROPERTY_COMPONENTS_PREFIX + componentKey.getName() + PROPERTY_COMPONENTS_VERSION_SUFFIX;
if (componentElement.getPropertiesMap().containsProperty(versionProperty))
{
version = componentElement.getPropertiesMap().getProperty(versionProperty);
}
else
{
JRReport report = reportWriter.getReport();
version = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(report, versionProperty);
if (version == null)
{
version = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(report, JRXmlBaseWriter.PROPERTY_REPORT_VERSION);
}
}
return version;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:28,代码来源:AbstractComponentXmlWriter.java
示例10: addExpressionRules
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
protected <T> void addExpressionRules(Digester digester, String expressionPattern,
Class<T> factoryClass, String setterMethod, boolean jrNamespace)
{
String originalNamespace = digester.getRuleNamespaceURI();
if (jrNamespace)
{
digester.setRuleNamespaceURI(JRXmlWriter.JASPERREPORTS_NAMESPACE.getNamespaceURI());
}
digester.addFactoryCreate(expressionPattern, factoryClass);
digester.addCallMethod(expressionPattern, "setText", 0);
digester.addSetNext(expressionPattern, setterMethod,
JRExpression.class.getName());
if (jrNamespace)
{
digester.setRuleNamespaceURI(originalNamespace);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:ComponentsXmlDigesterConfigurer.java
示例11: writeReport
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
public static void writeReport(JasperDesign jd, File outputFile) throws java.lang.Exception
{
final String compatibility = IReportManager.getPreferences().get("compatibility", "");
String content = "";
if (compatibility.length() == 0)
{
content = JRXmlWriter.writeReport(jd, "UTF-8"); // IReportManager.getInstance().getProperty("jrxmlEncoding", System.getProperty("file.encoding") ));
}
else
{
content = JRXmlWriterHelper.writeReport(jd, "UTF-8", compatibility);
}
Writer out = new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8");
out.write(content);
out.close();
}
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:19,代码来源:CompileThread.java
示例12: componentShowing
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
@Override
public void componentShowing() {
super.componentShowing();
JasperDesign jd = ((JrxmlEditorSupport)cloneableEditorSupport()).getCurrentModel();
if (jd != null && ((JrxmlEditorSupport)cloneableEditorSupport()).isModified())
{
// Update the content...
try {
String content = JRXmlWriter.writeReport(jd,"UTF-8"); // IReportManager.getInstance().getProperty("jrxmlEncoding", System.getProperty("file.encoding") ));
getEditorPane().setText(content);
getEditorPane().setCaretPosition(0);
((JrxmlVisualView)((JrxmlEditorSupport)cloneableEditorSupport()).getDescriptions()[0]).setNeedModelRefresh(false);
} catch (Exception ex)
{
ex.printStackTrace();
}
}
((JrxmlEditorSupport)cloneableEditorSupport()).setCurrentModel(null);
}
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:21,代码来源:JrxmlSourceEditor.java
示例13: isToWrite
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
@Override
public boolean isToWrite(JRComponentElement componentElement,
JRXmlWriter reportWriter)
{
ComponentKey componentKey = componentElement.getComponentKey();
if (ComponentsExtensionsRegistryFactory.NAMESPACE.equals(componentKey
.getNamespace())) {
if (ComponentsExtensionsRegistryFactory.WMS_MAP_COMPONENT_NAME
.equals(componentKey.getName())) {
return isNewerVersionOrEqual(componentElement, reportWriter,
JRConstants.VERSION_5_0_1);
}
}
// XXX: Defaults to true in jr ComponentsExtensionRegistryFactory???
return false;
}
开发者ID:sourcepole,项目名称:jasperreports-wms-component,代码行数:17,代码来源:WmsMapComponentsXmlWriter.java
示例14: getVersion
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
protected String getVersion(JRComponentElement componentElement,
JRXmlWriter reportWriter) {
String version = null;
ComponentKey componentKey = componentElement.getComponentKey();
String versionProperty = PROPERTY_COMPONENTS_PREFIX
+ componentKey.getName() + PROPERTY_COMPONENTS_VERSION_SUFFIX;
if (componentElement.getPropertiesMap().containsProperty(versionProperty)) {
version = componentElement.getPropertiesMap()
.getProperty(versionProperty);
} else {
JRReport report = reportWriter.getReport();
version = JRPropertiesUtil.getInstance(jasperReportsContext)
.getProperty(report, versionProperty);
if (version == null) {
version = JRPropertiesUtil.getInstance(jasperReportsContext)
.getProperty(report, JRXmlBaseWriter.PROPERTY_REPORT_VERSION);
}
}
return version;
}
开发者ID:sourcepole,项目名称:jasperreports-wms-component,代码行数:25,代码来源:WmsMapComponentsXmlWriter.java
示例15: writeToXml
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
@Override
public void writeToXml(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException
{
Component component = componentElement.getComponent();
if (component instanceof TextInputComponent) {
TextInputComponent textInputComponent = (TextInputComponent) component;
ComponentKey componentKey = componentElement.getComponentKey();
writeTextInputComponent(textInputComponent, componentKey, reportWriter);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:11,代码来源:TextInputComponentXmlWriter.java
示例16: writeToXml
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
public void writeToXml(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException
{
Component component = componentElement.getComponent();
PieChartComponent chart = (PieChartComponent) component;
JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper();
ComponentKey componentKey = componentElement.getComponentKey();
String namespaceURI = componentKey.getNamespace();
String schemaLocation =
ComponentsEnvironment.getInstance(jasperReportsContext)
.getBundle(namespaceURI).getXmlParser().getPublicSchemaLocation();
XmlNamespace namespace = new XmlNamespace(namespaceURI, componentKey.getNamespacePrefix(),
schemaLocation);
writer.startElement("pieChart", namespace);
writer.addAttribute("evaluationTime", chart.getEvaluationTime(), EvaluationTimeEnum.NOW);
if (chart.getEvaluationTime() == EvaluationTimeEnum.GROUP)
{
writer.addEncodedAttribute("evaluationGroup", chart.getEvaluationGroup());
}
PieDataset dataset = chart.getDataset();
writer.startElement("pieDataset");
reportWriter.writeElementDataset(dataset);
writer.writeExpression("keyExpression", dataset.getKeyExpression());
writer.writeExpression("valueExpression", dataset.getValueExpression());
writer.closeElement();//pieDataset
writer.writeExpression("titleExpression", chart.getTitleExpression());
writer.closeElement();//pieChart
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:37,代码来源:PieChartXmlWriter.java
示例17: writeToXml
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
@Override
public void writeToXml(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException
{
Component component = componentElement.getComponent();
if (component instanceof HtmlComponent)
{
writeHtmlComponent(componentElement, reportWriter);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:HtmlComponentXmlWriter.java
示例18: writeHtmlComponent
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
protected void writeHtmlComponent(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException
{
Component component = componentElement.getComponent();
HtmlComponent htmlComponent = (HtmlComponent) component;
ComponentKey componentKey = componentElement.getComponentKey();
XmlNamespace namespace = new XmlNamespace(
HtmlComponentExtensionsRegistryFactory.NAMESPACE,
componentKey.getNamespacePrefix(),
HtmlComponentExtensionsRegistryFactory.XSD_LOCATION);
JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper();
writer.startElement("html", namespace);
writer.addAttribute(HtmlComponent.PROPERTY_SCALE_TYPE, htmlComponent.getScaleType());
writer.addAttribute(HtmlComponent.PROPERTY_HORIZONTAL_ALIGN, htmlComponent.getHorizontalImageAlign());
writer.addAttribute(HtmlComponent.PROPERTY_VERTICAL_ALIGN, htmlComponent.getVerticalImageAlign());
writeExpression(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION, htmlComponent.getHtmlContentExpression(), false, componentElement, reportWriter);
if (htmlComponent.getEvaluationTime() != EvaluationTimeEnum.NOW) {
writer.addAttribute(HtmlComponent.PROPERTY_EVALUATION_TIME, htmlComponent.getEvaluationTime());
}
writer.addAttribute(HtmlComponent.PROPERTY_EVALUATION_GROUP, htmlComponent.getEvaluationGroup());
writer.addAttribute(HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW, htmlComponent.getClipOnOverflow());
writer.closeElement();
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:29,代码来源:HtmlComponentXmlWriter.java
示例19: writeToXml
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
@Override
public void writeToXml(JRPart part, JRXmlWriter reportWriter) throws IOException
{
PartComponent component = part.getComponent();
if (component instanceof SubreportPartComponent)
{
writeSubreport(part, reportWriter);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:PartComponentsXmlWriter.java
示例20: writeSubreport
import net.sf.jasperreports.engine.xml.JRXmlWriter; //导入依赖的package包/类
protected void writeSubreport(JRPart part, JRXmlWriter reportWriter) throws IOException
{
SubreportPartComponent subreport = (SubreportPartComponent) part.getComponent();
ComponentKey componentKey = part.getComponentKey();
JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper();
XmlNamespace namespace = new XmlNamespace(
PartComponentsExtensionsRegistryFactory.NAMESPACE,
componentKey.getNamespacePrefix(),
PartComponentsExtensionsRegistryFactory.XSD_LOCATION);
writer.startElement(PartComponentsExtensionsRegistryFactory.SUBREPORT_PART_COMPONENT_NAME, namespace);
writer.addAttribute("usingCache", subreport.getUsingCache());
writer.writeExpression(JRXmlConstants.ELEMENT_parametersMapExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, subreport.getParametersMapExpression());
JRSubreportParameter[] parameters = subreport.getParameters();
if (parameters != null && parameters.length > 0)
{
for(int i = 0; i < parameters.length; i++)
{
reportWriter.writeSubreportParameter(parameters[i], JRXmlWriter.JASPERREPORTS_NAMESPACE);
}
}
JRSubreportReturnValue[] returnValues = subreport.getReturnValues();
if (returnValues != null && returnValues.length > 0)
{
for(int i = 0; i < returnValues.length; i++)
{
reportWriter.writeSubreportReturnValue(returnValues[i], JRXmlWriter.JASPERREPORTS_NAMESPACE);
}
}
writer.writeExpression(JRXmlConstants.ELEMENT_subreportExpression, JRXmlWriter.JASPERREPORTS_NAMESPACE, subreport.getExpression());
writer.closeElement();
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:39,代码来源:PartComponentsXmlWriter.java
注:本文中的net.sf.jasperreports.engine.xml.JRXmlWriter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论