Advertisement

04.04.2008 at 02:25AM PDT, ID: 23295411
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Axapta Report to CSV file?
Hi Experts,

I am quite new to AX development.
I have build a report that need to be exported to CSV format.
I was thinking / hoping for:
1. Have the AX automatically export to CSV
2. Override the display method of the report components and just add the comma for example:
    StringControl.Text = StringControl.Text + ",";
    Or someting like this.

Any idees or suggestions?

Thanks in advance!
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: Marius0188
Solution Provided By: Agrippine
Participating Experts: 1
Solution Grade: A
Views: 45
Translate:
Loading Advertisement...
04.04.2008 at 05:35AM PDT, ID: 21280951

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 01:14AM PDT, ID: 21295034

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 01:26AM PDT, ID: 21295086

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 01:27AM PDT, ID: 21295092

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 01:33AM PDT, ID: 21295115

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 01:33AM PDT, ID: 21295116

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 01:40AM PDT, ID: 21295140

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 01:59AM PDT, ID: 21295223

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:26AM PDT, ID: 21295311

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:35AM PDT, ID: 21295350

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:40AM PDT, ID: 21295375

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:52AM PDT, ID: 21295414

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 03:05AM PDT, ID: 21295469

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 03:14AM PDT, ID: 21295496

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 04:45AM PDT, ID: 21295876

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 04:51AM PDT, ID: 21295912

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 04:55AM PDT, ID: 21295930

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 04:59AM PDT, ID: 21295952

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
04.04.2008 at 05:35AM PDT, ID: 21280951
Hi,

no, sorry, this "easy" solution is not there.

Maybe the code will help you to get started. It opens a file on C drive and writes itemID and itemName for all items into the file.

Of course, you would not hard code the filename etc ...

Regards,
agrippine

PS: This is AX3 code

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
static void SimpleExport(Args _args)
{
    #File
    AsciiIo     fileOut = new AsciiIo("c:\\export.txt",#io_write);
    InventTable inventTable;
    ;
 
    fileOut.outFieldDelimiter(",");
 
    while select inventTable
    {
        fileOut.write(inventTable.ItemId, inventTable.ItemName);
    }
}
Open in New Window
 
04.07.2008 at 01:14AM PDT, ID: 21295034
OK so that means I will have to build this all through code.
Cause currently I have a Report set up and it is very close to what I need except for the exporting to comma seperated file part.

Can be quite a query to do.
:)

But thanks file output operation seem quite straight forward from your example.
 
04.07.2008 at 01:26AM PDT, ID: 21295086
Depending on how complicated the header information on your report is, you might of course "print" the report to an ascii file and use that ...

But that will only work nicely if you do not have any special layout but nice formatted columns only. Still, it might be worth having a look at. Of course, this also depends on how often you are needing that export file! If you need it once, formatting the exported info is not that bad, but if you have to do that on a daily basis ... you would at least have to invest in an Excel-macro to support the editing

So, look at the print dialog, choose "File" in the selection list on the left and then you might try out the different export formats (Ascii, RTF), which one fits your needs most closely ...

HTH
 
04.07.2008 at 01:27AM PDT, ID: 21295092
You don't know if there is a onbefore print method which  I can override.
Before any field is output to the report I would like to override and just add the "," after the field.

Thanks all!
 
04.07.2008 at 01:33AM PDT, ID: 21295115
That is basically what I have tried to do.
Format the report in a nice way but it does  not export to ascii in the same way.
If I can by any chance just intercept the values before previewing in the report and manipulate them and then sent them to the preview of the report I will be able to do what  I want.
 
04.07.2008 at 01:33AM PDT, ID: 21295116
Please tell me first, which AX version you are working with, so that I have a look at the appropriate application.
I am quite sure there is no such thing, but I will have a quick look, of course!
 
04.07.2008 at 01:40AM PDT, ID: 21295140
A comment to your 2nd statement (didn't see that before):
When exporting the report you will always have either see that every 2nd line or every 2nd column is empty, even if you have a very simple report layout.

If your problem is that the columns do not align nicely, try to set the columns to a fixed width (like 15 char) instead of Auto.
 
04.07.2008 at 01:59AM PDT, ID: 21295223
Comment ID: 21295116

MS Dynamics AX 4.0.


Comment ID: 21295140

Why do I need to have every 2nd line / column empty?
I have tried to give the columns fixed widths but the ascii file ignores those format settings. Dont know if I am doing something wrong but thats what I get.
 
04.07.2008 at 02:26AM PDT, ID: 21295311
Comment ID: 21295140
No, no need for that. It's just what happens if you import them to Excel (in my experience). It's due to Excel interpreting a line break differently from AX (at least that's what I think ...).


I just tried with a very simple report ... As a matter of fact, in AX3 we have an application that keeps the layout when exporting to a file. In AX4 it looks differently but I cannot figure out right now what's the difference is (could be that in the AX3 application we did something else).

I have two suggestions you might explore:
- If you are importing to excel, try setting tab stop as the separator sign. At least in my test it seems to be what AX writes to the file.
- Depending on how many fields you are exporting, you might overwrite the executeSection method of your reports body section (or sections). Instead of calling super() which will print the line, you might call the file.write() method. But then, you would have to explicitly mention every field you want to export.
I do not know whether that's ok. If the structure of the query is the complicated thing, then this might be ok.
Just to make sure, you would have the file variable as the reports member variable and open it in the init method of the report (sorry if it's obvious to you, but I am not sure how much you know about AX and programming yet).
 
04.07.2008 at 02:35AM PDT, ID: 21295350
Thanks for your help so far.

Just to clarify things a little.
I have no need to import excel.
Only need to Export my report to a CSV file.

Nope don't worry. I am really really new to AX development.
As matter of fact I would appreciate if you can show me how to open the file in the init() section and what the code should like as well as how the code should like to write a field to csv in the executesection(). The query does have a complicated structure. Ooh and what do you mean by the file variable should be the same as the report member.

Thanks once again!
 
04.07.2008 at 02:40AM PDT, ID: 21295375
This is the init override method code where as I understand have to declare the file.
The problem is the the executesection() method of the body which I need to override as well does not recognizes the "FilePO" variable. I get an error that says the field name "FilePO" does not exists.


public void init()
{
    #File
    AsciiIo     FilePO = new AsciiIo("c:\\plannedpo.txt",#io_write);
   
    ;
   
    super();
}


public void executeSection()
{
    FilePO.write("");
//    super();
}
 
04.07.2008 at 02:52AM PDT, ID: 21295414
ooooo, small typo, big effect, sorry.
Wanted to write that "file variable as a report member variable" ... by which I meant that you write
AsciiIO filePO;
into the report's classDeclaration (looks like a method but is the area where to declare member variables - similar to class declaration in C++).
By doing this, the variable filePO is known throughout the entire report. You open it when init is called and you use it for writing in execute section.

Change the init method to

public void init()
{
    #File        
    ;
    FilePO = new AsciiIo("c:\\plannedpo.txt",#io_write);
    FilePO.outFieldDelimiter(",");

    super();
}


and executeSection could be

public void executeSection()
{
    FilePO.write(inventTable.itemId, inventTable.name);
//    super();
}

or whatever the information is you want to export ...
Basically, you would write down the datasource and datafield resp. datamethod for all the fields you added to show on the report.
Accepted Solution
 
04.07.2008 at 03:05AM PDT, ID: 21295469
Ok this looks like it might work.
Will give it a try.

Just another question.
In some of my tables I have aded methods which returns some field values.
How do I access or get these methods in the executesection because I need to export that values as well to file.

 
04.07.2008 at 03:14AM PDT, ID: 21295496
In case the table you added the method to is already "on" the report, just call it in the write method:
...write(inventTable.mynewmethod(), ...);

If you did not, you will have to figure out how to "navigate" from the data you already have on the report to the additional table, for example if you had added the method

public void executeSection()
{
    InventItemGroup itemGroup;
;
    itemGroup = InventItemGroup::find(inventTable.itemGroupId);
    FilePO.write(inventTable.itemId, inventTable.name, itemGroup.mynewmethod());
//    super();
}

Does this help?

(Will be on my lunch break for an hour, but will answer after that :-))
 
04.07.2008 at 04:45AM PDT, ID: 21295876
Ok I got that to work.

Thanks again for all the help.


Just another question.
I have added several tables with their relationships to the report query.
When you execute your report you are prompted with the report preview form, the one where you can specify your range / sorting fields. In a very bottom table I have a field which should form part of that ranges tab in order for me to filter on that field.

 
04.07.2008 at 04:51AM PDT, ID: 21295912
Actually what determines whether a field will appear on that form (ranges tab)?
Some fields are listed there automatically.

Thanks.
 
04.07.2008 at 04:55AM PDT, ID: 21295930
Add the corresponding field to the range folder below the respective table in the report datasource (drag and drop from the fields list).
For example, see the bitmap: I added the field ABCValue to the InventTable node.

If you do not see the modification, you might have to delete the usage data of your report.
 
New range in the for filtering a report
New range in the for filtering a report
 
 
04.07.2008 at 04:59AM PDT, ID: 21295952
Comment #21295912:
Those fields will have been added to the ranges node of the respective data source ...
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628