report builder for django - python

is this something like stimulsoft or crystal report for django, i am not talking about report viewer that just export some excel data, i am talking about whole package, like some text with variables and some tables, pages with headers and footers and water marks and so on.
i want to have footer on every page and tables that i don't know how
long they will grow and maybe they go to second page or third and the
page must be generated with footer for new data just like stimulsoft
reporter

You can use Reportlab that contains such features. [read it!]. But I don't found a full package to connect models and making reports. In Reportlab you can make page templates and complete them with data. For the Persian language, you should use external packages for RTL reshaping.

Check out ReportBro
Commercial use requires a license. I'm not affiliated, but currently evaluating for use in my own project. It seems to offer everything you're looking for.

Related

How to embed an XLSX local file into HTML page with Python and Django

For a Python web project (with Django) I developed a tool that generates an XLSX file. For questions of ergonomics and ease for users I would like to integrate this excel on my HTML page.
So I first thought of converting the XLSX to an HTML array, with the xlsx2html python library. It works but since I can’t determine the desired size for my cells or trim the content during conversion, I end up with huge cells and tiny text..
I found an interesting way with the html tag associated with OneDrive to embed an excel window into a web page, but my file being in my code and not on Excel Online I cannot import it like that. Yet the display is perfect and I don’t need the user to interact with this table.
I have searched a lot for other methods but apart from developing a function to browse my file and generate the script of the html table line by line, I have the feeling that I cannot simply use a method to convert or display it on my web page.
I am not accustomed to this need and wonder if there would not be a cleaner method to display an excel file in html.
Does it make sense to develop a function that builds my html table script in str? Or should I find a library that does it? Maybe there is a specific Django library ?
Thank you for your experience

pelican: do not build specific article

what's the best way to not build a page for a specific Pelican article?
I'm asking because I'm using some article pages mainly as metadata collections but I don't want them to have a specific page you can access.
For example I have a bunch of articles for portfolio clients which include metadata like the link to their logo, name of the client, the category of the job we did, etc... but there's not actual article I want to link to.
I tried to give them the Draft metadata or Hidden metadata but that way they do not show up when I iterate them in the relevant page.
I would like to be able to iterate them and access and use their metadata without building a webpage for them.
Thanks for your help.
It's unclear to me what you're after, it sounds like what you really want is to be able to include data from a file into other articles?
If so, you could use the reStructuredText include directive. Save the metadata files with an extension that won't be picked up by Pelican and then include them in all the pages where you want to use them.

Exclude first page from Table of Contents in pisa / xhtml2pdf

I'm using django-xhtml2pdf to generate a report. I'm using the first page as a cover sheet, followed by the table of contents, using the <pdf:toc /> tag.
I would like to discount the first page, so the page-numbering in the Table of Contents starts at 1 instead of 2.
Is this possible?
Reading through the xhtml2pdf code, there isn't support for offsetting the page numbering. There's an old discussion about a pisa fork trying to implement support for this, but I'm not sure how far it got.
An awkward but straight-forward solution is to generate your cover sheet and the rest of the document as separate PDFs and then merge them. That way the page numbering will exclude the cover sheet. pyPDF merging and displaying as httpresponse through django has an accepted answer that will let you do just that.

Automatically preventing wiki-rot in Trac?

Hi guys : Is there a way to improve trac wiki quality using a plugin that deals with artifacts like for obsolete pages, or pages that refer to code which doesn't exist anymore, pages that are unlinked, or pages which have a low update-rate ? I think there might be several heuristics which could be used to prevent wiki-rot :
Number of recent edits
Number of recent views
Wether or not a page links to a source file
Wether or not a wiki page's last update is < or > the source files it links to
Wether entire directories in the wiki have been used/edited/ignored over the last "n" days
etc. etc. etc.
If nothing else, just these metrics alone would be useful for each page and each directory from an administrative standpoint.
I don't know of an existing plugin that does this, but everything you mentioned certainly sounds do-able in one way or another.
You can use the trac-admin CLI command to get a list of wiki pages and to dump the contents of a particular wiki page (as plain text) to a file or stdout. Using this, you can write a script that reads in all of the wiki pages, parses the content for links, and generates a graph of which pages link to what. This should pinpoint "orphans" (pages that aren't linked to), pages that link to source files, and pages that link to external resources. Running external links through something like wget can help you identify broken links.
To access last-edited dates, you'll want to query Trac's database. The query you'll need will depend on the particular database type that you're using. For playing with the database in a (relatively) safe and easy manner, I find the WikiTableMacro and TracSql plugins quite useful.
The hardest feature in your question to implement would be the one regarding page views. I don't think that Trac keeps track of page views, you'll probably have to parse your web server's log for that sort of information.
How about these:
BadLinksPlugin: This plugin logs bad local links found in wiki content.
It's a quite new one, just deals with dangling links, but any bad links as I see from source code. This is at least one building block to your solution request.
VisitCounterMacro: Macro displays how many times was wiki page displayed.
This is a rather old one. You'll get just the statistic per page while an administrative view is missing, but this could be built rather easily, i.e. like a custom PageIndex.

How do you make a PDF searchable with text in the sidebar?

I'm looking to create some PDF's from Python.
I've noticed that some pdf's have sidebar text that allows you to see the context of occurrences of search terms.
e.g. search for "dictionary"
View in Sidebar:
Page 10 Assigning a value to an existing dictionary key simply replaces the old value with a new one.
How is that done?
Is there anyway to convert existing PDFs to render this sidebar text?
If you use Reportlab to generate your pdfs, then there are facilities in the library to bookmark as you want. Checkout the bookmarkPage method on page 54 of the documentation.
I believe what you're referring to are bookmarks. The first hit on Google indicates that you can put them in by hand with Acrobat Pro.
The DocBook XSL templates when used with Apache FOP
The PyQt gui toolkit has support for creating PDF's. See for example: Printing Rich Text with Qt

Categories