Jump to content
Xtreme .Net Talk

krinpit

Avatar/Signature
  • Posts

    33
  • Joined

  • Last visited

Everything posted by krinpit

  1. Hi, Is the following possible? I want to create a report in the following format. Currency A Currency B Currency C BEGINNING ACCOUNT BALANCE 0.00 0.02 0.02 BALANCE CHANGES FOR THE DAY 0.00 0.00 0.00 CURNCY/SECURITY VALUE CHANGES 0.00 0.00 0.00 I'm not sure if cross tab is even the correct method, but ; * The column names are fields on the database * The field values are fields on the database * The Row names are based on field names on the database, but ideally they would be hard coded. Please help -John
  2. Hmmm, Just as I feared. I like the For Each construct; the for x = 0 method is a little messier, but it will have to do. Thanks dynamic_sysop
  3. I'm trying to itterate through an arraylist, changing the value of each item. In the simplified code below, the values do not change in the arraylist itself. Is there a way around this? :confused: smsg = string.empty For Each x In arrTemp smsg &= x & vbLf Next x Messagebox.show(smsg) For Each x In arrTemp x = 100 Next x smsg = string.empty For Each x In arrTemp smsg &= x & vbLf Next x Messagebox.show(smsg)
  4. Check out this link http://authors.aspalliance.com/aldotnet/examples/translate.aspx
  5. jspencer, I see - so I should be able to add an Object of Class Person to the ComboBox. But how does the ComboBox render the person (or even know to display the Person's Name)? I have quickly done up some code which you might point out the necessary Changes? Private Class Person Public sID As Integer Public sName As String Sub New(ByVal sID As Integer, ByVal sName As String) Me.sID = sID Me.sName = sName End Sub End Class Private Sub frmSyncComboboxes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim myPerson As Person myPerson = New Person(1, "John") Me.ComboBox1.Items.Add(myPerson) myPerson = New Person(2, "Joe") Me.ComboBox1.Items.Add(myPerson) myPerson = New Person(3, "Jim") Me.ComboBox1.Items.Add(myPerson) myPerson = New Person(4, "Jack") Me.ComboBox1.Items.Add(myPerson) End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Dim myPerson As Person = Me.ComboBox1.SelectedItem MessageBox.Show(myPerson.sID & " - " & myPerson.sName) End Sub Thanks, I appreciate your patience.
  6. Hi, I've been using the ComboBox control for quite some time now, but one thing I've never got around to finding out is whether you can track the ID of each item in the ComboBox. For example, I have a table on a database with a list of People and each record is identified by a Primary Key. What I want to be able to do is populate a ComboBox with People's names and when an item is selected from the ComboBox I want to immediately know the primary key of that item (not the SelectedIndex). Is there some method of "tagging" each item in the ComboBox with an ID? Up to now, I've been synchronising my combobox with an ArrayList. As you can imagine, this gets quite frustrating after implementing the nth ComboBox :-\ Thanks, -John.
  7. I guess a kind of an extension/variation of mocella's answer would be to * Define a 4th layer called WorkFlowLayer (WFL) or something * Ensure that all the other layers are dependant on the WFL * In the WFL, define a module (not a class) called modGlobalVars. * Define the variables you will use in modGlobal Vars - eg: Public System_Mode As String The beauty of defining modGlobalVars as a module rather than a class in this scenario is that it doesn't have to be instantiated before it's used.
  8. Hi there, My Environment is VS.NET 2002 (VB.NET) and Crystal Reports for Visual Studio .NET I want to know if it is possible to dynamically add Text Objects at runtime to a Crystal Report. I already know how to populate existing Text Objects, but I want to explore this more fully. I have already read the material at this link: http://support.businessobjects.com/library/kbase/articles/c2012549.asp , but I don't think it applies to my version of Crystal Reports - Correct me if I'm wrong. I look forward to hearing from you. -John.
  9. I found the solution to this problem. It's a documented Crystal Reports bug. When you set the text of a textbox programmatically, the new value gets truncated to the length of the old. So, if the textbox was blank (zero-length) at design time it will look like nothing happened at all. Apparantly, the workaround is to use a formula field instead. Thanks to http://groups.google.ie/groups?hl=en&lr=&ie=UTF-8&newwindow=1&safe=off&threadm=u4yfkYT8BHA.2596%40tkmsftngp05&rnum=3&prev=/groups%3Fq%3DReportDefinition.ReportObjects(%2Btext%26hl%3Den%26lr%3D%26ie%3DUTF-8%26newwindow%3D1%26safe%3Doff%26selm%3Du4yfkYT8BHA.2596%2540tkmsftngp05%26rnum%3D3 for that one
  10. Hi, I'm sorry for hijacking this thread, but it seems to be inactive and the topic is relevant to my question. My development Environment is VB.NET 2002 with the version of Crystal Reports that is bundled with VS.NET 2002. I want one of my reports to be blank ie: not dependant on any stored procedures or database tables etc. I believe that the way to do it is to drag a text object onto the blank report and somehow populate it at runtime (correct me if I'm wrong ;) ) I thought I had the answer from here: http://support.businessobjects.com/library/kbase/articles/c2014872.asp But I have reproduced the code in my form and the TextObject remains blank when I run it. I even changed the formatting of the TextObject to make sure that it is in place at runtime - it is Here is the code I have used: Private Sub frmCRUnbound_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim myReport As New CrystalReport2() Dim txtObj As TextObject txtObj = myReport.ReportDefinition.ReportObjects("txtTest") txtObj.Text = "Testing 123, Testing...." CrystalReportViewer1.ReportSource = myReport End Sub And, attached, is a screenshot of my output. Any Ideas as to why my text isn't appearing in my report :confused:
  11. I'd say I feel so stupid, but that would detract from your extreme patience. You are 100% correct - It was a panicked oversight by me. Thanks very much for all your help. I have managed to successfully deploy a report to another machine. I'm off to play in the dirt and eat some bugs now ;)
  12. I know :-\ . It's just that the regwiz.msm file doesn't appear in the list of mergemodules that I can select. Any idea how to get these necessary files to be recognised as merge modules? As you can imagine, it's really frustrating to be so close to deploying my reports and to be stumped by something like this.
  13. In Form2 you could utilise the following Dim frmCallingForm As Object Public Sub New(ByRef frmCallingForm As Form) 'This is a constructor which should be called with: Dim frm As New Form2(Me) MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() Me.frmCallingForm = frmCallingForm End Sub Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click Me.frmCallingForm.Label1.Text = Me.Textbox1.Text End Sub
  14. No - Nothing worth looking at. A picture paints a thousand words. See the two screenshots attached. Not on mine for some reason :( No, I'm trying to add it the exact same way as you describe. I've started a new project with just the bare minimum requirements now, so no complications....
  15. Indeed there is - but when I go to add an assembly, I can't find the required assemblies in the list. I have to browse to find them, but then VS.NET doesn't recognise them as merge modules and therefore doesn't expose the properties that I need to access. Maybe I need to do something to make windows recognise the .msm files as merge modules? Any ideas? Thanks, John.
  16. Hi, I've got a problem which I have seen plastered all around the web on message boards, but I have not yet encountered a well documented solution. With this question, I aim to change all that ;) I can create and run Crystal Reports fine on my own development machine, but when I try to install the project on other machines on the network, I get the following error - "Cannot find keycodev2.dll or invalid keycode" Most of the solutions that I have found so far insist that one needs to add the relevant .msm files (listed in http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_deployment.pdf) to the setup project. To do this I * Right click in the File system window of the setup project * Click Add-> Assembly * Scroll down through the tab (which is labeled ".NET", looking in vain for something which resembles regwiz.msm * Give up and click "Browse" and navigate to C:\Program Files\Common Files\Merge Modules\regwiz.msm * Click OK Of course, the solution now sees this as a type "File" rather than type "Merge file" and does not expose any relevant properties to me - Most importantly the "License" Property So there you have it, I'm well and truly stumped. Hopefully somebody can give me some pointers on this one. BTW: I have the version of Crystal Reports that came bundled with VS.NET 2002, and I have registered it. :confused:
  17. Hi - I don't know how complex this particular question is, but here goes. I have 2 solutions - (PROJECT1) which monitors a mailbox and does processing on files as soon as they come in (PROJECT2) which contains other classes and is used by users on a daily basis. Basically, as soon as a certain email comes in, I want to call function PROJECT2.MYCLASS.MYFUNCTION() from PROJECT1. Is this possible? Thanks, John.
  18. Well, the good news is that I've solved my problem. (I've posted the new code below). The bad news is, I had to use an ugly work around, and it doesn't diminish my curiousity as to why the previous method didn't work. :confused: The URL in question is: http://www.msci.com/eqpages/body_DM.S.8.html Public Function readWebPage(ByVal strURL As String) As ArrayList Dim arrBuff As ArrayList Dim sr As IO.StreamReader Dim hwRequest As HttpWebRequest Dim hwResponse As HttpWebResponse Dim receiveStream As Stream Try hwRequest = CType(WebRequest.Create(strURL), HttpWebRequest) hwRequest.Timeout = 999999999 hwResponse = CType(hwRequest.GetResponse(), HttpWebResponse) receiveStream = hwResponse.GetResponseStream() sr = New StreamReader(receiveStream) Dim sLongStr As String = sr.ReadToEnd() 'Read stream into a string, all in one go arrBuff = MultiLineStringToArrayList(sLongStr) Catch ex As System.Net.WebException MsgBox(ex.Message) Catch ex As Exception MsgBox(ex.Message) Finally If Not (sr Is Nothing) Then sr.Close() If Not (hwResponse Is Nothing) Then hwResponse.Close() hwRequest = Nothing End Try Return arrBuff End Function Private Function MultiLineStringToArrayList(ByVal sLongStr As String) As ArrayList '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'This Function divides a string into a new string for every line '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sLongStr = sLongStr.Replace(vbCrLf, vbLf) ' Replace any Carriage returns with a normal LineFeed Return New ArrayList(sLongStr.Split(vbLf)) ' Array with a line per element End Function
  19. Hi, I need to read and parse a webpage to obtain certain information from it on a daily basis, in a VB.NET environment. I can successfully initialise the request and can receive some information from the webpage in question, but it's as if it sometimes times out and only returns to me what I managed to obtain from the stream while it was alive. Sometimes I manage to get only around 500 of the lines into my arraylist at the end. Please see my code and see if I'm missing something... Dim arrBuff As New ArrayList() ' Results go in here Dim myHttpWebRequest As HttpWebRequest Dim myHttpWebResponse As HttpWebResponse Dim receiveStream As Stream Dim encode As Encoding Dim sr As IO.StreamReader Try myHttpWebRequest = CType(WebRequest.Create(strURL), HttpWebRequest) myHttpWebResponse = CType(myHttpWebRequest.GetResponse(), HttpWebResponse) receiveStream = myHttpWebResponse.GetResponseStream() encode = System.Text.Encoding.GetEncoding("utf-8") sr = New StreamReader(receiveStream, encode) Do Until sr.Peek = -1 strLine = sr.ReadLine arrBuff.Add(strLine) Loop Catch ex As System.Net.WebException MsgBox(ex.Message) Finally sr.Close() myHttpWebResponse.Close() End Try
  20. Please pardon my ignorance everyone. I would like to process emails as they come in to the mail server, bypassing Outlook altogether. I would like to scan and move messages, save attachments and all sorts of stuff that it is simple enough to do when programming via Outlook. So where do I start? What sort of things should I be looking out for and experimenting with? Many thanks
  21. dynamic_sysop: Thanks for the work around. Keep up the good work
  22. I'm trying to do the following Dim xlRange As Excel.Range Dim xlCell As Object xlRange = xlbook.Sheets(sSheetname).Range(sRange) For Each xlCell In xlRange.Cells 'Do Something Next xlCell but I get a System.Runtime.InteropServices.COMException saying "Member not found" on Line For Each xlCell In xlRange.Cells Any Ideas?
  23. Thanks for posting the solution Shireen, This proved helpful for me.
  24. The Solution that worked for me was suggested on a different board by http://forums.devshed.com/showthread.php?threadid=92549&goto=newpost Sano Thanks your your input
×
×
  • Create New...