Export Table to pdf

noclass1980

Active Member
Licensed User
Longtime User
Hi, I have a table that the user creates (using Erels Table library) which has been added to a panel. Depending on the user, there may be more rows than can be visible (advantage of Scrollview). I can write the table to a *.csv file. I've looked at the pdfwriter library but seems to handle lines of text and images. So is it is possible to write the table to a pdf as well and retain the format of the table? Is it possible to add the table to an imageview or canvas and save that to the pdf as a bitmap? If so, how would the non-visible rows be saved? Thanks in advance!
 

noclass1980

Active Member
Licensed User
Longtime User
You can create a HTML table with DBUtils.ExecuteHtml. It shouldn't be difficult to take the code and use it with your data (if it doesn't come from a database).

You can then load it to WebView and save the page with WebView.CaptureBitmap.

ok, thanks for the suggestion, I will try out over the weekend. The table is created within the app and not from a database. Could you point to a good tutorial on HTML? Thanks
 
Last edited:
Upvote 0

noclass1980

Active Member
Licensed User
Longtime User
Check DBUtils and specifically DBUtils.ExecuteHtml. It will build the html for you. You should either put your data in a database or take the code from this method and modify it to work with your data.

Hi, thanks for the advice. I can now export to pdf following the advice on handling WebView in thread 28756 and I've attached the example programme for others to use. Thanks once again.
 

Attachments

  • Webviewzip3.zip
    12.1 KB · Views: 588
Upvote 0
Top