|
It really difficult for me to tell. this is my example
I have menustrip on my form such as (File,Edit,...) When the form load I want it create sub-menuitem and create event by itself.
Thanks
................
|
|
|
|
|
How can I create a report of a table (no hierarchy) with a static design but a varying sql-select-cmd. In detail: the shown fields shall remain the same but the underlying sql-select-cmd shall change in its where-part (links between tables and choice of parameters) and its from-part (the tables needed for the where-part).
I mean I'd like to set the sql-select-cmd as a string. When I start with a new report I can define a select cmd (even complicated ones) instead of choosing tables and defining links between them. But I've not found a possibility to change this cmd afterwards. ... Neither in the documentations, nor in the hierarchy of classes and its members.
Thanks for your hint in advance
Michael
Versions: Crystal Report: 9.1.5 in Visual Basic .NET 2003 (7.1.3088)
|
|
|
|
|
I am saving results to a text file and want my information to line up in nice little columns
Name Status Extra Info
Test A Pass 10.0
Test B with longer name Fail 7.5
Test C, short Name Pass 17.5
But what I get using VBTAB is inconsistent:
Name Status Extra Info
Test A Pass 10.0
Test B with longer name Fail 7.5
Test C, short Name Pass 17.5
Not sure if I can use a format function of not, documentation does not supply much info on format for text strings, just dates and numbers
I understand the fonnts can not be a serif font, this is just for display to an operator
|
|
|
|
|
Hello No-e,
You have to write the data as fixed length column files. Determine your output fields and find out the best fit MAX length of the data for each column. Then use VB/VB.net LSet(), RSet() functions are Trim() functions to write your columns in fixed length.
Hope this will help you solve your problem.
Nathhani
|
|
|
|
|
A text file has no formatting capabilities, so you have to use spaces to line them up, and specify for anyone who will be using it to use a non-proporional font when displaying it.
You can use alignment in composite formatting to line up the columns. Example from MSDN:
string myFName = "Fred";
string myLName = "Opals";
int myInt = 100;
string FormatFName = String.Format("First Name = |{0,10}|", myFName);
string FormatLName = String.Format("Last Name = |{0,10}|", myLName);
string FormatPrice = String.Format("Price = |{0,10:C}|", myInt);
Console.WriteLine(FormatFName);
Console.WriteLine(FormatLName);
Console.WriteLine(FormatPrice);
FormatFName = String.Format("First Name = |{0,-10}|", myFName);
FormatLName = String.Format("Last Name = |{0,-10}|", myLName);
FormatPrice = String.Format("Price = |{0,-10:C}|", myInt);
Console.WriteLine(FormatFName);
Console.WriteLine(FormatLName);
Console.WriteLine(FormatPrice);
Example output:
First Name = | Fred|
Last Name = | Opals|
Price = | $100.00|
First Name = |Fred |
Last Name = |Opals |
Price = |$100.00 |
---
b { font-weight: normal; }
|
|
|
|
|
The example is for VB.NET though... will need to pad with spaces in VB6.
Chandra
|
|
|
|
|
Hi -
I have a bunch of dates stored in a database and I have a bunch of dateTimePickers on my form.
How do I set the DateTimePicker at runtime ?
I know how to fill the dataset and that whole business, I'm more concerned with formating the date
and putting it in the value property of the dateTimePicker ? That I haven't figured out.
p.s. I'm not databinding nor would I like to
Thanks
Shawn
|
|
|
|
|
All you have to do is set the DTP's Value property. It expects a DateTime value, so you might have to convert your date information to a DateTime[^] before you pass it to the DTP.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am programming in Visual studio 6 (visual basic). This seems to be a popular This seems to be a popular topic but I couldn’t find any references
I have a program that our employees run that contains customer info and item info. I would like to be able to access the information currently being displayed by that program from another program we need to write. Once we gather the information and do some calculation, I would like to write the result back onto the displayed form in a specific field. We do not have source for the executing program. Can you help?
thanks a ton
|
|
|
|
|
Can any one tell me how to format a number in Vb.net 2005 like "XXXXX-XXX" = 12345-678.
jds1207
|
|
|
|
|
Use the string.Format method. It has to be a string, you can't show an int like that without converting it to a string.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
One thing I forgot to tell you is that the numbers that I am trying to format is coming from a file and being output to an sql database. Here is some code for you to look over just to see what is going on. I am trying to create a function and call the function in the If, Then statements.
Format Function:
Public Function FormatPartNumber(ByVal partnumber As String, ByVal formatstyle As String) As String
FormatPartNumber = String.Format(partnumber, formatstyle)
Below is one function to write the file to database and format numbers the only problem that I am having is that the number that I am trying to format will appear as XXXXX-XXX in the database instead of the actual number.
Private Sub ImportKawasakiUtilityGenerator()
Dim dttable As New DataTable
Dim row As DataRow
Dim CheckforProducts As DataTable
Dim FormattedPartnumber As String
Dim FormattedSupercedePartNumber As String
Dim Conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Data Feeds\Current\Kawasaki\Utility Generator Only;EXtended Properties=""TeXt;HDR=No;FMT=FiXedLength"""
Dim SQLstr As String = "SELECT * FROM IMINF012.dat"
Dim da As New OleDb.OleDbDataAdapter(SQLstr, Conn)
FormattedPartnumber = vbNull
FormattedSupercedePartNumber = vbNull
da.Fill(dttable)
DataGridView1.DataSource = dttable
For Each row In dttable.Rows
CheckforProducts = ProductExist(row("itemnumber").ToString(), "3")
If Trim(row("formatcodeforitemnumber").ToString()) = "0" Or Trim(row("formatcodeforitemnumber").ToString()) = "" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXX-XXX")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "1" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXX-XXX-XX")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "2" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXXX-XXXX")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "3" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXXX-XXXX")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "4" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXX-XXX-X")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "5" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXX-XXXX")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "6" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXX-XXXX-XX")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "7" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXX-X-X")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "8" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXXX-X-X")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "9" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXXX-XXXX-XX")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "A" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXXX-XXXXX")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "B" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXXXXX-XXXXX-XX")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "C" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XX-")
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "D" Then
FormattedPartnumber = FormatPartNumber(row("itemnumber").ToString(), "XXX-")
End If
Hope this gives you a better idea of what I am trying to do!
jds1207
|
|
|
|
|
Sorry, I didn't mean to copy all of the If statements.
|
|
|
|
|
This looks like it needs to be refactored pretty badly.
Really, what you need to do is change each line to something like
FormattedPartnumber = string.Format("XXXXXX-XXXXX-XX", row("itemnumber").ToString())
where the XXXX-XXXX-XX bit is replaced by a real format string.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The database is showing the partnumber now but the number is still not formatted. I think it might have something to do with the function below:
Public Function FormatPartNumber(ByVal formatstyle As String, ByVal partnumber As String) As String
FormatPartNumber = String.Format(formatstyle, partnumber)
End Function
Any ideas?
jds1207
|
|
|
|
|
Hello @ll.
Today i tested something out about referencing. A made a blank vb6 .exe project and added some references (.dll's). i compiled the project and opened it with a hex editor and disassembler. but i couldnt find any text about the included references. the only one which is allways there is msvbvm60.dll. nothing more. how did the compiled programm use the references? where are they listed??
any suggestions??
regards,
steve
|
|
|
|
|
did you actually use any of the ones you referenced? If not they may not be included
|
|
|
|
|
Just because you included a reference does not mean that they actually get imported. You have to use something in those references for the functions you used to show up in the Imports table.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi.
I have a question regarding setting printer properties programmatically.
Here's what needs to be done.
I need to set properties of the Ricoh multi-function printer to have default color set to 'black & white' when user logs into the machine (printer is on a network).
The problem I have I don't know if it's possible. If it is, and the program/script can be created I will call it from a batch file, which runs every time user logs in.
Is there anyway I can use VB.NET or any other languages to set Color to 'black & white' by default for that printer. We are trying to eliminate color printing especially when it's not needed.
Thank you in advance.
-- modified at 16:19 Tuesday 31st October, 2006
|
|
|
|
|
I have an application that I am almost ready to package. What are options to protect your code from being copied by others and deployed to others ? Is there a way to keep your code from being copied ?
|
|
|
|
|
If it's VB.NET, there's not much you can do to stop people reading your code. Protecting how your app deploys for those who don't know how to read the code is another matter, lots of options there.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm having a strange problem with my forms in vb.net 2005
I created a new project by copying around forms from old projects.
Now, this new project runs OK (using the startup form of course), but it does not show the startup form as part of the project!
I can only seem to find the form by searching for a text string that I know is in it.
The code for the form is then visible, but the DESIGN of the form is not.
How can I open both the code and the corresponding design?
tia
|
|
|
|
|
did you by chance put the form in a namespace? in 2005 when you put a form in a namespace, you need to put it in the code as well as the designer otherwise your form becomes a class only.
|
|
|
|
|
Hi.
I'm not sure exactly what you mean. Do you mean that I need to have this sub in my code?
Private Sub TopForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If so, then do have it.
I think that my form exists (invisibly to me within the project) in the \my project folder. When I choose "save myproject topform.vb" the form is then also saved in the project's root directory. But then if I try to load the form from the root directory, it's as if the form is there twice and I get "duplicate" errors.
I can't seem to make the form that exists in the \my project folder visible to my project!
thanks again!
|
|
|
|
|
I am folder happy within my projects separating code and functionality. So I have a folder called 'forms'. I not only put all my forms in that folder but I also add a namespace to each form so that each form belongs to the namespace 'Forms'. ex: Dim oFrm as new Forms.Form1 In 2005, they separated the designer from the rest of the code with the introduction of "partial class"es. So if you put a form in a namespace you need to put the namespace above the class of your code as well as the partial class for your form so that each piece belongs the 'forms' namespace.
if you weren't using namespaces, then this obviously wasn't your problem. Have you tried to create a new form and copy the code in from the hidden on to see if that "corrects" the problem.
|
|
|
|