Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 1 Jahr, 1 Monat
Letzter Beitrag:
vor 1 Jahr, 1 Monat
Beteiligte Autoren:
Arie, Mark Crichton, Peter Holemans, D Wilson, stefan.kern, Piet van Zanten

Store reports in a table

Startbeitrag von stefan.kern am 07.04.2017 06:17

Dear Forum,

maybe someone can help.

I have a Project where may customer Needs to handle a lot of custom Reports.
He is a Service Provider printing lots of Reports and invoices on behalf of his customers, and has to handle about 50 different versions of some Reports.
He shall design the Reports with R&Q.

My idea was to store the Reports in a file using hlinkmemo()

The at run time when the Report Needs to be printed I want to extract the Report in to a temp file and print it using iPrintReport(sMyTempFile), where sMyTempfile is a string variable Holding the full path and filename.

Did anyone managed something like that?
I tried, but the Problem is that the Report looses his subreports and his base query.

Best Regards



Hi Stefan,

I did this some 10 years ago when I supplied my reports as files to the customer by putting them into the database.
I also used nested reports I think.
Just like your idea I extracted the report into a temporary file to print it.
I also added a file that stored parameters needed to construct the input screen for the end user to print each report.
The input screen was constructed using controlclone.

I'll have to dig into my archives for sample code if you like. (may take some time)
It was built in WD15 or 16.

Best regards,

von Piet van Zanten - am 07.04.2017 13:58
Hi Stefan,

I do exactly the same. Using the database as the place to hold modified reports, instead of a shared map on a server. Works great.
Never had issues with the report source (be it a query or a tablecontrol). Also sub-reports do work.
I'm not sure, but I believe you need a copy of the subreports as well in the temp-map where you put the reports temporary.

R&Q can be a bit cumbersome to use. I have to manually open a project first and then a report as a second step, otherwise it will crash most of the times. Also never use the report description to change the report name, but use "save-as".

von Arie - am 07.04.2017 14:02
BTW, I always use queries form my project as a report-source. Never tried one build by the end-user in R&Q. Not for any particular reason though, but that may be a difference with your situation

von Arie - am 07.04.2017 14:07
I am just getting started with Windev.
Could you provide a code snippet to show how to save,load,run a report.
It would be greatly appreciated. I could definitely see using this.


von D Wilson - am 07.04.2017 16:00
Hi D,

In the 'Modifier' pane of the report in the report designer make sure you have the 'include source code' flagged.
Here's a code snippet of how we do run complete independent reports out of WB that are stored in a database.
(Note there's better reporting generator tools around nowadays that do HTML, DOCX, XLSX, PDF, even PPTX, live slice & dice in Excel, etc...)

The method (specialisation from parent class) code to save the by the user uploaded WDE file into the database

FUNCTION RecSave(pErrLst is ErrorList, pRefresh is boolean = False)
//Local variables
bResult is boolean
ErrMsg is ErrorMessage

//Execute at ancestor level
bResult = Ancestor:RecSave(pErrLst,pRefresh)

//Do memo handling if required (Meaning a new file was uploaded)
IF bResult THEN
IF NOT :LayoutGeneratorSourceFileName ~= "" AND :PrintRequestID

von Peter Holemans - am 10.04.2017 13:35
Hi Stefan

I specialise in reporting and have spent many many months building a report writer to handle just what you are doing.

Having a database to hold the report details is the way to go. The table will hold report name, details , scripts, report paths, and filter options and settings.

I store the report wde in the table and then export the record to zip for backup and to send to other users etc. I leave the reports on disk in the wde format for R&Q to edit. I find it all works quite.

Gets complicate when you have multiple people working on versions of the same report.
I have unique names for each report and use a GUID to identify reports moving between users. e.g. if I import a report it keeps only one version, so updates the record if GUID already there.

Happy to help if I can

von Mark Crichton - am 12.04.2017 09:14
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.