ASPOSE Table

ASPOSE_Table.pdf (82.5 KB)
Hi,

If there is no data for a datatable to be displayed in a ASPOSE table…how can we displayed meaning ful message like “No data Exists” instead of the tags.

Please see attached.

Thanks.

@nbidar,

Thanks for your inquiry. Please check the code example at Github repository about applying custom logic to unmerged regions. Hope this helps you.

Good Morning Tahir,

Attached is a sample project created to simulate the issue. See how “«TableStart:Dep»«Id»
$«Alloc»«TableEnd:Dep»” is displayed…I want to replace that tag with a meaningful text “No Data Exist” or just an empty table will be fine too.

Thanks.

AwardMemo.zip (3.0 MB)

@nbidar,

Thanks for your inquiry. We have attached the input document and VB.NET code with this post for your kind reference. Document and VB.NET Code.zip (32.5 KB)

We have also modified your code. Please check Form1.vb.zip (2.4 KB)

We suggest you please upgrade to the latest version of Aspose.Words for .NET 17.12.

I copied the code and I am getting errors…

We are still using Aspose.Word runtime version : v2.0.50727 and version : 9.1.0.0. This .dll doesn’t have “Aspose.Words.MailMerging” namespace…and doesn’t have :IFieldMergingCallback" interface…

Our procurement process of latest .dll will be slow…but meanwhile I need to have a solution with existing version…Is there no way to suppress empty regions with the runtime version : v2.0.50727 and version : 9.1.0.0.

Thanks.

@nbidar,

Thanks for your inquiry. You are using very old version of Aspose.Words. Unfortunately, we don’t provide support for older released versions of Aspose.Words. Also, please note that we do not provide any fixes or patches for old versions of Aspose products either. All fixes and new features are always added into new versions of our products. So, please use latest version of Aspose.Words for .NET 17.12.

If you do not want to use latest version of Aspose.Words, we suggest you following solution.

  1. Iterate through all fields.
  2. If filed’s code (the text between field start and separator) contains the TableStart or TableEnd, please get its ancestor Table node using Node.GetAncestor method.
  3. Remove the table node.

Hi Tahir,

We have upgraded to Aspose.Words for .NET 17.12 but I am having difficulty opening a .pdf application in browser…seems like SaveType.openinApplication is no longer valid.

What is the equivalent of
doc.Save(“AwardSheet.pdf”, SaveFormat.Pdf, SaveType.openinApplication, Response)

using new version.

Thanks.

@nbidar,

Thanks for your inquiry. Please use Document.Save method (HttpResponse, String, ContentDisposition, SaveOptions) to send the document to the client browser. Please refer to the following article.
Sending to a Client Browser

Tahir,

I am attaching a sample application…Please look at the code in Preview button…we would like to display the .pdf in client browser

Will the code be any different if it is a desktop or web-based application.

Dim saveOptions As PclSaveOptions = New PclSaveOptions()
saveOptions.SaveFormat = SaveFormat.Pdf
doc.Save(Response, “AwardSheet.pdf”, ContentDisposition.Attachment, saveOptions) ’ I am getting an error on this line

Thanks.

@nbidar,

Thanks for your inquiry.

The code for document processing tasks and conversion will be same except the following method. This method is only used when you want to send the output to client browser. E.g. if you want to open the PDF and image file in browser.

Document.Save method (HttpResponse, String, ContentDisposition, SaveOptions)

Please check the overload of Document.Save method.

Please replace PclSaveOptions with PdfSaveOptions and use ContentDisposition.Inline instead of ContentDisposition.Attachment. Please check the detail of ContentDisposition enumeration.