8/29/2025 9:31:18 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Exporting groups to CSV via script
Posted: 12 Aug 09 7:05 AM
|
Hi guys,
Though this is my first post, this forum has already helped me further quite often! Just wanted to say thanks for that before I start
We are having troubles with exporting groups to Excel when columns formatted as integer are contained. For some reason the integer values of some cells are cut. E.g. the number would be 390,488.56, with integer format it is cut to 39049. Or if the value is 2000.2 it's cut to 2. I did some debugging and found out that the values are only truncated when they're exported to Excel. CSV works fine. The cutting isn't a formatting problem in Excel, we've already checked that. The cutting must be happening somewhere in the function ExportCurrentGroupToExcel. But as this is a standard SLX function, I cannot debug it. I'll contact Sage about this bug, but we need a solution asap, so I can't wait for Sage to provide a solution and need to find a workaround. Additional info: The problem only occurs with SLX clients from a certain country. The regional settings don't seem to matter as I am able to recreate the problem on my computer with different regional settings.
I'd like to export the group to a CSV file and open it - correctly formatted - in Excel, so the user won't know the difference. Unfortunately I can't find any info on how to export data to CSV. Of course it could be done manually, but that is not an option. I really need to export the data using a script.
I've done quite much research but wasn't able to find anything yet. Any help or advice you could give me is much appreciated!
Thanks!  |
|
|
|
Re: Exporting groups to CSV via script
Posted: 12 Aug 09 10:07 AM
|
"For some reason the integer values of some cells are cut. E.g. the number would be 390,488.56, with integer format it is cut to 39049. Or if the value is 2000.2 it's cut to 2."
Try Formatting the group cells as fixed instead of integer. Excel shouldn't have any problems with that?
What version of Excel?
|
|
|
|
Re: Exporting groups to CSV via script
Posted: 13 Aug 09 12:24 AM
|
I've already tried formatting the cells as fixed and then adapting the format so no comma values are displayed. Unfortunately I wasn't able to do that as my entered format, like #.##0 was displayed like this and not the formatted values. I also tried 1.234 and so on, but nothing worked. And seeing as some of our users don't have that much computer experience, I think it wouldn't be that easy to have them use the fixed format. I also thought of checking the group columns before exporting, so I could catch integer columns and have them changed to fixed values, but that doesn't seem to be possible as you can't access information like that via script!
I've tried this with both Excel 2000 and Excel 2007. |
|
|
| |
|
Re: Exporting groups to CSV via script
Posted: 13 Aug 09 6:08 AM
|
Thank you for the link. But as I don't have a recordset or a grid which I want to export, this doesn't really help me. It seems groups can't be exported directly, you have to use one of the given export methods (to file or excel). |
|
|
| |
|
Re: Exporting groups to CSV via script
Posted: 13 Aug 09 6:58 AM
|
That already occured to me, but if I take the SQL, then I don't have any of the formatting done by the user. I just see which columns, conditions etc. were entered. Additionally, if the user has put the same column twice into the group and formatted it differently, then it only appears once in the SQL and the export would be wrong/incomplete. |
|
|
| |
|
Re: Exporting groups to CSV via script
Posted: 13 Aug 09 7:17 AM
|
I guess you're right, there really doesn't seem to be a way to do this just using scripts... Yesterday I realized there might be another way to do this. Kind of a workaround for the workaround
What I want to do now is open the Export to file dialog via script, enter the destination file (CSV) using SendKeys and then format and open the file in Excel. So far it seems to be feasible, but I've already encountered the next problem. Opening the dialog via SendKeys is possible, but it doesn't look really stable to me. So I wanted to do it using the DoInvoke function, which works, but if I do it this way then I cannot control the dialog window anymore. Only after user interaction will the script continue and execute the rest of the code. I read some similar posts on the forum, and now I'm not sure, so here goes: is it really NOT possible to control a dialog window which has been opened via DoInvoke? Because I'm afraid the Export to file window cannot be opened any other way (besides SendKeys).
Can anybody tell me if this is right or if there'd be a way?
Thanks!! |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|