ssrs2 2.0.0b11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ssrs2/__init__.py ADDED
@@ -0,0 +1,80 @@
1
+ """
2
+ RDLC and RDL reports (SQL Server Reporting Services, Report Viewer) to PDF, Word, Excel, PowerPoint, images, HTML, CSV
3
+ and XML, with no Windows and no Report Viewer; Markdown to decks and documents; other tools' reports to RDLC.
4
+
5
+ import ssrs2
6
+ ssrs2.render_report(Path("Invoice.rdlc"), datasets={"Items": rows}).save("invoice.pdf")
7
+
8
+ This package is the reports' face of ``weblitz``: the same engine, the same worker, one version.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ from typing import Any, Optional
14
+
15
+ import weblitz as _weblitz
16
+ from weblitz import (
17
+ AsyncEngine,
18
+ CheckResult,
19
+ Engine,
20
+ FileInput,
21
+ Note,
22
+ Result,
23
+ WeblitzError,
24
+ configure,
25
+ default_engine,
26
+ info,
27
+ )
28
+
29
+ __version__ = "2.0.0b11"
30
+
31
+ #: The error of a failed call (the same class as weblitz's).
32
+ ReportError = WeblitzError
33
+
34
+ __all__ = [
35
+ "AsyncEngine",
36
+ "CheckResult",
37
+ "Engine",
38
+ "FileInput",
39
+ "Note",
40
+ "ReportError",
41
+ "Result",
42
+ "WeblitzError",
43
+ "check_report",
44
+ "configure",
45
+ "default_engine",
46
+ "import_report",
47
+ "info",
48
+ "markdown_to",
49
+ "render_report",
50
+ ]
51
+
52
+ if _weblitz.__version__ != __version__: # pragma: no cover - pip installs the pinned one
53
+ raise ImportError(f"ssrs2 {__version__} needs weblitz {__version__}, not {_weblitz.__version__}: pip install 'weblitz=={__version__}'")
54
+
55
+
56
+ def render_report(definition: FileInput, **options: Any) -> Result:
57
+ """A report with its rows to a document.
58
+
59
+ ``definition`` is the report's XML (a str), its bytes or a ``pathlib.Path``. Options: format ("PDF" by default,
60
+ "WORDOPENXML", "EXCELOPENXML", "PPTX", "IMAGE", "HTML5", "CSV", "XML"..., or "pdf", "docx", "xlsx", "pptx",
61
+ "png"), datasets ({name: rows}, each a list of dicts or a pandas or polars DataFrame), parameters, device_info,
62
+ subreports ({name: file}), restricted_code (True by default: report code held to the object model), path, timeout.
63
+ """
64
+ return default_engine().render_report(definition, **options)
65
+
66
+
67
+ def check_report(definition: FileInput, **options: Any) -> CheckResult:
68
+ """A report's problems, as the SSRS2 designer and MCP server give them, without rendering it."""
69
+ return default_engine().check_report(definition, **options)
70
+
71
+
72
+ def markdown_to(markdown: FileInput, format: str, **options: Any) -> Result:
73
+ """Markdown (Marp decks, documents) to "pptx", "docx" or "pdf"."""
74
+ return default_engine().markdown_to(markdown, format, **options)
75
+
76
+
77
+ def import_report(file: FileInput, file_name: Optional[str] = None, **options: Any) -> Result:
78
+ """Another tool's report (FastReport, Crystal, Telerik, Jasper, ActiveReports..., or a PDF, Word or Excel file)
79
+ as an RDLC to edit and render."""
80
+ return default_engine().import_report(file, file_name, **options)
ssrs2/py.typed ADDED
File without changes
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: ssrs2
3
+ Version: 2.0.0b11
4
+ Summary: RDLC and RDL reports to PDF, Word, Excel and PowerPoint on Linux, macOS and Windows, with no Report Viewer.
5
+ Requires-Python: >=3.9
6
+ Author: SSRS2
7
+ License: Proprietary: see LICENSE.md
8
+ Keywords: rdlc,rdl,ssrs,report viewer,reporting services,pdf,docx,xlsx,pptx
9
+ Project-URL: Homepage, https://ssrs2.net
10
+ Requires-Dist: weblitz==2.0.0b11
11
+ Description-Content-Type: text/markdown
12
+
13
+ # ssrs2
14
+
15
+ RDLC and RDL reports (SQL Server Reporting Services, Report Viewer) to PDF, Word, Excel, PowerPoint, images, HTML,
16
+ CSV and XML on Linux, macOS and Windows, with no Report Viewer.
17
+
18
+ ```python
19
+ from pathlib import Path
20
+ import ssrs2
21
+
22
+ rows = [{"Description": "Widget", "Price": 104.99, "Qty": 1}]
23
+ ssrs2.render_report(Path("Invoice.rdlc"), datasets={"Items": rows}, path="invoice.pdf")
24
+ ssrs2.render_report(Path("Invoice.rdlc"), format="docx", datasets={"Items": dataframe})
25
+
26
+ problems = ssrs2.check_report(Path("Invoice.rdlc"))
27
+ deck = ssrs2.markdown_to(Path("talk.md"), "pptx")
28
+ rdlc = ssrs2.import_report(Path("Invoice.frx"))
29
+ ```
30
+
31
+ A report is its XML as a `str`, its bytes or a `pathlib.Path`. A dataset's rows are a list of dicts or a pandas or
32
+ polars DataFrame. `ssrs2` runs on `weblitz`, the same engine: `ssrs2.configure(...)` and `ssrs2.Engine` are
33
+ weblitz's.
@@ -0,0 +1,5 @@
1
+ ssrs2/__init__.py,sha256=Ie-0_wGZIDQDfpLGammXCVaAMZSX_xiWsEdkJGgYJZM,2771
2
+ ssrs2/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ ssrs2-2.0.0b11.dist-info/METADATA,sha256=uAMJMx231PyOq70ykFMW3dXLGUxyK31R717R_bi4TNY,1300
4
+ ssrs2-2.0.0b11.dist-info/WHEEL,sha256=OTS7fyC4lBRRoeDo6ropae9HyQdKa5Hb2seq9OL6RSw,94
5
+ ssrs2-2.0.0b11.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: weblitz build_wheels.py
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any