We have requirement to print Images in table row by side by side. We followed one syntax (mentioned in SampleReport.docx) to print images side by side. If we have multiple images able to see the Image in document where as if we have single image we could see blank space.
Please let us know your suggestion.
Attached SampleJosn.docx and SampleReport.docx for reference.
Unfortunately, the shared JSON is not readable by APIs. Please attach the following resources here for testing:
Your JSON data source (text file format).
Please attach the output Word file that shows the undesired behavior.
Please attach the expected output Word file that shows the desired behavior.
Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.
As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.
PS: To attach these resources, please zip and upload them.
We have changed the images link in JSON with base64 images and use following code example to reproduce the issue. The modified JSON is attached. SampleJson.zip (14.0 KB)
We have logged this problem in our issue tracking system as WORDSNET-22770. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.
var doc = new Aspose.Words.Document(MyDir + "SampleReport.docx");
var json = File.ReadAllText(MyDir + "SampleJson.txt");
JsonDataLoadOptions options = new JsonDataLoadOptions();
options.SimpleValueParseMode = JsonSimpleValueParseMode.Strict;
var dataStream = new MemoryStream(Encoding.ASCII.GetBytes(json));
var jsonDataSource = new JsonDataSource(dataStream, options);
var engine = new ReportingEngine();
engine.Options = ReportBuildOptions.AllowMissingMembers;
engine.BuildReport(doc, jsonDataSource);
doc.Save(MyDir + "21.9.docx");
We have tested the scenario and 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 WORDSNET-22770. You will be notified via this forum thread once this issue is resolved.
It is to inform you that your issue WORDSNET-22770 has been closed as ‘Not a bug’.
In your template document, the shape that is visually the second in the report template is actually located before the visually-first shape. Please set the shapes’ wrap type as inline to see the actual template syntax.
You can set the shape wrap type as inline and put the <<next>> tag in first shape to avoid the shared issue. Please check the modified input and output documents in attachment. 21.9.docx (27.1 KB) SampleReport.docx (20.2 KB)
Please use JsonDataLoadOptions.ExactDateTimeParseFormats property to get or set exact formats for parsing JSON date-time values while loading JSON. You can achieve this by specifying one or several exact formats in the context of the current culture to be used while parsing date-time values from strings as shown in the following example.
var doc = new Aspose.Words.Document(MyDir + "SampleReport.docx");
var json = File.ReadAllText(MyDir + "SampleJson.txt");
List<String> formats = new List<String>();
formats.Add("yyyy-MM-dd");
JsonDataLoadOptions options = new JsonDataLoadOptions();
options.SimpleValueParseMode = JsonSimpleValueParseMode.Strict;
options.ExactDateTimeParseFormats = formats;
var dataStream = new MemoryStream(Encoding.ASCII.GetBytes(json));
var jsonDataSource = new JsonDataSource(dataStream, options);
var engine = new ReportingEngine();
engine.Options = ReportBuildOptions.AllowMissingMembers;
engine.BuildReport(doc, jsonDataSource);
doc.Save(MyDir + "21.9.docx");