[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

how to export matrix of values to Excel in single COM call

marcin

10/7/2005 8:05:00 AM

Hi, as Axapta 3.0 does not have simple "save report as Excel file" feature
(for heaven sake) so I have created a patch - my class takes the report name
and creates report in Excel. Now its time to focus on performance - every COM
call is connected with a time overhead. Is there a way to put a matrix of
values to Excel in single COM call? Regards, Marcin

remarks: I am not able to use CSV, export to .txt file cos I have to handle
situation when fields contain "new line" character.
3 Answers

Luegisdorf

10/10/2005 9:00:00 AM

0

Hi Marcin

You can use XLSHTML instead of HTML. The XLSHTML-Format is like a HTML page
and this way you don''t need Excel-COM. There should be much information in
the internet to use or produce XLSHTML files.

But for a simple beginning just make a textfile which this contains:

<table><tr><td>any value</td></tr></table>

Then rename or save the file to xyz.xls and open it in Excel, make some
modifications and save again. Open now the file in Notepad and you can see
the format flags Excel is using you may need in your ''Report to Excel''
feature.

Hope this helps.
regards
Patrick

"marcin" wrote:

> Hi, as Axapta 3.0 does not have simple "save report as Excel file" feature
> (for heaven sake) so I have created a patch - my class takes the report name
> and creates report in Excel. Now its time to focus on performance - every COM
> call is connected with a time overhead. Is there a way to put a matrix of
> values to Excel in single COM call? Regards, Marcin
>
> remarks: I am not able to use CSV, export to .txt file cos I have to handle
> situation when fields contain "new line" character.

Luegisdorf

10/10/2005 11:43:00 AM

0

Hi once again

Of course I meant XLSHTML instead of a proper xls (and not as written html).
But the rest of the message should be ok ;-)

"Luegisdorf" wrote:

> Hi Marcin
>
> You can use XLSHTML instead of HTML. The XLSHTML-Format is like a HTML page
> and this way you don''t need Excel-COM. There should be much information in
> the internet to use or produce XLSHTML files.
>
> But for a simple beginning just make a textfile which this contains:
>
> <table><tr><td>any value</td></tr></table>
>
> Then rename or save the file to xyz.xls and open it in Excel, make some
> modifications and save again. Open now the file in Notepad and you can see
> the format flags Excel is using you may need in your ''Report to Excel''
> feature.
>
> Hope this helps.
> regards
> Patrick
>
> "marcin" wrote:
>
> > Hi, as Axapta 3.0 does not have simple "save report as Excel file" feature
> > (for heaven sake) so I have created a patch - my class takes the report name
> > and creates report in Excel. Now its time to focus on performance - every COM
> > call is connected with a time overhead. Is there a way to put a matrix of
> > values to Excel in single COM call? Regards, Marcin
> >
> > remarks: I am not able to use CSV, export to .txt file cos I have to handle
> > situation when fields contain "new line" character.

Micha³ Kupczyk

10/10/2005 2:33:00 PM

0

"marcin" < wrote in message
> Is there a way to put a matrix of > values to Excel in single COM call?

for sure in VB you can assign array of values to Excel.Range object.
sub Test()
ThisWorkbook.Worksheets(1).Range("A1:B2").Value =
Array(array("A","B"),array("C","D"))

You can try to build right side of assignment using Axapta''s COMVariant.

Regards.
Michal