Can Anyone Explain How to pass different Values(Valid,Invalid,Empty) For Username And Password fields Using Microsoft Excel ?
Like I need to get Values from Excelsheet
I need Script in Ruby
I have Tried to refer But There is no proper Documentation for Excel Scripts..
I would suggest a gem like roo. I am not sure where it is hosted nowadays, but either of these links should help:
http://roo.rubyforge.org/
http://rubygems.org/gems/roo
"roo" gem is the answer for your query.
It is simple to use and very easy to understand
This gem allows you to access the content of
* Open-office spreadsheets (.ods)
* Excel spreadsheets (.xls)
* Google (online) spreadsheets
* Excel’s new file format .xlsx
This link is very helpful
http://roo.rubyforge.org/
http://roo.rubyforge.org/rdoc/index.html
Related
I think it's probably simplest to start with my use case:
I'm trying to read the contents of a Google Spreadsheet into ruby, and then use that data for other purposes. This needs to happen server-to-server.
Here's what I've tried:
First I tried to use this google drive gem. Since my interaction needs to be server to server (i.e. a service account), I couldn't get this to work (someone please let me know if they've managed this!)
Next, I tried using the latest google-api-ruby gem, and, following its documentation, was successfully able to authenticate my service account, and have been able to get lists of files, etc. So basically the API is authenticated and working.
The latest issue is that Google Spreadsheets can't be downloaded using the normal download_dest parameter on the get_file method (sorry - would post links to relevant documentation here, but don't have enough rep to do so). So I'm not really sure how to proceed with downloading the relevant file (I understand how to get an export_link), but have no clue how to then prepare the next request).
Any help would be greatly appreciated :)
Here's some basic code for reference -
require 'googleauth'
require 'google/apis/drive_v2'
scopes = ['https://www.googleapis.com/auth/drive']
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = 'path/to/my/creds.json'
auth = Google::Auth.get_application_default(scopes)
drive = Google::Apis::DriveV2::DriveService.new
drive.authorization = auth
ss = drive.get_file('my_spreadsheet_id')
export_url = ss.export_links
# what now?
I made an XML configuration file that contains information to be accessed from both my Ruby script files and my HTML files. For Ruby purposes, this file contains things like links and admin authentication credentials that the script will need to pull from my database (I know this isn't safe--that's not an issue for me right now). For the HTML, it contains titles and other graphical information for the widgets where I'll be displaying this received information.
I was able to access the XML file in Ruby with the following:
require 'xmlconfigfile'
parent_directory = File.expand_path(".")
config = XmlConfigFile.new(parent_directory + '/configuration_file.xml')
info_i_need = config["/config/path_to_info/the_info"]
No problems there. Now, in the HTML, each widget is assigned a name, and I'd like to replace those names with strings that are located in this XML file. So I tried using embedded Ruby:
<div data-title=<% XmlConfigFile.new(File.expand_path(".") + '/configuration_file.xml')["/config/path_to_info/the_info"] %> ></div>
I didn't really expect this to work. I'm not sure if you can/should access Ruby packages in this way, but I can't find any other way to get the information I need into the HTML.
I really appreciate any corrections to this code or suggestions to alternate approaches. Thanks!
I just downloaded all my Gmail with the new download functionality from Google, and it gives me a large .mbox file. What would be a basic shell of a script to start extracting and processing individual emails from the file?
The book "Mining the Social Web" (O'Reilly, 2nd ed.) by Matthew Russell gives some code for doing this in Python. His code is all on github. You will want the files prefixed with 'mailbox'. https://github.com/ptwobrussell/Mining-the-Social-Web/tree/master/python_code
Check out this GitHub repo - https://github.com/PS1607/mbox-to-json
Also extracts the Attachments for you.
If you want to convert it into CSV instead, change line 55 in src/main.py from df.to_json to df.to_csv
Currently i am doing one project in that we need to generate report from database.
Since my server memory is too low im getting 'Out of Memory' Exception when im writing it at serverside and also when i write directly to a excel file using http header as excel file im not able to create multiple sheets since my database table is huge more than 65536 rows.
I saw many solution using a third party tool but i cant use those into mine..If anyone already worked on this please give me some direction.
Also i tried using javascript but for that i need to use datagrid at server side??
but in my project i m not allowed to use like this.
You can open an excel file, as an xml document using the Open XML format SDK: http://msdn.microsoft.com/en-us/library/bb448854.aspx
How would you suggest working with files that is stored on the note of a entity in Crm. Could you write a generic method that will enable you to access any type of file? Or would it be better to have a method for dealing with each type of file?
For example, we are going to be saving a mix of swf files and xml files on the entity, so would it make sense to have a method each for example:
GetXmlFilesOnAccount(accountid)
GetSwfFilesOnAccount(accountid)
When you upload an attachment to CRM the mimetype is also saved as part of the record information.
The following link contains a nice example of how to download the attachemt using a single method. http://crmscape.blogspot.com/2009/10/ms-crm-40-sending-attachments-to.html
The post is missing the actual query needed to retrieve the annotations but you can tell what columns are required from the method signature.
My suggestion using your methods:
* GetXmlFilesOnAccount(accountid)
* GetSwfFilesOnAccount(accountid)
Retrieve account activitypointers by regardingobjectid(in your case accountid guid)
Loop through returned activitypointers
Get attachments for each activitypointer (activitypointer.activityid = activitymimeattachment.activityid)
Store attachments (disk, etc)
You don't even need two methods. You can retrieve all attachment file types for a given note (annotation) with a single method.
Hope this helps.
I recently started an Open Source Project on CodePlex to accomplish exactly that. Feel free to check out the Project's Web Page at:
http://crmattachdownload.codeplex.com/
You can also view the source code under the "Source Code" tab of that same page.
Pete