convert special characters html to excel in vb.net - html

I have a web page which I want to convert to excel. I have created an HTML file with a gridview and then convert it to excel. The problem is that in the excel file, some of the columns are shown in the general format and like this 6.5E15. However, they are credit card numbers and should not be shown this way. So the user has to change the cell format to number manually to see the whole credit card number. What should I do to make this right in my code.

Well, I read the posts but they did not help me. At last I used the String.format function and changed the format of the string and put some spaces in the middle of it so that excel would not be able to change it to a number. Therefore 6037991497126305 was shown as 6037 9914 9712 6305. Well It solved my situation because the card numbers are usually written this way and it wont confuse anyone. But I still do not know how to solve this in other situations.

Related

In LibreOffice Calc, How To Access Raw HTML in a Cell?

I have a LibreOffice Calc spreadsheet that has a column with HTML formatting in it, including links. There is some data in the HTML that I need to preserve and extract. This would be easy to do if I could access the raw HTML, but I cannot figure out how to access the raw HTML within LibreOffice itself, nor can I figure out how to export it.
I would ideally like to find a solution of some sort of formula or function I could place in a new column, which would make that column display the raw HTML so that I can work with it using basic string operations. Alternatively if there is some sort of in-app command like a change of formatting in the menu or a way to use "Paste Special..." to view the HTML, I could do that too.
Failing this, I could settle for a solution that would preserve the raw HTML when exporting the data to CSV format or some other easily-parsable format. I have unfortunately not figured out how to do this either; when I export to CSV the HTML formatting is lost.
As a last resort I would be open to a custom macro using basic but I would rather find a simpler solution.
I have also tagged this as OpenOffice because I suspect this question may only be relevant to aspects of LibreOffice that have not changed from OpenOffice, although if this is not the case I would be interested to know about it!

Is it possible in HTML to separate a comma-delimited .txt file into seperate columns?

The text file has thousands of devices, the text file needs to be read and put into two seperate columns
text file name is servers.txt, ive tried searching on stackoverflow already and could not get it to work properly.
Example text is:
test,server
test1,server
test2,server
If you can do this outside of HTML, try the following.
Copy your data into a spreadsheet (the 'Original' column below):
The formula for 'Left' is:
=LEFT(K6,SEARCH(",",K6)-1)
The formula for 'Right' is:
=MID(K6, SEARCH(",",K6) + 1,LEN(K6))
You can't do this "in HTML." As mentioned in the comments, you'll need a server-side programming language, or possibly JavaScript, or do it by hand, as above, and copy it back wherever you need it.
The question is a bit unclear so it's hard to tell what will work the best.

How do I convert a dynamic coded hyperlink in excel to the equivalent HTML code?

I've found a similar question, but the answer didn't solve my issue. I'm trying to do a similar thing as this post, but I'm not sure if my original Excel cells are populated with the same thing.
Mine don't have a fixed link, but rather reference other cells using the following formula:
=HYPERLINK("https://www.website.com/search/?search="&B2, "View")
I've tried running the VBA code from the linked post above, but no luck. Is there a tweak for this to populate the resolved URL into the proper HTML code using "View" for the hyperlink text? The value in cell B2 is a number, let's say 12345.
So I'd like the end result to populate the cell with:
<a href="https://www.website.com/search/?search=12345>View</a>
End goal: I'm trying to export the Excel data as HTML table code, so trying to prepare the cells for proper HTML format to display the links on the website. Any export method I've found just exports the hyperlink cell as plain text "View" which is obviously not the desired result. If I can convert these cells before the export, then that solution would work fine.
Alternately, if there's a way to directly export the entire spreadsheet to an HTML encoded table (while also converting the hyperlinks as above), that would be even better. Note: the export to website function within Excel (using 2016) does not work...I need simple, plain HTML list code that doesn't reference the original spreadsheet.
Sorry if I've misunderstood your question, but does this help?
Function for Column B
="<a href='https://www.website.com/search/?search="&A2&"'>View</a>"

SSRS - embed URL and formatting characters in parameter

I'm making a form letter in SSRS 2012 that will be delivered by email. I had it working fine but now the powers that be have requested a much more dynamic aspect to it based on the individual recipient... Different paragraphs now need to be included/excluded based on the target.
With that, I pulled the body of the email out of SSRS and am now assembling it in SQL Server and passing it over to SSRS as a parameter (so that I don't wind up making a dozen SSRS reports to handle the need).
I have that part working too now, but hit a snag... There were a few bullet points as well as URL's that could look nicer. I'd like to force an indention before the bullet points and replace www.mysite.com with something prettier like "Click Here". On the SSRS side of the fence, I currently just have a single text box (and ideally would keep it that way) which contains an expression that references my "EmailBody" parameter.
So far, I have not found the right combination of words to send to Google to see if this is possible, so I figured I'd go straight to the pros here. I did try formatting the output in a similar manner to what an expression would look like ( ="This is the body of my email" ) and it just passed that straight on through to the final output.
Any ideas would be appreciated!
Jason
In case it helps anyone else, I figured out the secret.
Change your text box in SSRS to expect HTML by right-clicking on the placeholder (<< EXP >>) inside the text box, selecting Placeholder Properties, and change the Markup Type to "HTML - Interpret HTML tags as styles".
After that, go back to the SQL Server side of the fence and change the text you are sending as a parameter to HTML with whatever styling properties you desire.
Sounds like you're on the right track with the HTML markup. I also wanted to suggest that you can use a data-driven subscription. Have the query generate the HTML you want. Then have that populate the body of the email. That way there's no need for any attachments. This has come in handy when I wanted to display a small table of data for viewing on a mobile device rather than having to open an Excel attachment.

HTML to EXCEL -> simple question

O have a ,,export to excel" function, I have some tables and it works fine, but I have one single problem.
For moving to the next line I use <br />, but what if I want to switch to the next column? What tag can I use to switch to the next column?
Thanks
Simple HTML tags are supported on a limited basis by Excel. There used to be a list of supported HTML tags as well as some HTML extensions supported by Excel (from Excel 97 onwards), but I can't find it on MSDN anymore. Here's an alternate link:
http://www.code4lifesoftware.com/articles/msexcelreadme.htm
The new XML/HTML format supported from Excel 2000 onwards is a lot more complex, and requires more work:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoffxml/html/ofxml2k.asp
Take a look at these links, hopefully you'll find the syntax you're looking for!
In all Excel versions where I used this approach no other way to go to another column, but to use the table. You can mark up your html file with a table layout (although this is not recommended by W3C), and place all of the nested data table inside the main layout table. Unfortunately no other way.
P.S.: Look at Excel html format: Saving and Opening HTML Files.
The BR tag has a mso-data-placement style attribute specifying where the data is stored. The attribute can have one of the following string constants: new-cell means to start a new cell in the next row after the break and same-cell means that the break is in a cell.
If you use commas and make your file a .csv, that would be one way. If you use tabs, then have it read as a tab delimited file. Basically, you need to tell Excel what your delimiter (separator character) is, and it will handle it from there.