We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Executing MaiMerge with ResultSet containing CLOB fails

Hi,


I use AsposeWords to perform a MailMerge with DataSet and ResultSet which contain a CLOB COLUMN as shown here:



DataSet dataSet = new DataSet();



DataTable dtData = new DataTable(rs, “Broschuere”);

dataSet.getTables().add(dtData);



InputStream inputStream =
getClass().getResourceAsStream(template);

doc = new
Document(inputStream);

doc.getMailMerge().executeWithRegions(dataSet);

doc.updateFields();

After doing this with no errors, opening my DOC on the position where the CLOB should be I see the following “oracle.sql.CLOB@5c7088b1”, so the MailMerge past the Pointer and not the value of the CLOB.

can you help me?

thx
Michael

Hi Michael,

Thanks for your inquiry. To insert an image mail merge field into a document in Word, select Insert/Field command, then select MergeField and type <span style=“font-size:10.0pt;line-height:107%;
font-family:“Arial”,sans-serif;mso-fareast-font-family:SimSun;mso-fareast-theme-font:
minor-fareast;background:yellow;mso-highlight:yellow;mso-ansi-language:EN-US;
mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA”>Image:<span style=“font-size:10.0pt;line-height:107%;font-family:“Arial”,sans-serif;
mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-ansi-language:
EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA”>MyFieldName
<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>ZH-CN</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0pt 5.4pt 0pt 5.4pt; mso-para-margin-top:0pt; mso-para-margin-right:0pt; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0pt; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>. Please make sure that your mail merge field name is like Image:MyFieldName.

If you still face problem, please attach your input Word document here for testing. We will investigate the issue on our side and provide you more information.

Hi,
why do you write about images. I never wrote anything about images or something like that. I don’t need to merge a BLOB (byte[]) I need to merge a CLOB which is a VERY BIG VARCHAR field in ORACLE, you know it.

javax.sql.CLOB is a very big VARCHAR represented in ORACLE, and I need to merge the content of THIS VERY BIG VARCHAR to my mergefield, as I do in the code above.

So what do I wrong?

thx
Michael

Hi Michael,

Please accept our apologies for your inconvenience.

We have tested the scenario using CLOB data type and have not found the shared issue. If you are using old version of Aspose.Words, we suggest you please upgrade it to Aspose.Words for Java 15.9.0.

If you still face problem, please share your input template document along with contents of CLOB here for our reference? Please share the contents of CLOB in notepad file. We will investigate the issue on our side and provide you more information.

Still same problem with latestest version of Apsose Words Java 15.9.0

I create a test client for you with t.docx is the template and r.docx is the result.

Change on Test.java the setUrl, setUser and setPassword to open an connection to your database where you have to do a select from to CLOB columns like in my source code.

If you like here are the database scripts

create table test (short_desc varchar2(255) not
null, long_desc clob not null);



insert into test (short_desc, long_desc) values (‘short1’,
‘long1’);



insert into test (short_desc, long_desc) values (‘short2’,
‘long2’);



commit;

thx
Michael

Hi Michael,

Thanks for sharing the detail. We are working over your query and will get back to you asap.

Hi Michael,

Thanks for your patience. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSJAVA-1204. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSJAVA-1204) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.