gxenglish-l | | | |
Sergio Prusky | |
Jannie,
Try using the Template property. Before you open the Excel, assign it a
template. You can set the width and other properties of columns and cells
in the template. For the template you may use an xls or an xlt.
We use the following lines before creating any Excel, changing the name of
the Excel file.
In this example, StyleInventoy.xlt defines formatting (column width,
heading, even macros if necessary).
&DocNbr = PGetNextNbr.Udp('REPORTS','Y', 1)
&FileName = trim(&SdtContext.CmpPathReports) + 'StyleInventory-' +
trim(&DocNbr.ToString()) + '.xls'
&ExcelFile.Template = trim(&SdtContext.CmpPathReports) +
'templates\StyleInventory.xlt'
&ExcelFile.Open(&FileName)
On Wed, Feb 12, 2014 at 6:54 AM, Jannie Louw
> |
|
|
Sergio Prusky | |
Jannie,
You will have to find out why it is hanging up. What platform are you
using? Try to find an error log that will help you define what the error
is. With Java for example, if the applications doesn't have access to the
file, it crashes.
If it is a Web application, try placing the template file in a location
that can be accessed from the application, to make sure that the user that
is running the program has access to the file. We always use xls and xlt,
we don't use xlsx or xltx, although these should work too. For all versions
of Excel we use these older formats, because I don't know what the
libraries that GX uses to read and write Excel files support.
Best,
Sergio
On Wed, Feb 12, 2014 at 5:27 AM, Jannie Louw
> |
|
|
Jannie Louw | |
Hi Sergio
I am using Evolution 2 u4 with C# running under window 8 with Excel 2013 on
a web environment.
It hangs when I try to ".xls" Excel files instead of ".xlsx (even with no
.template statement). If I do not include the .template statement the excel
.xlsx file is created correctly, but obviously unformatted.
As soon as I include the .template statement with .xlsx excel files, I get
the error message "Invalid template", even if it is included in the same
directory where the excel file is create. Therefore the system must have
access to the folder. I did check the security settings of the folders.
I will log an issue.
I have
Thanks for all your support
Jannie,
You will have to find out why it is hanging up. What platform are you
using? Try to find an error log that will help you define what the error
is. With Java for example, if the applications doesn't have access to the
file, it crashes.
If it is a Web application, try placing the template file in a location that
can be accessed from the application, to make sure that the user that is
running the program has access to the file. We always use xls and xlt, we
don't use xlsx or xltx, although these should work too. For all versions of
Excel we use these older formats, because I don't know what the libraries
that GX uses to read and write Excel files support.
Best,
Sergio
On Wed, Feb 12, 2014 at 5:27 AM, Jannie Louw > |
|
|
ggallotti7825 | |
Hi Jannie,
The reason why application hangs is because GeneXus didn't find "Jakarta
Files" that are required when working with ExcelDocument.
You may read this SAC:
https://www2.genexusnet.com/gxpintranet/hgxpp001.aspx?1,14,132,O,S,0,,19780
All in all you will need the Jakartas dlls:
http://sourceforge.net/project/showfiles.php?group_id=151482&package_id=171498
And enable "32 bit
application"
in you IIS.
The good news is that GeneXus X Evolution 2 U4 has native support for xlsx
Excel files.
For working with templates in xlsx you will need to create your template
with xlsx extension instead of .template.
This behavior is documented here:
https://www2.genexusnet.com/gxpintranet/hgxpp001.aspx?1,14,132,O,S,0,,34662
Hope it helps,
Gonzalo.
On Fri, Feb 14, 2014 at 9:13 AM, Jannie Louw |
|
|
Jannie Louw | |
Hi Gonzalo
Unfortunately I do not have access to
https://www2.genexusnet.com/gxpintranet/hgxpp001.aspx?1,14,132,O,S,0,,19780
or
https://www2.genexusnet.com/gxpintranet/hgxpp001.aspx?1,14,132,O,S,0,,34662.
I assume this is because I only have access to the Extranet not the
Intranet.
I downloaded the Jakarte dll's and copied them to
c:\Models\KnowledgeBase\CSharpModel\web\bin\ directory and tries the .xls
with the .xlt template, but the system still hangs. This is with Evolution 2
u4.
I then tries the .xlsx option with .xlsx as the template (which sounds
strange as .xlsx is not a template) or even opening an existing .xlsx file
with the correct format. None of these options worked. If I put the .xlsx
file in the .\Custom Office Template" I still get the error message that the
Template does not exist.
Any other suggestions?
|
|
|
ggallotti7825 | |
http://www2.gxtechnical.com/portal/hgxpp001.aspx?15,4,61,O,E,0,,19780;E;
http://www2.gxtechnical.com/portal/hgxpp001.aspx?15,4,61,O,E,0,,34662;E;
On Mon, Feb 17, 2014 at 6:19 AM, Jannie Louw |
|
|
|
|
Back to gxenglish-l |
|