- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
将报告导出至 MS Word
你好,
我需要以非常特定的格式将我创建的报告导出到 MS Word。我可以将其导出为 PDF 文件,这非常有用关闭我想要它在 MS Word 中的外观,但我需要尽可能地改进它的外观,以最大程度地减少导出后所需的编辑量。 为了说明我想要做什么,我在下面附上了一个简短的脚本,该脚本创建一个包含一些标题、几个表格和一个页脚的简单报告,然后以三种不同的格式导出该报告,即 PDF 文件、MS 文件Word 文档和 HTML 文件。
报告的 PDF 版本的创建方式与我希望它在 MS Word 版本中的显示方式非常相似,其中标题居中、字体大小不同以及脚本中指定的表格样式(“标题分隔符”和“边框”)。然而,MS Word 版本失去了标题居中、字体大小设置和表格样式 - 如果可能的话,我希望保留所有这些功能。
同样在 MS Word 版本中,每一行实际上都是一个文本框(您可以通过在 Word 中打开文档,使用
因此我的问题是:
- 导出到 MS Word 时是否可以保留 (a) 居中和/或 (b) 字体大小设置?
- 是否可以将简单的文本行(而不是文本框)导出到 MS Word?
- 导出到 MS Word 时是否可以保留指定的表格样式(例如“边框”或“标题分隔符”)?
我猜想其中一些(如果不是全部)是不可能的——但我从过去的经验中知道,如果你碰巧知道如何去做,通常有办法解决这些小问题。任何人都可以帮助我解决上述任何问题吗?
非常感谢 - 这是我提到的演示脚本:
我的表格框1 =桌盒(
字符串列框( “位置” , { “第一的” , “第二” , “第三” , “第四” , “第五” }) ,
字符串列框( “描述” , { “水” , “硫酸” , “氧” , “硫化氢” , “氯化钠” }) ,
字符串列框( “公式” , { “水” , “硫酸” , “氧气” , “硫化氢” , “氯化钠” }) ,
<<表格样式( “标题分隔符” )
) ;
我的表格框2 =桌盒(
字符串列框( “镇” , { 「阿伯丁」 , “卡迪夫” , “伦敦” , “曼彻斯特” }) ,
编号栏框( “人口” , [ 212125 , 324800 , 8174000 , 512000 ]) ,
<<表格样式( “有边界” )
) ;
我的标题=文本框( “这是我的主标题” , <<对齐文本(中心) , <<设置字体大小( 14 ) , <<字体颜色({ 0 , 0 , 0.5 }) , <<设置宽度( 200 )) ;
我的字幕=文本框( “这是我的副标题” , <<对齐文本(中心) , <<设置字体大小( 9 ) , <<字体颜色({ 0 , 0 , 1 }) , <<设置字体样式( “斜体” )) ;
我的空白线=文本框( ” “ , <<设置字体大小( 12 )) ;
我的脚注=文本框( “这是我的脚注” , <<设置字体大小( 9 ) , <<对齐文本(中心)) ;
卢布=排队框(恩科尔( 1 ) ,
我的标题,
我的字幕,
我的空白线,
我的表格框1 ,
我的空白线,
我的表格框2 ,
我的空白线,
我的脚注
) ;
西北=新窗户( 《我的窗户》 ,卢布) ;
卢布<<保存PDF ( “C:\Documents\我的报告.pdf” ) ;
卢布<<保存 MS Word ( “C:\Documents\我的报告.doc” ) ;
卢布<<保存 HTML ( “C:\Documents\我的报告.html” ) ;
This post originally written in English (US) has been computer translated for you. When you reply, it will also be translated back to English (US).
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
回复:将报告导出到 MS Word
如果您愿意进行一些编程,您可以通过以下方法获得确切的格式:
- 在 MS-Word 中创建具有所需格式的报告。
- 使用Word 2003 XML 文档格式将其另存为 XML 文件
- 在 JSL 中,使用真实数据创建此 XML 文件。使用 .XML 扩展名保存文本
我已经使用这种方法来生成多选项卡 Excel 电子表格。这需要一些编程,但它确实有效。
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
回复:将报告导出到 MS Word
从 JMP 的角度来看,这里使用两种导出方式。 HTML 和 DOC 导出为具有最少样式信息的结构化文本。 PDF(以及 EPS 和 SVG 等其他格式)导出为图形,保留样式和布局,但不保留结构。
关于文本是否位于单独的行上,JMP 尝试通过在文本之间发出行分隔符将它们放在单独的行上,但 HTML 将行分隔符视为常规空格,这解释了与 DOC 的区别。 如果您确实正在寻找一种极端的解决方法,我确实在 JMP 中找到了一个可以导出不带行分隔符或其他装饰的文本的位置,那就是导出 ComboBox 时。但是,如果您要使用如此长的长度并丢失样式,你不妨只制作一个巨大的文本框。
顺便说一句,很好清晰的例子。
This post originally written in English (US) has been computer translated for you. When you reply, it will also be translated back to English (US).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Exporting reports to MS Word
Hi Xan,
Thanks for those pointers; it looks as though I'm going to have to a bit cleverer to get the effects I want, as I don't think a giant Text Box is going to solve my problem unless I can incorporate a table within it - and I can't see a way to do that. I'll carry on experimenting and post here again if I get anywhere - but in the meantime, could you elaborate on that comment about Combo Boxes please? I've tried adding one to my Line Up Box, but it doesn't seem to be exported at all in either Word or HTML.
Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
回复:将报告导出到 MS Word
如果您愿意进行一些编程,您可以通过以下方法获得确切的格式:
- 在 MS-Word 中创建具有所需格式的报告。
- 使用Word 2003 XML 文档格式将其另存为 XML 文件
- 在 JSL 中,使用真实数据创建此 XML 文件。使用 .XML 扩展名保存文本
我已经使用这种方法来生成多选项卡 Excel 电子表格。这需要一些编程,但它确实有效。
This post originally written in English (US) has been computer translated for you. When you reply, it will also be translated back to English (US).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Exporting reports to MS Word
This sounds ingenious - I've almost no experience of writing XML files at the moment, but I'll definitely give it a go.
Many thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Exporting reports to MS Word
Hi,
I was made aware that there is already a topic about generating reports.
I need to generate a report (MS Mord or saved as PDF file) for multiple parameters (parameters quantity can vary from 1 to 500).
One page for one parameter. The navigation through the document is made with help of bookmarks.
The XML approach seams to be very interesting. I'm not firm with XML and just started with JSL.
Can you please present your approach with examples I can modify for my needs?
Perhaps using the documets I've attached?
The attached data set contains a script for multiple "Normal Quantile Plots".
I'd like to be able to generate a MS Word document with help of JSL according to a certain template, which can be substituted by an arbitrary one.
I've attached:
Dataset with a script for generating the multiple graphs (BTW: thanks to community for help)
PDF converted from MS Word "template" file
XML file converted from MS Word "template" (.zip file)
The XML file can be opened with MS Word.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Exporting reports to MS Word
I tried playing around with this a bit, and my recommendation is to simply export JMP output as a Word document. It would be very difficult to generate "xml" code for graphs.
Take a look at this example program. This approach might just be the ticket. You'll need to learn what JSL display boxes are. Hint: the scripting index is your best friend!
dt = open("$sample_data\Big Class.jmp");
nw = new window("Sample",
panelbox("Actions",
hlistbox(
msword_button = buttonbox("Save to MS-Word",
sample_output << save msword("", Native);
),
close_button = buttonbox("Close this window",
nw << close window;
),
),
),
sample_output = vlistbox(
tb = table box(
string col box("Name", (dt:name << get values)),
number col box("Age", (dt:age << get values)),
string col box("Name", (dt:sex << get values)),
),
page break box(),
dist = dt << Distribution(
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) )
),
),
msword_button << set icon("WinFileSave"),
close_button << set icon("Stop"),
tb << set underline headings(1) << set column borders(1)
<< Set Shade Alternate Rows(1);
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
回复:将报告导出至 MS Word
谢谢你的建议!!
它有效。我只需要将文件从 filename.doc.jmp 重命名为 .doc
您能告诉我如何将页面调整为横向吗?
也许我需要缩放页面...
This post originally written in English (US) has been computer translated for you. When you reply, it will also be translated back to English (US).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Exporting reports to MS Word
Could you possibly share an example? I am very interested in this approach.
Many thanks,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Exporting reports to MS Word
Dodo wrote:
...in the meantime, could you elaborate on that comment about Combo Boxes please? I've tried adding one to my Line Up Box, but it doesn't seem to be exported at all in either Word or HTML.
Looks like they're exported in JMP 11 but not in JMP 10. More reason to ignore it.