|
Please try to search in code project article base. CP itself have nice project for drawing line graphs Click here to get one[^]
|
|
|
|
|
You can use third party tools available. If you do not want to do that, you can create excel chart or do as Navneeth suggested.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
Hi,
I'm using cr 8.5 and vb6. I'm using crystal report control component in my appln. I've created report with two parameters. My report is working well alone by refreshing and passing parameters. But I'm facing problem in vb6, while I call report with passing parameters. I'm getting Invalid parameter field value in "cr1.Action = 1" line. This is my code below.
cr1.ReportFileName = App.Path & "\rptCovLetToCommodityPmnts.rpt"
cr1.ParameterFields(1) = "pBankCode:" & lstrBankCode & ":True"
cr1.ParameterFields(2) = "pDate:" & Format(cmbPaymentDate, "dd/MM/yyyy") & ":True"
cr1.Action = 1
Pls. anybody give me the soln. I tried in different ways. Tnx in adv.
Balasubramanian K.
|
|
|
|
|
Its been a while since I've used CR8.5 and VB6. Just eyeballing the code, I think it should be something like the following
cr1.LogonInfo(0) = strLogin 'This will depend on how your report is setup.
cr1.ReportFileName = App.Path & "\rptCovLetToCommodityPmnts.rpt"
'I **think** the params are zero based and pass the param value only.
cr1.ParameterFields(0) = lstrBankCode
cr1.ParameterFields(1) = cmbPaymentDate
cr1.Destination = crptToWindow
cr1.Action = 1
If you are using MS SQL for the report, you can open profiler to see exactly what Crystal is using as the query to see what is wrong as well.
Hope this points you in the right direction.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
hi i am using a stream reader to read a text file from the resource file, i have tried two way to read each line and put it into i combobox but i get the following errors, can someone point out where i am going wrong, thanks in advance
Using readfile As StreamReader = File.OpenText(My.Resources.mages)'Illegal characters in path.
Do
line = readfile.ReadLine
My.Forms.Main.cbspells.Items.Add(line)
Loop Until line Is Nothing
readfile.Close()
End Using
Using readfile As StreamReader = New StreamReader(My.Resources.magea)'Empty path name is not legal.
Do
line = readfile.ReadLine
My.Forms.Main.cbabilities.Items.Add(line)
Loop Until line Is Nothing
readfile.Close()
End Using
J.Hardy
|
|
|
|
|
Can you please try something like this :
Dim line As String
For Each line In My.Resources.mages.Split(System.Environment.NewLine)
If line <> String.Empty Then
My.Forms.Main.cbspells.Items.Add(line)
End If
Next
For Each line In My.Resources.magea.Split(System.Environment.NewLine)
If line <> String.Empty Then
My.Forms.Main.cbabilities.Items.Add(line)
End If
Next
Since My.Resource.<<resource-name>> will return content of resource, and it is not suitable to reading with StreamReader.
Please reply if this works for you
|
|
|
|
|
that works fine thank you
J.Hardy
|
|
|
|
|
Hi,
If I have more thank one Workbook open and running in the background, how do I specify which wookbook my "" line is to look up?
(See the "PROBLEM IS HERE" & "AND HERE" lines below to see where I require help with code. Something must be insertable I figure.)
The other option might be in the module where the declairations are. Maybe it's possible to link the "xlsCellTs" to "xlsSheetTs" and or "xlsBookTs".
Try
xlsBookTs = xlsApp.Workbooks.Open("F:\filelocation\ts" & Format_(Me.MonthCalendar1.SelectionStart, "yyyyMMdd") & ".xls")
ExcelTsOpen = True
'Counts slots used and assigns value to tbxTinsToday
SlotsUsedToday = 0
TotalSlots = 0
NRow = 2
'Learns how many Total Slots are avail on any day.
PROBLEM IS HERE (Below)!!
Do Until xlsCellTs.Range("A" & NRow).Value = ""
TotalSlots = TotalSlots + 1
tbxTotalSlots.Text = TotalSlots.ToString
AND HERE (Below)!!
If xlsCellTs1.Range("F" & NRow).Value = 1 Then
SlotsUsedToday = SlotsUsedToday + 1
End If
NRow = NRow + 1
Loop
tbxSlotsToday.Text = SlotsUsedToday.ToString
Catch ex As Exception 'Blank Date not previously used open SlotStatsIST.xls
xlsBookTs = xlsApp.Workbooks.Open("F:\filelocation\SlotStatsDefault.xls")
ExcelTsOpen = True
xlsSheetTs = xlsBookTs.Worksheets(1)
xlsBookTs.SaveAs("F:\filelocation\ts" & Format(Me.MonthCalendar1.SelectionStart, "yyyyMMdd") & ".xls")
ExcelTsSaved = True
End Try
Many thanks in advance to all helpers.
|
|
|
|
|
It looks like you already specified which workbook to use when you started using the Range object of the xlsBookTs object you created. Or are you asking how to specify which worksheet to use?
In that case, you can either use the corresponding Worksheet object in the Workbook's Worksheets collection, or you can directly specify which worksheet to use in the Range address specifier (.Range("A" & NRow) in your code). This would look something like .Range("SheetName!A" & NRow) .
|
|
|
|
|
I think we are getting close thanks to your help Dave.
I failed to mention the other workbooks that would be open due to trying to keep the code example to a minimum, however I am including a sample of the Module code below to show what other delairationa may be floating around in use at any given time.
Public xlsBookFds As Excel.Workbook
Public xlsSheetFds As Excel.Worksheet
Public xlsCellFds As Excel.Range
Public xlsBookTs As Excel.Workbook
Public xlsSheetTs As Excel.Worksheet
Public xlsCellTs As Excel.Range
Public xlsCellTs1 As Excel.Range
Public xlsBookMdrs As Excel.Workbook
Public xlsSheetMdrs As Excel.Worksheet
Public xlsCellMdrs As Excel.Range
In the format you mentioned;
.Range("SheetName!A" & NRow).
is the
! the code so the computer can seperate the sheet name from the cell location? That being the case I might hazard a guess that the code
.Range("BookName!SheetName!A" & NRow).
might be right.
Can thank you enough for your help so far Dave, looking forward to your reply.
Regards,
Frank
|
|
|
|
|
*Can't thank you enough* I meant. Oops
|
|
|
|
|
frankiebaby2 wrote: is the !the code so the computer can seperate the sheet name from the cell location?
That's how Excel seperates worksheet names from cell names, yes.
|
|
|
|
|
I need help figuring out how to display the sql view of a query using VBA. I have an Access 2003 database that contains a little over 300 queries. Yikes!
I know in Access you can open a query in Design view and then change the view to SQL view so that you can actually see the Select statement. Instead of doing that more than 300 times to cut and paste the query statement, I would like to write a quick macro to display the information.
I was able to figure out how to loop through all my query objects and display the name, but I can't find a way to actually get at the sql view of the query. Below is the code I have:
Dim obj As AccessObject
Dim dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllQueries
MsgBox "sql view: " & obj.FullName
Next obj
When I watch the obj data, there isn't any properties for the sql view. I thought this information would be in there. Am I misunderstanding what this object contains? It seems like I'm pretty close because I'm able to see the name of all the queries I have in my DB. What crucial piece of information am I missing?
Thanks,
FMPol
|
|
|
|
|
You may want to try looking at this[^]. If that doesn't work for you, I got more results from a carefully worded Google search, "vba access query sql text[^]". No, seriously, I had to go through about 15 search phrases to find the right combination of keywords.
|
|
|
|
|
Thanks Dave that was exactly what I needed. I think every google search I tried had 'view' in it and that must have been my big problem. I've posted the new code below:
Dim db As Database
Set db = CurrentDb
Dim curSQL As String
Dim qrynam As String
For Each qrydef In db.QueryDefs
qrynam = qrydef.Name
curSQL = qrydef.SQL
MsgBox "sql name: " & qrynam & Chr$(13) & "sql view: " & curSQL
Next
|
|
|
|
|
I am using the code below to successfully insert a new line just below every occurence of BEN*JE*ZZ*1041C0700X~ in the text file C:\myFlow_35.txt. My problem is, myString does not always = BEN*JE*ZZ*1041C0700X~; it will always start with BEN*JE*ZZ*
How do I give a value to myString to consider the other possibilities?
Private Sub btnTranslate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTranslate.Click<br />
MessageBox.Show("you are about to Translate file; make sure you have documented the original Reference Number")<br />
<br />
Dim refNum As String = Me.txtFileNum.Text<br />
Dim FileName As String = "C:\myFlow_35.txt"<br />
Dim myString As String = "BEN*JE*ZZ*1041C0700X~"<br />
Dim newString As New StringBuilder<br />
<br />
newString.Append(My.Computer.FileSystem.ReadAllText(FileName))<br />
newString.Replace(myString, myString & vbNewLine & "REF*LU*" & refNum & "~")<br />
My.Computer.FileSystem.WriteAllText(FileName, newString.ToString, False)<br />
<br />
MessageBox.Show("End of Translation ... Adios!")<br />
End Sub
Please gimme some ideas ... no pressure, but I have a 10 PM deadline today!
|
|
|
|
|
There is no wildcard character in string comparisons.
You're really confusing people when you ask questions. You said this code works as expected, but it doesn't do anything anywhere close to what you said it does.
Anyway, in a previous example that you posted, you had code in there to check if the string started with a certain substring, and in this case, that would be "BEN*JE*ZZ*". So, you'd do something like this:
If myString.StartsWith("BEN*JE*ZZ*") Then
....
|
|
|
|
|
Thanks for your input Dave. i dont mean to confuse you, but my code as posted does exactly what I need it to do, save and except the conditional values of myString. I am trying to learn and just looking for suggestions.
|
|
|
|
|
IvanIT wrote: save and except the conditional values of myString.
Well, that's kind of the important part! Don't just snip out parts of your code when you post snippets, at least not without a note saying you did so. People will look at your code and wonder what you're smoking.
|
|
|
|
|
I think there's no easy way. Since you use StringBuilder I think that one option is to convert it to string and then split by the known character sequence like:
Dim knownChars() As String = {"BEN*JE*ZZ*"}
Dim lines() As String = newString.ToString().Split(knownChars, StringSplitOptions.None)
after that you can loop through lines array and after each BEN*JE*ZZ* item, you'll add newline to the item after that at position 11.
|
|
|
|
|
I will gie this option a whirl and post the results here. Thanks again.
|
|
|
|
|
You're welcome
Hopefully it works.
|
|
|
|
|
I have already shown you how to use a regular expression to match a string using wildcards.
You are still using a StringBuilder, but you are not building any string. All that you manage to do with that is to copy all the string data one extra time.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thank you Guffa. I was suffering from one of those try and try again deal that ended up confusing me (and others). You have been a great help and I am learning. Thanks
|
|
|
|
|
How to sort data in DataGridView column who contain Date/Time records I click in header column but not sort correctly
|
|
|
|