add

ClosedXML add image

早过忘川 提交于 2019-12-05 20:02:24
I am able to add in an image to an excel spreadsheet by using OpenXML. However for the rest of the program I use ClosedXML to add data. I can add data at a specific cell using the column and row index. If I can add an image to an excel (It currently is a separate layer it seems, hovering over cells), how can I add it to a cell using ClosedXML? //Adds an image to the excel file public void AddImageToExcel(SpreadsheetDocument sd, MemoryStream imagestream) { DrawingsPart dp = sd.WorkbookPart.WorksheetParts.First().AddNewPart<DrawingsPart>(); ImagePart imgp = dp.AddImagePart(ImagePartType.Jpeg, sd

How2: Add a JPanel to a Document then export to PDF

为君一笑 提交于 2019-12-05 18:48:27
first post ever in any forum with regard to programming... i usually just search until i find the answer... but this time im really stuck... here's the problem... i have a JPanel, and recently discovered that itext provides you with a way to export Java GUI to PDF... i cant seem to understand itext's language nor how to add a simple JPanel to a document then export that document to a PDF... this is all i have at the moment... import java.io.FileOutputStream; import com.itextpdf.text.*; import com.itextpdf.text.pdf.*; import java.awt.Color; import javax.swing.*; public class HelloWorld { public

Jquery: Add rel attribute to <a> tags within all <li> tags of a certain class

夙愿已清 提交于 2019-12-05 17:22:26
I'm trying to add a rel="lightframe" attribute to all my 'edit' links within my admin_links_node_edit class. <li class="admin_links_node_edit"> <a href="[link]" title="Edit">Edit</a> </li> My code so far looks like this: $('.admin_links_node_edit a').each(function() { $(this).attr('rel','lightframe'); }); You don't need to use each(). jQuery's selectors will do it for you :) $('.admin_links_node_edit a').attr('rel', 'lightframe') The above code will do the trick. If admin_links_node_edit is reused among other elements, you'll want to specify the element you're working on ( li in this case). In

Fragment replace() not replacing all fragments

丶灬走出姿态 提交于 2019-12-05 17:12:23
If I call add() for fragments A and B with the same viewId and then try to call replace() on that viewId with fragment C, only fragment A is getting removed, ending up with fragments B and C. According to the docs, BOTH A and B should be replaced by C...or am I reading the docs wrong? Here's one combination that does this: public class FragmentActivity extends SherlockFragmentActivity { @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); getSupportFragmentManager().beginTransaction().add(R.id.fragment, new

Sonata Admin Action Button to Pre Filtered List

北城以北 提交于 2019-12-05 16:38:06
I am rather new to Symfony (2 weeks) so forgive my ignorance. I am trying to add a custom action button that will link to a pre filtered list of a RELATED entity. I have done a lot of research but can't quite seem to find what I need. Currently I have two entities Books and Authors with a manyToOne relation ship. I have these set up in Sonata Admin in the usual way and all works well. I even have an author filter on the book list page which I am hoping can be leveraged to accomplish my goal. In the Author list view, I would like to add an action button on each row next to View and Edit, called

How to setup python path for 2.7 on mac?

我的梦境 提交于 2019-12-05 15:39:25
I am aware that, this question has been asked and answered many times. But, still i couldn't get rid of this. I found out the following info on my mac. cd /Library/Frameworks/Python.framework/Versions/ Current -> 2.7 3.6 whereispython /usr/bin/python which python /usr/bin/python which -a python /usr/bin/python /usr/bin/python python Python 2.7.10 (default) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. Even though, when i edit ~/.bash_profile as below # Setting PATH for Python 2.7 # The original

Copy node and add value to attribute with Xslt

不问归期 提交于 2019-12-05 14:23:57
Basiccly i have problem with xml and xslt which i do not know how to solve, and would appreciate any help regarding this matter where to start. I have XML: <root> <test value="1" setting="3"> <tag1>data....</tag1> <tag2>data....</tag2> <tag n+1>data....</tag n+1> </test> <test value ... . . . </test> </root> Now i would now need to copy, all nodes in "test" node in this way and add always value 3 to settings value (settings value is changing in test node) in 4 new nodes like shown below so i would get: <root> <test value="2" setting="6"> <ni1 name="1" setting1="6">data....</ni1> <ni2 name="1"

JSF datatable: adding and removing rows clear rows values

空扰寡人 提交于 2019-12-05 09:47:05
I have a h:datatable showing a list of rows, and the fields of each row are input fields. I render an "Add Row" button before the table, and a "Remove Row" button on each row of the table. The baking bean is viewScoped, and the buttons add/remove elements from the java list in the backing bean, and then return to the same view. I set the immediate attribute to "true" in the buttons in order to not validate the input fields when I add or remove a row. Everything works ok but one thing: the values of the input fileds are cleared. I thought that the view kept the values beacuse the bean is

Add a subform to a form with ajax on submit

佐手、 提交于 2019-12-05 07:42:58
I read this article: http://www.jeremykendall.net/2009/01/19/dynamically-adding-elements-to-zend-form/ That was very interesting and it works fine. I need to do the same but with a SubForm. I mean that when a user presses a button, I call, via ajax, an action that adds, attaches and displays a subform to my existing form. For example: I have a form where a user must fill in the name and surname of his children, so there is a button "Add Child". When the user presses that button a SubForm should be added to my existing form and displayed. On submit it will validate exactly like the example in

How to make SVN ADD ignore binaries

懵懂的女人 提交于 2019-12-05 07:30:37
Binaries (under Linux) don't have an extension so I cannot exclude them using patterns. Thus when I use SVN add to add a directory I will get something like $ svn add recursion_vector/ A recursion_vector A recursion_vector/rec_vec.cxx A recursion_vector/rec_vec.h A (bin) recursion_vector/rec_vec Here rec_vec is the executable I would like to exclude. SVN obviously recognizes it as binary. Now can I tell Subversion to ignore all binary files? This is a bit verbose because it uses find: find [TARGET-DIRECTORY] \( -executable -type f \) -prune -o -print | xargs svn add --depth empty Passing the