I have an app where I am trying to localize about 100 strings into 15+ languages. When it comes to using resx in visual studio, I can only copy/paste into one cell at a time. Naturally, I don't want to have to do this 1500 times.
Is there a way/program where I can use to take all my translated strings, and just copy/paste them into the entire cell column, one time each for the 15+ languages I have?
I tried Resex, but at face value it doesn't look like I can do that? Maybe I am just using it wrong?
Thank you!
If you can get it a CSV file (e.g: export from Excel) I have a simple tool to convert the CSV to a RESX file: http://lostintranslation.apphb.com/ (select CSV to bundle and .NET)
Related
**
Hello
**
I'm creating a scheduling app that takes in 2 MS-Project .mpp files (master and updated) and converts the data into SQLite tables then compares them both and displays the results and allows you to write the changes you make back to the master file. I had issues with Microsoft Interop because I don't own Microsoft Project. Is MPXJ a viable solution? The documentation I've read on it doesn't have many examples. If so how would I read it in and read it back? Were using MS-project 2016
I know nothing of MPXJ, so sorry if I overlook a more straightforward answer. It sounds to me like another way of looking at your problem is you want to:
1. Parse a MS Project file (and then do it again) and store results in memory
2. Do some data manipulation and calculations of the in-memory project data
3. Put that data into a database
I think you're stuck at step 1 because without MS Project, you lack a parser; correct? There are other ways to parse a project file. The simplest may be to have your users first convert the files to a more open format (e.g. XML) when they save them from their instances of MS Project. Lacking that, there are certainly libraries out there that can parse a Project file. Try taking a look at Gantt Project, https://sourceforge.net/projects/ganttproject/ . Being open source, you could look at that parser as a starting point; I'm not a license expert, but you may even be able to re-use the code from there.
Good luck!
I need to make the information in the database usable by allowing the user to download it as a PDF or Excel spreadsheet (either one works, both is perfect).
I've looked around at a bunch of options, but I really can't decide which one I should use, let alone if any of those options are actually useful. Most of the options I've found revolve around converting already existing HTML files into PDFs which is not what I need. Also, it needs to be free. My bosses haven't given me a budget to spend on this
I'm not sure what other information I should include here.
Well, any help is greatly appreciated. If you have questions about missing information, I'll get it posted ASAP. I'm here all day, so I'll be able to respond to any comments very quickly.
EDIT: Oh wow! Huge thanks, guys, for the massive response! I got a ton of ideas. This is super-helpful. Thanks!
if you want to generate an Excel (or also a Word) you can use openXml. You can create a new document exactly the way you want from pure code.
OpenXml SDK page
The solution I usually propose to my clients in this situation is to use Sql Server Reporting Services (SSRS). You can use the ReportViewer control included with it in order to generate PDF's, Excel spreadsheets, XML files, CSV files, and others. If you need ad hoc reporting, there is a Report Builder available as well.
Barring that, you can use OpenXml to generate Excel spreadsheets and there are a host of PDF toolkits available.
Have you looked into the reportviewer control, which is part of Visual Studio?
It allows you to export the report in PDF or Excel format.
http://www.carlosag.net/tools/excelxmlwriter/sample
check this might be useful for you
There are lots of reporting solutions out there such as SQL Server Reporting Services(for which you might already have a license). Take a look at Reporting (free || open source) Alternatives to Crystal Reports in Winforms which can likely be applied to the web with a bit of serialization.
I would suggest thinking about rolling your own depending on the situation. You could use pdfsharp for the pdf export and EPPlus for excel. They are both very easy to use and, I'm pretty sure, available in nuget with a couple of clicks.
If you want to go the Excel route, i'd recommend this article from Stephen Walther entitled ASP.NET MVC Tip #2 - Create a custom Action Result that returns Microsoft Excel Documents. This uses an old trick of writing an HTML document with an Excel mime type. This is different than streaming a native Excel file. And it's fairly easy to change the to rendering a CSV file if you want to strip it down, and make it a more universal file. Just remember to double-quote all the fields if there's a possibility of commas showing up.
If what your doing isn't too complicated you can use CSV files. CSV stands for comma separated values, and it is what it sounds like. You can create simple tables and columns using commas. For example paste the following lines into a text file:
heading1,heading2,heading3
info1,info2,info3
info1,info2,info3
Save the text file as a .csv file and voila - an excel spreadsheet. Obviously it is extremely easy to build these looping object collections. Mind you if you need any complicated text formatting etc then it is not really the best option.
I'm looking to generate some C# code based on Excel data. Basically the Excel sheet contains definitions of functions that need to be generated in C#.
My current experience with code generation is mainly with ORM's. But now the "input" is Excel data.
I'm asking this to prevent me from re-inventing the wheel. Reading data from Excel is easy, and generating C# also. But I'm a lazy programmer.
Is there a code generation tool that accepts Excel files as input?
You can use T4 templates. I know this too common/abstract answer, but this is the way, I think, and I don't think you can find something already exist for that purpose. Visual Studio 2008 has native supports for them. In your T4 template you can read excel file and then use its data to create any code file you want.
I am guessing you will have to hand roll this solution. This does seem a little wonky, would be curious how you got in a situation where you are needing to do code gen based on Excel?!?
Having worked with this problem before, I suggest that you convert the excel file to a CSV.
Im my case, I transformed the CSV file into C# classes (which include property and method definitions).
I am required to produce a somewhat complicated excel workbook containing over 30 worksheets, each using information from several database tables to dynamically draw several tables per sheet, with formating. I have used c# in the past although I am unfamilar with its use in Excel. Any recomendations regarding to how to format and posistion cells dynamically from a database would be a great help.
Thanks in advance.
Visual Studio Tools for Office (VSTO) is your friend :) I use this all the time to build complex worksheets. This is way, way better than importing from CSV or using some kind of wacky DB connectivity.
Here are some links
MSDN
Blog
Wikipedia
This is very easy to do, though there are a few oddities. I find it very effective to use the Excell MACRO recorder to record actions, then look at the source and re-impliment in C#. The object model is exactly the same between VB and C#.
VSTO is part of Visual Studio 2008. I looked on the product page, but I cannot determine if it comes with VS2008 C# Express Edition. The easiest thin to do is just download it and see :)
Your question sounds like you already understand the technology involved, so this answer is restricted to formatting & layout.
I did something very similar 10 years ago. It's been a while, but here's what I figured out.
Put all calculated & summary info on top. (including 'bottom line' totals)
Base charts on the totaled cells at the top of the sheets since they don't move.
Put all charts, summaries, etc on their own sheet.
If there are calculations involved, make each step of the process available so the user can step through them. This will prevent you spending countless hours proving your code calculates according to spec, if you don't do this, your 'black box' calculations will be questioned constantly.
If they don't want to see the raw data, only the calculations, then consider pushing it out to a hidden sheet.
Store a template workbook with your app, then just copy it so you can do all formatting in XL, not code.
One thing you really want to avoid is keeping track of different cell locations. You want to push values into cells which are always in the same location.
I find a very effective and often underused feature in Excel is the Web Query.
If you can present your data in a website, you can pre-build your Excel workbook with web queries set up to gather the data from the website on demand, which is presented in the form of tables in appropriate web pages.
You can add query string parameters for passing arguments to the web page and you can set auto-refresh, formatting preservation, etc. PivotTables/Charts can refer to the data and can made up to update upon data refresh with a few lines of VBA, for example.
This is often a much simpler solution than VSTO if it can meet the requirements.
Another option would be to use a third party Excel file generation assembly.
I have a requirement to export the results of a SQL query to excel. I am currently exporting it into 2007 format, but everything I have found will only run in a x86 enviroment. The web site where the export is to take place is running on a x64 version of IIS.
Changing IIS to run x86 is not an option. My current solution is to save the export request to a DB, and write a windows service that can run in x86 and use that service to process the request.
I have started to look at the Open XML Format SDK 2.0 as a possible better solution.
Has anyone got any experence that would lend to a native .NET solution.
FYI: My budget is $0.00 so buying a tool is a no-go.
Personally from an ASP.NET application standpoint I have found that using XML and XSLT to go into the Excel XML format is the most effective, and really trouble free way to go. There are no costs involved, and once you get the hang of it, it is really quick!
In addition to that, I'm personally strongly against any form of automation to accomplish that kind of task.
I agree with Mitchel Sellers.
Another way is create a simple html document with table, the excel will quite accept.
Example:
<html><body>
<table>
<tr><td>First column</td><td>Second column</td></tr>
<tr><td>Value of first row in first column</td><td>Value of first row in second column</td></tr>
<tr><td>Value of second row in first column</td><td>Value of secondrow in second column</td></tr>
</table>
</body></html>
Mike, do you have any example I can look at? Exporting to Excel isn't something I have had much call foor ( None really ), so any head start would be nice.
TcKs, I tried the Html route and didn't much care for the way excel complained about the file format of html not being the expected .xls(x) format. I'm exporting for Sales guys, so the less messages thay have to wade through, ( and as a result questions I have to anyswer ), the better.
The simplest way that worked well for me is to create the Excel file in the correct format with one row of data.
Then save the file in html format and use it as a template for the actual data.
There is some metadata included that will automatically start Excel when doubleclicking the generated html file.
I had to go this way because we use Excel 2002 and 2003 which have no open file format.
Have a look at: http://www.codeproject.com/KB/office/excelxmlspreadsheet.aspx
I think we modelled an inhouse solution from this.