How to programmatically link Field in Enterprise Portal AX 2009 to open a specifical File - dynamics-ax-2012

I'm a new beginner in Microsoft AX. I have a problem in AX 2009. I create a Table ImportFile with 2 Fields,("FileName-->Typ:String", "FileDocuValue-->Typ:Container"). When the User import a CSV-File it will be save in the Table ImportFile.
Now in EP I Just show in My GridView a Column FileName and I want that FileName be a Link so that when I click in one one these Names that it Open the Corresponding CSV-File in Excel.
Is it possible to do it?

I can suggest the following approach:
You can use a standard asp LinkButton control to display a link. When the link has been clicked,
Create a temporary CSV file from the data in your ImportFile table.
Create a URL to the generated CSV file (you can use the WebLink.url method).
Open the generated URL.
When I was working on a similar task (generate and download PDF) I also had to modify some standard classes such as WebSession and EPDocuGetWebLet.

Related

Download files without knowing the extensions

I had an excel file which had for each row a column named id with a link value that open up other files the id doesn't have .(extension) on it.
The problem is that I imported the excel file on SQL Server Management, and the links is now strings without extension i want it to be displayed as a link in my grid view on asp.net page to open up the named file...
To mention there is at least 700 rows on the database.
Thanks in advance!

Export pie chart from ASP Classic to excel

I have multiple pie charts that's created using Charts.js. I have already built an Excel export to export the table from the HMTL page to Excel. Now, I would like to pass a few variables into excel and then create a pie chart from these variables, maybe using a macro. So, that when the user clicks the "Export to Excel" button everything is in the excel file. Is this even possible?
If not could I save the charts as images and insert them into the export as well as the other information?
As a simple answer, what I would say is to stick with the format that you are using to produce your report currently, only use XML instead of HTML.
How this would work is you should take take the report you have currently and on the second page turn that table into a chart in excel. You can then go to excel's options and save it as an XML document. Open that document in any editor and you will need to reverse engineer it to build your XML formatted response from your page.
See here as a starting point: http://msdn.microsoft.com/en-us/library/office/aa203722(v=office.11).aspx
Edit
The XML method won't work. Just reread the page and it specifically says:
The following Excel features cannot be persisted in XML:
Charts, OLE Objects...
So for an actual chart you will need to use a predesigned excel sheet. What you would do with this is create an excel sheet using the same table format you would be producing on the page. Then design the chart based on the columns you intend to use.
You can then insert into this file, save it to the server and subsequently send it to the client for download. See here for info on how to do that: ASP Classsic - Insert into Excel .XLS columns or Create a Real Excel Format File.

Can I copy all tables from a URL?

My task is to copy tables from a public domain and format it later in Word. I have created a software where I just have to enter two values and the table is displayed to me on a web page. Then I have to copy this table into Word.
I was wondering if there was an easier way to achieve this....
I would even like to know if it is possible to store all the values I type to a TXT file or Excel sheet and programmatically copy the displayed web pages to Word.
Please help me and don't down-vote.....
Okay here are the detailed steps:
Open a webpage
Fill in a form with 4 fields
A new webpage opens based on what input you provide
Copy 2 tables from that webpage
Paste the 2 tables in MS Word 2007
Open browser again and go back to previous page
Enter new values in the webpage
Repeat all the steps
P.S There are more than 700 tables to be copied each week
I'm not sure this is what you need...anyway...
If you download the page (programmatically of course) you can parse it as XML (I assume it's a well-formed XML file otherwise you may have to use some dirty trick to find all tables). Then you can put all data on Word (by automation, you can even do all these stuffs from a Word macro, just download the HTML file, "parse" it to find tables and paste that text as HTML).
I would provide some example but it can't really be language-agnostic.

fill a custom excel template from sql server proc with multiple result sets?

A stored proc (SQL Server 2008) returns multiple result sets.
An Excel (.xls) file with custom formatting - not a generic workbook, not a spreadsheet built on the fly - has particular cells on particular
worksheets where I need to correctly "paste" each appropriate result set
from the stored proc. The worksheets designated for holding data need to
receive the data, and then other worksheets in the workbook will display the data
with a high degree of formatting and with charts.
For example:
result set 1 needs to be pasted in a worksheet named 'data01'
and beginning at cell B2;
result set 2 needs to be pasted 'data01'
and beginning at cell K2;
result set 3 needs to be pasted in a worksheet named 'data02'
and beginning at cell B2...
What are some approaches for tackling this problem
in a .NET environment? I have not found examples
or lessons which duplicate this scenario.
Update:
Essentially I'm wondering if it's possible to do what
SpreadsheetGear does with an excel template, without
having to pay thousands for a third party tool.
http://www.spreadsheetgear.com/support/samples/excel.aspx
Importing and Exporting Data by Using the SQL Server Import and Export Wizard
Exporting SQL Server Data to Excel (SQL Server Video)
On Zach Hunter's blog,
http://zachhunter.net/
he has a number of posts on how to make user of NPOI.
http://npoi.codeplex.com/
In particular, these two articles were invaluable:
"Use NPOI to populate an Excel template"
http://www.zachhunter.net/2010/05/npoi-excel-template/
"Improved NPOI ExportToExcel Function"
http://www.zachhunter.net/2010/06/improved-npoi-exportdatatabletoexcel-function/

Getting Data from excel and inserted in to a gridview in asp.net

in my application i want to get the data of a excel which is in a folder in solution explorer. i want to get the data and insert into a gridview. expecailly i want a particular colunm in that excel sheet that is i want to show in a gridview for example i set a outlook contact in a excel sheet in that sheet i want only a emailaddress column in a grid view how can i write. thank you
You can use ADO.net to access cells in an excel file, similar to a DB query. This is a bit lighter than trying to use Excel automation objects.
http://support.microsoft.com/kb/316934
You can then use this as a source for your gridview.

Resources