Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 3 Jahren
Letzter Beitrag:
vor 3 Jahren
Beteiligte Autoren:
issah, stefan kern, Piet van Zanten

Am I the only one who needs to export web reports to Excel?

Startbeitrag von issah am 23.01.2015 23:25

Just converted a WD application to WB17. Client is happy but misses the export to Excel (and other formats feature). I can't possible be the only one who has need for this feature. There must a product, enhancement or work around somewhere.

Help me out.

regards

issah

Antworten:

Hi Issah,

There are several options.
If you use iDestination you can print a report to Excel.
Other formats are available too for iDestination.
In V19 there's an option to add a popup menu to a table that has all options to export the table.
Alternatively you can use TableToExcel/Word/XML/Text in programming.
You can also use the xls functions to create Excel files.
The principle with all these exports is you need to manage a temporary destination file on the server and use FileDisplay to let the user download it.

Regards,
Piet

von Piet van Zanten - am 24.01.2015 10:25
Hi Issah,

I had the same problem here.
I implemented two solutions:

The first one was creating an XML with HEXPORTXML(), where you can define the source (Table, query, SQL query) as well as a field list.
If the user opens this file with Excel, the XML will be imported into Excel.

The second was to create a CSV with simple String Operations:
Like:
==============================================================
//Dann die Daten füllen
WHILE NOT HOut(dsSQL)
FOR EACH STRING sField OF sFieldList SEPARATED BY ","
IF sField[[1]] = "d" AND {dsSQL+"."+sField} "00000000" THEN
sUbText = {dsSQL+"."+sField}
sOutString = sOutString +DateToString(sUbText,"DD.MM.YYYY")+ ";"
ELSE
sOutString = sOutString + {dsSQL+"."+sField} + ";"
END
END

sOutString = sOutString + CRLF
HReadNext(dsSQL)
END

===================================================
where: dsSQL is a Data Source Variable holding the data coming from an SQL Query and sFieldList is a String variable holding the column names of this query.

Regards

Stefan.

von stefan kern - am 24.01.2015 16:00
Ok, thanks. Will investigate.

Am I exporting the underlying table or the report. Don't want to lose all the formatting and computation.

regards

issah

von issah - am 25.01.2015 13:31
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.