bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed Aug 12, 2020 2:30 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Thu May 14, 2020 7:01 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 12:59 am
Posts: 789
Location: Berlin, Germany
There must be a way to get you through. I will talk to the guys who run the forum now (I initiated it years ago) and let you know.

_________________
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."


Top
 Profile  
 
PostPosted: Thu May 14, 2020 8:15 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4149
Location: Boise, Idaho USA
Quote:
Roger, c'mon. It's sooooo much funnier to struggle with strange code from anywhere and for different languages than to just open a damned CSV file with Excel and save it afterwards. 8-)


"There are 2 kinds of people in this world, those with loaded guns, and those who dig. You dig!" - Clint Eastwood (The Good, The Bad and The Ugly)

"If your'e gonna shoot, shoot. Don't talk." - Eli Wallach (The Good, The Bad and The Ugly)

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Thu May 14, 2020 8:44 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 12:59 am
Posts: 789
Location: Berlin, Germany
:lol:

_________________
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."


Top
 Profile  
 
PostPosted: Thu May 14, 2020 8:59 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 12:59 am
Posts: 789
Location: Berlin, Germany
Hi, Eugene.

If you give me a mail adress via PN, I will give it to the guys who run the forum and they will put it on a whitelist, okay?

_________________
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."


Top
 Profile  
 
PostPosted: Thu May 14, 2020 7:15 pm 
Offline
User avatar

Joined: Sat Feb 04, 2012 2:23 am
Posts: 1349
Location: Russia, Southern federal district, city of Krasnodar
Gut. Vielen Dank! Ich habe dir in PM geschrieben

_________________
http://lc.kubagro.ru/
https://www.researchgate.net/profile/Eugene_Lutsenko
http://ej.kubagro.ru/
http://ej.kubagro.ru/a/viewaut.asp?id=11


Top
 Profile  
 
PostPosted: Thu May 14, 2020 9:40 pm 
Offline
User avatar

Joined: Sat Feb 04, 2012 2:23 am
Posts: 1349
Location: Russia, Southern federal district, city of Krasnodar
Roger!

Thank you very much! I tried using the function you gave me. What can I say? It converts a CSV file to an XLS file. However, in the Excel file, data from the CSV file is placed in one column, and there are 8 of them. if you enter this CSV file in Excel using Excel itself as text data, then you can create a separator in the dialog. Is it possible to set the separator in your function as a function parameter? And more. The function works very slowly. Files attached


Attachments:
1.zip [15.98 KiB]
Downloaded 90 times

_________________
http://lc.kubagro.ru/
https://www.researchgate.net/profile/Eugene_Lutsenko
http://ej.kubagro.ru/
http://ej.kubagro.ru/a/viewaut.asp?id=11
Top
 Profile  
 
PostPosted: Fri May 15, 2020 12:28 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 864
Location: Sijsele, Belgium
Hi Eugene,

Don't forget you need to have Excel on your PC to use the activex. This isn't 'universal'.

If this isn't a problem, you can load the csv into an array, and then save it to XLS. If you use 'blocks' of data it will be much faster. If this can help you, I can send you some code as a sample.

You can split the array in blocks of 500 lines, and then send a block to Excel. I tested on this some years ago, and this seems to be the fasted way.

That external lib claims to be very fast, I never used it. Most of my customers have Excel on their system.

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Fri May 15, 2020 6:24 am 
Offline
User avatar

Joined: Sat Feb 04, 2012 2:23 am
Posts: 1349
Location: Russia, Southern federal district, city of Krasnodar
Hi, Chris!

Of course, the implementation of your function is of interest to me. I also used blocks in Excel, but for converting xls=>dbf. This really accelerated processing very much. Converting csv=>xls takes a long time if the csv file is large. And if it is large, you can't put it (all of it) in the array. And if it is small, then it should be placed in the array, and so it works normally. It turns out that it is necessary to convert the file. We will assume that Excel is available on all computers, and if it is not-then a reasonable message should be issued to the user.

_________________
http://lc.kubagro.ru/
https://www.researchgate.net/profile/Eugene_Lutsenko
http://ej.kubagro.ru/
http://ej.kubagro.ru/a/viewaut.asp?id=11


Top
 Profile  
 
PostPosted: Sun May 17, 2020 10:34 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4149
Location: Boise, Idaho USA
Quote:
We will assume that Excel is available on all computers, and if it is not-then a reasonable message should be issued to the user.


This is from DC_Array2Excel(). It shows how to test for Excel installed.

Code:
  oExcel := CreateObject("Excel.Application")
  IF Empty( oExcel )
    IF lCSVFallBack
      DCMSGBOX 'Excel is not installed. Create CSV file instead?' YESNO TO lStatus
      IF lStatus
        RETURN DC_Array2CSV(cExcelFile,aData)
      ELSE
        RETURN .f.
      ENDIF
    ELSE
      DC_WinAlert( "Excel is not installed" )
    ENDIF
    RETURN .f.
  ENDIF

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Sun May 17, 2020 10:55 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4149
Location: Boise, Idaho USA
Quote:
However, in the Excel file, data from the CSV file is placed in one column, and there are 8 of them.


The oExcel:Workbooks:Open() method is not recognizing that you have comma-delimited data in your CSV file. By default it probably expected TAB delimiters.

Change your open method call to this:
Code:
oBook := oExcel:Workbooks:Open(cCsvFile,,,2)

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group