Open file
javemar
New Altair Community Member
Hello
Hello
I would like to ask for help because I have the next problem. I'm able to open a file(eg a excel workbook) with rapidminer through the "execute program" operator, using the "cmd/ c star c:/somedirectory/file.format" parameter, but when I tried to run this through rapydanalytics the program didn't open and didn't give me any error. In fact, the process never ends
Somebody know which could be the problem. I really appreciate your help.
Hello
I would like to ask for help because I have the next problem. I'm able to open a file(eg a excel workbook) with rapidminer through the "execute program" operator, using the "cmd/ c star c:/somedirectory/file.format" parameter, but when I tried to run this through rapydanalytics the program didn't open and didn't give me any error. In fact, the process never ends
Somebody know which could be the problem. I really appreciate your help.
0
Answers
-
Hello, hello,
can you please tell us what you want to achieve?
Do you really want to open the file in excel, such that the user can view the data in excel, or do you want to load the data, such that RapidMiner/RapidAnalytics can process the data from the excel file?
Best regards,
Marius0 -
Hello Marius.
My goal is make a little report in excel. I use rapidanalytics/rapidminer to extract info from a database and then write a excel file. Then, I want to open a macro in excel (xlsm) that let me make some pivot charts and pivot tables with this information. I can do it with rapidminer , but I cant with rapidanalytics.
I really apreciate all your help. Thanks Marius
0 -
Ok, please be more specific. Which part exactly does not work in RapidAnalytics? Is it the last part, i.e. running excel? Please remember that the process is running on the RapidAnalytics server, so if you try to run a program from within your process, this would be done on the server. This probably does not make much sense, since probably nobody except the server admin could see the reports popping up on the server machine0
-
Hello Marius
You are right, the excel file is generate within the server throught other excel macro.
I can within rapidminer using "cmd/ c star c:/somedirectory/macro.xlsm
Then, I send this report (excel file) through email to other pcs.
The problem in rapidanalytics is that I can't open the xlsm in the server. I'm a little newbie using web services and I'm running rapidanalytics in my own pc.
Thanks a lot for your patience and help Marius0 -
Hi,
so let me sum up:
- you are running RapidAnalytics on the same pc as RapidMiner
- you are executing the same process one time in RapidMiner and one time on RapidAnalytics
- in RapidMiner the process runs fine, but on RapidAnalytics it fails
Is that correct?
Please post the xml of your process as described in the post linked in my signature, so I can have a look at it.
~Marius0 -
Hello Marius.
Yes Marius, you are right.
Here is a example of my process.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="write_excel" compatibility="5.2.008" expanded="true" height="76" name="Write Excel (2)" width="90" x="112" y="120">
<parameter key="excel_file" value="D:\carpeta/archivo.xls"/>
<parameter key="file_format" value="xls"/>
<parameter key="encoding" value="SYSTEM"/>
<parameter key="sheet_name" value="RapidMiner Data"/>
<parameter key="date_format" value="yyyy-MM-dd HH:mm:ss"/>
<parameter key="number_format" value="#.0"/>
</operator>
</process>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="execute_program" compatibility="5.2.008" expanded="true" height="76" name="Execute Program" width="90" x="246" y="120">
<parameter key="command" value="cmd /c start \carpeta\macro.xlsm"/>
<parameter key="log_stdout" value="true"/>
<parameter key="log_stderr" value="true"/>
</operator>
</process>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="execute_script" compatibility="5.2.008" expanded="true" height="76" name="Interno" width="90" x="447" y="120">
<parameter key="script" value="import java.util.Properties; import javax.activation.DataHandler; import javax.activation.DataSource; import javax.activation.FileDataSource; import javax.mail.*; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; import java.text.SimpleDateFormat; public class MailWithAttachment { public static void main(String []args) throws Exception { SimpleDateFormat formateador = new SimpleDateFormat("dd/MM/yyyy H"); String host = "smtp.gmail.com";//host name String from = "direccion@mail.com";//sender id String to = "persona@mail.com"; String nombre = "Resultado.xlsx"; String pass = "pass";//sender's password String fileAttachment = "D:\\carpeta\\archivo.xlsx";//file name for attachment //system properties Properties prop = System.getProperties(); // Setup mail server properties prop.put("mail.smtp.gmail", host); prop.put("mail.smtp.starttls.enable", "true"); prop.put("mail.smtp.host", host); prop.put("mail.smtp.user", from); prop.put("mail.smtp.password", pass); prop.put("mail.smtp.port", "587"); prop.put("mail.smtp.auth", "true"); //session Session session = Session.getInstance(prop, null); // Define message MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO,new InternetAddress(to)); message.setSubject("Mensaje"); // create the message part MimeBodyPart messageBodyPart = new MimeBodyPart(); //message body messageBodyPart.setText("Este es el mensaje y un archivo adjunto."); Multipart multipart = new MimeMultipart(); multipart.addBodyPart(messageBodyPart); //attachment messageBodyPart = new MimeBodyPart(); DataSource source = new FileDataSource(fileAttachment); messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(nombre); multipart.addBodyPart(messageBodyPart); message.setContent(multipart); //send message to reciever Transport transport = session.getTransport("smtp"); transport.connect(host, from, pass); transport.sendMessage(message, message.getAllRecipients()); transport.close(); } }"/>
<parameter key="standard_imports" value="true"/>
</operator>
</process>
macro.xlsm takes the archivo.xls, makes some operations and writes the archivo.xlsx. Then, the script send a email with archivo.xlsx
Thanks Marius0 -
Hi,
you did not post valid xml. Please use the steps explained in the post linked in my signature.
However, probably your problem arises from the fact that RapidAnalytics is started as a windows service and thus does not have the possibility to create GUI windows. You could try to stop the service and start it manually via the run.bat. But please consider that this will only work as long as RapidAnalytics is running on your local computer, and in this case I can see no big advantage over using plain RapidMiner. As soon as you deploy RapidAnalytics to a true server machine, that process won't run anymore.
Best regards,
~Marius0 -
Hello Marius
I didn't know that I can´t open a GUI with a windows service, this is a little sad for my goal. I suppose that I have to change the approach. I'm going to set some schedule task in windows and try to run a bat file that let me run rapidminer and the Excel GUI.
Thank Marius for your help
0