|
Thanks again, Dave.
Yes, I did look at that, and the key-value-pair regex works perfectly well. This would have been the second step that I mentioned in my question - I just wanted to reduce my question to the main point... If I could make the "Entr" group in my question have any content at all, I could easily replace it with the key-value-pair regex.
The problem is that I get either the "Grp" group (alone) or the key-value-pair (alone) matched. It seems that the \[ and \] literals do something out of (my ) control, which I also can't find in the reference. The funny thing is that the full match that the regex in my question finds only contains the first group with the surrounding [] brackets, so that the second group must be empty. Did you check it out in Expresso?
The full regex including the key-value-pair would be:
\[(?<Grp>.*)\].(?<Keyword>\w+)\s*=\s*(?<Value>.*)((?=\W$)|\z) Result:
- I get all the groups matched from my file example if I only test the first part (including the \] literal). The "Entr" group has the CR then, but not the following lines (i.e. none of the key-value-pairs)
- I get all the key-value-pairs matched if I only run a match on the second part, beginning from the Keyword-group.
Between the first and the second part of the regex is only a CR existing, which I try to match with the "." (=any character / once). But I get no match at all if I run the match like this.
|
|
|
|
|
for (regex in regexes_looked_at)
coder.sanity--;
More seriously, why not look at any of the many inifile parser classes available? There are even some here on CP. If you don't like any of them, Google will probably get you *waaaay* too many.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Thank you, Peter, for your time. I was considering using an inifile parser first, but didn't want to blow my little application up with many third party classes - also expecting the regex to be done in a minute... That's the way development goes sometimes, right? BTW did you see the other error in it which I was asking for??? After struggling for more than an hour it became a challenge to brighten up my blindness now, even if I might decide to use an inifile parser then.
|
|
|
|
|
FYI: CP now has a regular expressions forum.
|
|
|
|
|
Happy day ! I could resolve a part of my regex task in Expresso.
For the record and other users: Obviously ".*" for "any character / any number of repetitions" is not good enough to capture a CRLF! Trying to capture it with \r wasn't the right thing either, it took "\r\n" to match the group together with the first line! Here's the current status of the regex:
\[(?<Grp>.*)\]\r\n(?<Keyword>\w+)\s*=\s*(?<Value>.*)\r
The ultimate question would now be:
Of course the first key-value-pair after the group header isn't enough.
How can I include its repetitions into my match now?
|
|
|
|
|
\[(?<Grp>.*)\]\r\n((?<Keyword>\w+)\s*=\s*(?<Value>.*)[\r\n]?)*
I think this will help.
This contains multiple matches in keyword and value, just FYI.
|
|
|
|
|
This may not be the best forum for this question, but since I'm writing my application in VB.NET I figured this would be a good start.
Given:
VS2005 - Professional
I've created a label printing report in Crystal Reports which has 4 labels across and 8 labels down on a page.
My question is:
How would you go about providing functionality where I want to start my label printing on row 2, column 3 for the first page and just resume printing for the next set of pages?
I was thinking of maybe adding a 6 blank data rows to the dataset before binding it to the report and have the report suppress printing if the data is blank. Something like that.
Any other suggestions ?
|
|
|
|
|
David Mujica wrote: I was thinking of maybe adding a 6 blank data rows to the dataset before binding it to the report
That was what I was thinking.
Steve Jowett
-------------------------
Real Programmers don't need comments -- the code is obvious.
|
|
|
|
|
Is there away to MIME Encode a bitmap image with VB.NET 2008?
Steve Jowett
-------------------------
Real Programmers don't need comments -- the code is obvious.
|
|
|
|
|
Yes, that's possible. There's no native class that provides this out-of-the-box, but this[^] article might help.
I are Troll
|
|
|
|
|
Thanks Eddy
Steve Jowett
-------------------------
Real Programmers don't need comments -- the code is obvious.
|
|
|
|
|
Hi
I have a windows app with a datagridview and a textbox
On form load I bind the grid with all records in a table.
What I want to do is as I type in a textbox I want it to filter the grid to give me only what I have typed so far in the textbox.The seach will only filter on a specific colom and not on the entire grid's coloms.
Cna someone help me on this, I do it this way, because I dont want to hit the DB everytime I type a letter in the textbox.
Any ideas how to approach this?
|
|
|
|
|
|
Thank you so much, it seems that this will do the trick
But the moment I start typing in the textbox, the grid is empty and stays empty.
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
BindingSource.Filter = "ColName Like '" & textbox.text & "'"
End Sub
|
|
|
|
|
Depending on your data source e.g. SQL; you will need to apply suitable wild cards depending on how you want to search.
You need to prefix and/or suffix the query text with a % or an *
|
|
|
|
|
Member 4420534 wrote: the grid is empty and stays empty
ColName LIKE '*test'
I are Troll
|
|
|
|
|
I hope I posted in the correct forum, as I did not see a VBA forum. My apologies if not.
I am needing to solve a problem for a couple of coworkers. They have a workbook where several sheets are being utilized. The first sheet is a form, the second keeps track of each time the form is filled out. To keep the original form, I was planning on having a database to hold the information on the second sheet that both offices could have access.
The problem is that I have never passed parameters to a sql statement in VBA and never wrote to a database with an UPDATE statement in VBA. I've googled a bit about the subject but did not get any relevant results.
So I came here, hoping someone would have some experience with this.
Any help is appreciated.
Jude
|
|
|
|
|
Hi,
My program searches for youtube videos but somehow the returned atomfeed is incomplete
e.g if I search for "Star Trek Voyager, deutsch, Translokalisation" , I only got one result out of > 5 but if I search for other videos everything is fine...
My code:
Dim query As New YouTubeQuery(YouTubeQuery.DefaultVideoUri)
Dim Service As New YouTubeService("youtube")
query.OrderBy = "relevance"
query.Query = Name '<- "My key word"
query.NumberToRetrieve = 50
query.SafeSearch = YouTubeQuery.SafeSearchValues.None
Dim VideoFeed = Service.Query(query)
Of course you need the Google API...
Has anybody an idea?
|
|
|
|
|
I tried your keywords on the youtube-site, with this result;
"Star Trek Voyager, deutsch, Translokalisation" results 1 - 1 of about 1
It could be filtered out by SafeSearch;
The safeSearch parameter indicates whether the search results should include restricted content as well as standard content. YouTube will determine whether content is restricted based on the user's IP address or location,
..then there's this note at the bottom, saying;
Some search results have been omitted that contain duplicates. If you like,
you can repeat the search with the omitted results included
It's using a hyperlink with the original question and querystring-parameters, with the addition of the one below
&search_filter=0
I are Troll
|
|
|
|
|
Thanks,
And sorry for my late answer. I was quite busy
|
|
|
|
|
I have a database that contains plot coordinates, so I load this data in to my program and generate a Bitmap of the plots. So far so good.
I now need to print the resulting Bitmap on a RDLC report, so to achieve this I have created a strong;y type dataset to contain the required text based data plus a column PlotImage as a System.Object type column.
I've then created a report, and add Text Fields for the Text based data and an Image control for the plot bitmap. I have also the the EnableExternalImages property to True
When I run the report all the text data is showing, but the Image is not.
Any ideas?
Steve Jowett
-------------------------
Real Programmers don't need comments -- the code is obvious.
modified on Wednesday, July 28, 2010 11:35 AM
|
|
|
|
|
Assuming the image is not in the database and is external and not embedded you would need to set the expression on the rdlc to something like this
="file:///"Fields!Photo.Value
Also, refresh the report after setting external images to true this is on the reportviewer frm)
ReportViewer1.LocalReport.EnableExternalImages = True
Me.YourTableAdapter.Fill(Me.Shx_Dataset.table)
If Frmmyfrm.lblPhotoFileBefore.Text "" Then
Try
Frmmyfrm.Photo.Image = Image.FromFile(Frmmyfrm.lblPhotoFileBefore.Text)
Catch ex As Exception
MessageBox.Show(ex.Message, "Error Loading Photo", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Else
Frmmyfrm.Photo.Image = Nothing
End If
Me.ReportViewer1.RefreshReport()
End Sub
BTW, pdf's do not seem to like bitmaps so if you try to export to a PDF, don't be surprised if you see the dreaded red X...use jpg's.
|
|
|
|
|
mindserve wrote: Assuming the image is not in the database
I had actually stored the image in a DataTable, but after further investigate, I believe that the image needs to be MIME Encoded first.
As a alternative solution, I have tried saving the image as a file in the TEMP folder and using the example provided. It works well, Thanks.
mindserve wrote: BTW, pdf's do not seem to like bitmaps so if you try to export to a PDF, don't be surprised if you see the dreaded red X...use jpg's.
Thanks for the advice, it will save me alot time. Thanks again.
Steve Jowett
-------------------------
Real Programmers don't need comments -- the code is obvious.
|
|
|
|
|
Hi Folks,
Just wondering if anyone could help me with this issue, all works fine on Dev and Testing machines and in some of our client sites just 1 or 2 cauing this issue:
"Run Time Error -2147023782 (8007045a):
a dynamic link library (DLL) initialization routine failed"
it appears to be on this line based on logging:
objconn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & m_strPath & ";Extended Properties=dBASE IV;" & _
"User ID=;Password="
m_strPath is C:\MyDbfs.
Anyone seen this issue before?
TIA
|
|
|
|
|
I would take a guess and say that either the database in question is not a dbase IV database, or Jet needs to be updated. You can start with this[^] and then here[^] to find the Jet SP8 update for your customers O/S.
I've never seen the problem before because I haven't used dBase since, oh, 1985.
|
|
|
|