|
Hi all,
I just want to know something about the GIOS PDF article: http://www.codeproject.com/cs/library/giospdfnetlibrary.asp?df=100&forumid=172932[^]
what do we need in our documentation if we use GIOS? Like When you use FOP you need the Copy Right slogan and the license agreement.
But i can't see anything about this in the GIOS article?
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi Code Project Team.
Someone know if it's porssible make subquerys in Excel using OleDb?
SINCERELY.
ANTHONY ACUÑA
PREFERED PHRASE:
SOMEBODY TELL ME WHY IS MORE REAL WHEN I DREAM THAT I AM WAKE?
|
|
|
|
|
The Microsoft.Jet.OLEDB provider supports IN, ANY/SOME/ALL, and EXISTS subqueries. Thus, you should also be able to make these subqueries with Excel. I have not tested this, however.
|
|
|
|
|
How can I print Barcode with no page?
Who can tell me,Thank you!!!!
|
|
|
|
|
What do you mean by 'no page' ? Do you have the barcode in a bitmap ? Are you generating it at all, or is that your question ?
There are articles on this site on generating barcodes.
|
|
|
|
|
I would like to know if there is a simple way to traverse an HTMLDocument using XPath in C#. All the solutions I have seen so far, involve converting the HTML to XML and then using the XML document for XPATH navigation. I would like to know if there is a way to go through the DOM using XPATH like DOM Level 3 does and not have to convert HTML to XML.
|
|
|
|
|
If your HTML is not XHTML, then there's no way to parse it with the DOM, or any other XML technology, as it's not XML.
Well, written HTML IS XML, it doesn't need converting.
|
|
|
|
|
Christian Graus wrote: Well, written HTML IS XML, it doesn't need converting.
Assuming that it is XHTML, of course. HTML is not XML.
---
b { font-weight: normal; }
|
|
|
|
|
I thought I just said that ? Who writes HTML now and DOESN'T write XHTML ?
|
|
|
|
|
Christian Graus wrote: Who writes HTML now and DOESN'T write XHTML ?
The ones who write HTML. The ones who write XHTML writes XHTML, not HTML.
---
b { font-weight: normal; }
|
|
|
|
|
XHTML IS HTML, although not all HTML is XHTML, obviously.
|
|
|
|
|
Thanks for your answer, I don't totally agree with it, but I have to admit that its is close to correct.
Comming from the java world (I just pick up .Net this month) and having worked with Mozilla Firefox, I have navigated HTML (most accuratly DOM) using XPath before. In fact the DOM level 3 API does specifies an XPATH API which has been implemented in the mozilla browser and allows for XPATH navigation of HTML (last time I tried it about 6month ago it was very slow, but did work).
Since I need to be able to do some work with the HTML node that I would select via XPATH, (i.e In addtion to parse the text, I might need to change their HTML properties and have these result show in the HTML document) the options of creating a duplicate well-formed HTML or XHTML will not work for me.
After some reading and research, I decided to implement my own HTML XPATH navigator for HTML by extending the XPathNavigator class. Technically, my XPATH navigator navigates the DOM tree created by MSHTML and not the true HTML text source, but this will work fine for my purpose and to me is not differnt then manipulating the DOM via javascript. I am nearly done with my implementation, and hope to be finish testing in a few days, when I'm done, I'll put my code on the site.
Since I am navigating the DOM with my XPATH navigator instead of the source, there are a few notable differences:
1) All HTML Tag names have to be specified in upper case regardless of what case they were in the source document.
2) attribute node contain all the attributes specified in the schema (or at least most of them) so using the navigator navigation function like moveToFirstAttribute() probably will not position the the navigator curson on the first attribute specified in the source, but will position it on the first attribute according set of the union of those specified in the source and those specified in the schema. This is also fine for my purpose.
|
|
|
|
|
Hello Code Project Team.
Someone know how get the row index from excel spreadsheet?
Example:
[Profile.xls - spreadsheet1$]
<br />
| FirstName | LastName | Age |<br />
---|-----------|-------------|-----|<br />
1 | Anthony | Acuña | 22 |<br />
2 | Michael | Danagan | 24 |<br />
3 | Benjamin | Beat | 24 |<br />
4 | Monica | Danagan | 23 |<br />
C# Code
<br />
OleDbConnection conn = new OleDbConnection();<br />
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Profile.xls;Extended Properties=\"Excel 8.0;HDR=YES;IMEX=1;MaxScanRows=0;\"";<br />
conn.Open();<br />
<br />
DataTable dt = new DataTable();<br />
<br />
string SQL = "SELECT * FROM [spreadsheet1$] WHERE FirstName LIKE 'M%'";<br />
OleDbDataAdapter da = new OleDbDataAdapter(SQL, conn);<br />
da.Fill(dt);<br />
<br />
this.dataGridView1.SuspendLayout();<br />
this.dataGridView1.DataSource = dt;<br />
this.dataGridView1.ResumeLayout();<br />
This work correctly and only show:
| FirstName | LastName | Age |<br />
|-----------|-------------|-----|<br />
| Michael | Danagan | 24 |<br />
| Monica | Danagan | 23 |<br />
But I need retrieve what is the row index on excel file for every row.
I need show the info in DataGridView in the follow format:
<br />
| ExcelIndex | FirstName | LastName | Age |<br />
|------------|-----------|-------------|-----|<br />
| 2 | Michael | Danagan | 24 |<br />
| 4 | Monica | Danagan | 23 |<br />
I hope that you can help me.
Thanks in advanced.
-- modified at 22:55 Sunday 12th November, 2006
SINCERELY.
ANTHONY ACUÑA
PREFERED PHRASE:
SOMEBODY TELL ME WHY IS MORE REAL WHEN I DREAM THAT I AM WAKE?
|
|
|
|
|
Im gonna guess that you cant just add a row to the excel sheet, and write the numbers in yourself?
Hmm, perhaps, creating a temporary array to store all the data from the excel sheet, then you can use the index from that, but of course, if its a big document it would consume alot of memory.
|
|
|
|
|
Hi, first post on this site.
I've just started C# really and have been using some of these tutorials and microsoft's video series. But, I got bored of the video series and started just playing around.
I decided, I wanted to create a web browser, so I added the web browser object to my form and a textbox and button to type in the address and initiate the search respectively.
Then I decided I wanted to add a bookmark feature, so I added a menuStrip and a Bookmark tab to it. I made it create a new instance of Bookmark.cs which I had created. On the Bookmark.cs form I added a listbox and button.
The listbox displayed the data from a database that I had added to the project, I entered some example data and this all worked. But, when I click the button on the Bookmark.cs form, I want it to set the webBrowser1.Navigate() function to the SelectedValue of the listbox on Bookmark.cs. Yet, I cant because webBrowser1 isn't public.
What I am really asking is, how do I make webBrowser1 public, so that I can access it from Bookmark.cs?
Thanks,
Any reply is appreciated.
|
|
|
|
|
The problem is not that it's not public, it's that it's not static, so you need a copy of the form that contains the active control, for you to be able to access it. This is the wrong way to do it anyhow, you don't want to make the control public, you want to either expose a method that calls the Navigate function, or, better yet, set up a delegate so that your bookmark form can call into your main form and do this for you.
|
|
|
|
|
As I said, I'm a beginner at C# so could you please go into more detail on that because I don't know what you are talking about, except the static bit. What is the right way to do it?
Any reply appreciated.
|
|
|
|
|
The way i usually do global variables is with a class, like this:
internal class Globalvars
{
internal static int variable;
Globalvars(){}
}
You just mark all the variables as internal static, and you call them like this:
Globalvars.variable
Just store variables there and access them from somewhere alse later on.
You should be able to access them from anywhere.
I don't know if this helps but.. there you go.
|
|
|
|
|
Well, the first step is to not create global variables if you can help it.
www.codeproject.com/csharp/passdatadelegate.asp would be one example of how to use delegates. Have the bookmark page define a delegate which is hooked up to a method on the main form, and passes through the URL to browse to.
|
|
|
|
|
Hi
I have a suggestion to make.How about writing a method in you web browser from that gets a bookmark and ask the web browser to nvaigate to it.
for example:
<br />
public void NavigateToBookmark(Bookmark bm)<br />
{<br />
this.webBrowser1.Navigate(bm.Url);<br />
}<br />
Anyway,I don't think that declaring the web browser control as public is a good idea,because if you do so,you make your bookmark dependent to a specific webbrowser and that's not good if you want to use the bookmark in some other code.Instead you can make your bookmark holds a reference to a webborwser(not to use a specific webbrowser) or you can pass a webbrowser object to your bookmark
<br />
public class BookMark<br />
{<br />
WebBrowser browser;<br />
public BookMark(WebBrowser browser)<br />
{<br />
this.browser=browser;<br />
}<br />
public void Navigate()<br />
{<br />
this.browser.Navigate(this.url);<br />
}<br />
}<br />
Or
<br />
public void Navigate(WebBrowser browser)<br />
{<br />
browser.Navigate(this.url);<br />
}<br />
Regards
|
|
|
|
|
Thanks, I think I will try this, also thanks for the help christian but that link doesn't work.
Thanks all.
|
|
|
|
|
Ok, I don't know what to do now. I am creating a TextEditor (because I saw it in another post ).
Anyway, I have created the main form, but when the program starts it displays another form called newDlg.cs It has buttons on, with labels saying "Create a Text File:" or "Create a CSV File:" etc.
When the button is clicked, it opens the main form and assigns a variable called fileFormat to 1 or 2 (for Text File and CSV respectively). The fileFormat variable is then used to determine whether the file can be saved as a .txt or a .csv when the user clicks Save.
I need to somehow make fileFormat global because it is used in newDlg.cs and Main.cs
I tried the method of creating a globalVars.cs class but that didn't work.
Anyone got any idea?
Thanks.
|
|
|
|
|
Hello,
I am very new to the usage of C#, The task for me to perform is to convert a "string" to a list of objects. I would receive a string message, read the message and split it accordingly into list of file objects as shown below.
XXX OK|<error string=""> CRLF
[IPv4Addr:< IPv4 dotted IP address> CRLF
Port:<port number=""> CRLF
Uplink BW: <bandwidth in="" kbps=""> CRLF
File: <file name=""> CRLF]*
EOM: CRLF
It would be great, if anyone could help me on this.
Thanks,
Kishore
|
|
|
|
|
You can use the split method to turn it into an array of strongs ( using a space as a delimiter, from the look of it ). What you do to parse the strings after that depends on what you need.
|
|
|
|
|
Hi Kristamed, you can use the Regular Expressions, these have more powerful.
SINCERELY.
ANTHONY ACUÑA
PREFERED PHRASE:
SOMEBODY TELL ME WHY IS MORE REAL WHEN I DREAM THAT I AM WAKE?
|
|
|
|